We propose a new family of two-dimensional wavelength-hopping/time-spreading code for optical code-division multiple-access systems with balanced detection, and we numerically analyze the characteristics of the proposed system. By using the proposed decoding scheme, the undesired interference is efficiently eliminated. The proposed scheme has enhanced performance and allows for a large number of simultaneous users compared with the three-dimensional and other balanced codes for differential detection.