<para xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> The effect of residual stress and the sidewall emission in InGaN–GaN films with different thickness of sapphire substrate were investigated. The peak wavelength of electroluminescence was blue-shifted as thinning the sapphire substrate, because the wafer bowing-induced mechanical stress alters the piezoelectric field in the InGaN–GaN multiple quantum-well active region of the light-emitting diode (LED). A sideview LED with 170-<formula formulatype="inline"><tex Notation="TeX">$\mu\hbox{m}$</tex> </formula>-thick sapphire exhibited the highest output power of 14.04 mW at a forward current of 20 mA, improved by 7% compared to that with 80-<formula formulatype="inline"><tex Notation="TeX">$\mu\hbox{m}$</tex></formula>-thick sapphire. The maximum output power can be obtained by considering both the photon escaping probability from the edges of the sapphire and the photon absorption probability in the sapphire as well as the residual mechanical stress induced by the wafer bowing. </para>