The effects of electron spillover from quantum wells on the optical property of InGaN/GaN laser diodes are theoretically studied in detail. A six-band model including strain effects is used to calculate valence band states. Continuous subbands unconfined to the quantum wells are simulated deliberately by densely discretized subbands for the spillover electrons. The calculation results show obvious differences in the radiative current densities and the gain spectra between the cases with and without considering the spillover effect. We further investigate the spillover effect on the radiative current densities and the spontaneous emission spectra, with variations in the depth and the width of quantum wells, the total loss of the cavity, and the temperature. For shallow wells, the spillover effect is particularly important. It broadens both the gain and the spontaneous emission spectra and hence deteriorates the threshold of laser diodes. Such an effect can be alleviated by employing a long cavity and a multi-quantum-well active region. The concept of the electron spillover studied in this work is not only applicable to the nitride lasers but also to other kinds of quantum-well lasers.