A semiconductor device constituting a liquid ejection head for ejecting a liquid such as an ink, comprising a segment having a plurality of pairs of recording element and driving element, wherein a first wiring for mutually connecting a first terminal of each driving element arranged within the same segment is formed on a first wiring layer on a semiconductor substrate, and a second terminal of the driving element and a first terminal of the recording element are connected on one for one base, and a second terminal of the recording element is connected to a power source wiring formed by the wiring layer different from the first wiring layer, and an auxiliary wiring for mutually connecting the second terminal of the recording element with the same segment is formed by the first wiring layer, thereby eliminating and suitably adjusting the irregularity of wiring resistance values within the segment.