An integrated rigorous coupled-wave analysis (RCWA) algorithm is presented in this paper, which can simulate full vertical-cavity surface-emitting laser (VCSEL) and photonic crystal surface-emitting laser (PCSEL) structures. A classic RCWA can only analyze a structure when the light source is incident from the top, bottom, or both sides of the device. However, for VCSEL applications, the light source is generated in the middle and propagates in both directions. A bidirectional scattering matrix method and doubling algorithm are implemented in RCWA. The resonant wavelength and Q factor of a VCSEL can then be found in the output spectrum. The accuracy and execution speed are compared with those of the Lumerical finite-difference time-domain (FDTD) method for several VCSEL and PCSEL designs. The results show that the maximum discrepancy between RCWA and FDTD is less than 3 nm, and the difference in the far-field divergence angle is less than 0.5°. The speed of RCWA also outperforms FDTD simulation significantly.