A high energy bandgap electron blocking layer (EBL) just behind the active region is conventionally used in the nitride-based laser diodes (LDs) and light-emitting diodes (LEDs) to improve the confinement capability of electrons within the quantum wells. Nevertheless, the EBL may also act as a potential barrier for the holes and cause non-uniform distribution of holes among quantum wells. A most recent study by Han et al. (Appl. Phys. Lett. 94, 231123, 2009) reported that, because of the blocking effect for holes, the InGaN LED device without an EBL has slighter efficiency droop and higher light output at high level of current injection when compared with the LED device with an EBL. This result seems to contradict with the original intention of using the EBL. Furthermore, findings from our previous studies (IEEE J. Lightwave Technol. 26, 329, 2008; J. Appl. Phys. 103, 103115, 2008; Appl. Phys. Lett. 91, 201118, 2007) indicated that the utilization of EBL is essential for the InGaN laser diodes. Thus, in this work, the optical properties of the InGaN LDs and LEDs are explored numerically with the LASTIP simulation program and APSYS simulation program, respectively. The analyses focus particularly on the light output power, energy band diagrams, recombination rates, distribution of electrons and holes in the active region, and electron overflow. This study will then conclude with a discussion of the effect of EBL on the optical properties of the InGaN LDs and LEDs.