A semiconductor device, comprising: a semiconductor substrate of a first conductivity type; and a vertical Hall element formed on the semiconductor substrate, the vertical Hall element comprising: a semiconductor layer of a second conductivity type provided above the semiconductor substrate; an impurity diffusion layer of the second conductivity type formed in an upper portion of the semiconductor layer and having a concentration higher than a concentration of the semiconductor layer; a plurality of electrodes formed on a surface of the impurity diffusion layer, arrayed in a straight line, and each formed from an impurity region of the second conductivity type, the impurity region having a concentration higher than the concentration of the impurity diffusion layer; a plurality of electrode isolation diffusion layers of the first conductivity type each formed between two adjacent electrodes, to isolate the plurality of electrodes from one another; and a buried layer of the second conductivity type formed between the semiconductor substrate and the semiconductor layer, and having a concentration higher than the concentration of the semiconductor layer and lower than the concentration of the impurity diffusion layer. a semiconductor substrate of a first conductivity type; and a vertical Hall element formed on the semiconductor substrate, the vertical Hall element comprising: a semiconductor layer of a second conductivity type provided above the semiconductor substrate; an impurity diffusion layer of the second conductivity type formed in an upper portion of the semiconductor layer and having a concentration higher than a concentration of the semiconductor layer; a plurality of electrodes formed on a surface of the impurity diffusion layer, arrayed in a straight line, and each formed from an impurity region of the second conductivity type, the impurity region having a concentration higher than the concentration of the impurity diffusion layer; a plurality of electrode isolation diffusion layers of the first conductivity type each formed between two adjacent electrodes, to isolate the plurality of electrodes from one another; and a buried layer of the second conductivity type formed between the semiconductor substrate and the semiconductor layer, and having a concentration higher than the concentration of the semiconductor layer and lower than the concentration of the impurity diffusion layer. a semiconductor layer of a second conductivity type provided above the semiconductor substrate; an impurity diffusion layer of the second conductivity type formed in an upper portion of the semiconductor layer and having a concentration higher than a concentration of the semiconductor layer; a plurality of electrodes formed on a surface of the impurity diffusion layer, arrayed in a straight line, and each formed from an impurity region of the second conductivity type, the impurity region having a concentration higher than the concentration of the impurity diffusion layer; a plurality of electrode isolation diffusion layers of the first conductivity type each formed between two adjacent electrodes, to isolate the plurality of electrodes from one another; and a buried layer of the second conductivity type formed between the semiconductor substrate and the semiconductor layer, and having a concentration higher than the concentration of the semiconductor layer and lower than the concentration of the impurity diffusion layer.