A Hall resistance measurement unit measures a Hall resistance value in two or more current directions between a plurality of terminals of the Hall element. A Hall electromotive force measurement unit measures the Hall electromotive force of the Hall element. A temperature measurement unit measures an operating temperature of the Hall element. A compensation signal generation unit compensates the Hall electromotive force on the basis of the Hall resistance value from the Hall resistance measurement unit and a temperature output value from the temperature measurement unit. A compensation coefficient calculation circuit calculates a compensation coefficient on the basis of the Hall resistance value measured by the Hall resistance measurement unit and the temperature output value measured by the temperature measurement unit. The compensation coefficient includes a mechanical stress compensation coefficient and a temperature compensation coefficient.