A semiconductor device for adequately removing heat generated by a
semiconductor element is provided. A semiconductor device 100 is equipped
with a substrate 2, having a bottom surface 2b and an element mounting
surface 2a which is positioned on the opposite side of bottom surface 2b,
and a semiconductor element 1, having a main surface 1a which is mounted
onto element mounting surface 2a. With L being the length in the long
direction of main surface 1 and H being the distance between bottom
surface 2b and element mounting surface 2a, the ratio H/L is 0.3 or
greater. When the semiconductor element is a light emitting element,
element mounting surface 2a is a cavity 2u, and element 1 is provided in
cavity 2u. A metal layer 13 is provided on the surface of cavity 2u. In
addition, when an electrode 32 which connects to an external part is
provided on main surface 1a, on the cavity side of the part which
connects with electrode 32, main surface 1a is provided with a groove.
The groove is for preventing outward flow of connection member 34 of
electrode 32.