In reference to an AlInGaN UV LED fabricated in laboratory, the optical properties of the 370-nm UV LEDs are investigated with a self-consistent APSYS simulation program. The optical performance of the UV LEDs with different aluminum compositions in AlGaN electron blocking layer and different numbers of quantum wells are investigated in an attempt to optimize the UV LED structure. The simulated results show that the electron leakage current can be effectively reduced with the use of an AlGaN electron blocking layer with an aluminum composition of greater than 0.19, and optimum performance may be obtained when the number of quantum wells is three. Since the built-in polarization is one of the most important factors for the deterioration of III-nitride LED performance, the feasibility of using a lattice-matched quaternary Al0.18In 0.039Ga0.781N electron blocking layer in the UV LED to improve the LED performance is also numerically studied. The simulated results suggest that with the use of a lattice-matched Al0.18gIn 0.039Ga0.781N electron blocking layer, the polarization charge density in each heterostructure interface is reduced, the electrostatic field in quantum wells is reduced, and the maximum output power is sufficiently improved. The simulated results also indicate that better LED performance may be obtained when the Al0.18In0.039Ga0.781N electron blocking layer has a higher p-doping concentration due to reduced electron leakage and increased hole concentration in active region.