Fourteen diphenyl ether and diphenyl sul®de compounds were synthesized and a comparative study on their second-order nonlinear optical properties was carried out. The results showed that these two kinds of compounds all had fairly large molecular ®rst-order nonlinear optical hyperpolarizabilities b, but they have very different second harmonic generation (SHG). The diphenyl sul®de derivatives usually have strong SHG effects while almost all the diphenyl ether compounds have no SHG response, which can be attributed to their crystal structure. We found that the diphenyl sul®de compounds were easy to crystallize in a noncentrosymmetric style but the crystal structure of the diphenyl ether derivative was centrosymmetric, and therefore a zero x (2) was produced. The atom O or S was the real origin of the difference in their crystal structures, and therefore of the SHG effect.