An electric current detector configured for mounting on a circuit board, said circuit board bearing a fluxgate-type magnetic sensor IC chip which detects magnetic flux for electric current detection, wherein the electric current detector comprises a ring-shaped core (4, 81, 91) which forms a magnetic-path for magnetic flux induced by detection-target electric current, wherein: a first leg portion of the core (4, 81, 91) includes a gap (41, 82, 92), and, the electric current detector is mountable on the circuit board with the radial direction of the ring-shaped core (4,81,91) parallel with respect to the circuit board, with the gap on, or on the upper side of, the magnetic sensor IC chip in the magnetic-path, such that leakage magnetic flux caused by the gap is detectable by the magnetic sensor, and such that a bottom surface of the core faces the magnetic sensor IC chip; and a primary conductor is arranged so as to be interlinked with the core (4,81,91) and a detection-target electric current conducts through said primary conductor; characterized in that: there is further provided a support member mountable on the circuit board, wherein the core (4, 81, 91) is fixed directly or indirectly on the support member, a bobbin is provided on a second leg portion of the ring-shaped core (4,81,91) opposite the first leg portion, a compensation coil is wound on the bobbin, the compensation coil being configured, when current flows therethrough, to induce a magnetic flux inside the core (4, 81, 91) and to cancel the magnetic flux induced inside the core (4, 81, 91) by the electric current of the primary conductor, and the thickness of the second leg portion is less than that of the other parts of the ring-shaped core (4,81,91) so that the compensation coil does not protrude from the bottom surface of the core. a first leg portion of the core (4, 81, 91) includes a gap (41, 82, 92), and, the electric current detector is mountable on the circuit board with the radial direction of the ring-shaped core (4,81,91) parallel with respect to the circuit board, with the gap on, or on the upper side of, the magnetic sensor IC chip in the magnetic-path, such that leakage magnetic flux caused by the gap is detectable by the magnetic sensor, and such that a bottom surface of the core faces the magnetic sensor IC chip; and a primary conductor is arranged so as to be interlinked with the core (4,81,91) and a detection-target electric current conducts through said primary conductor; characterized in that: there is further provided a support member mountable on the circuit board, wherein the core (4, 81, 91) is fixed directly or indirectly on the support member, a bobbin is provided on a second leg portion of the ring-shaped core (4,81,91) opposite the first leg portion, a compensation coil is wound on the bobbin, the compensation coil being configured, when current flows therethrough, to induce a magnetic flux inside the core (4, 81, 91) and to cancel the magnetic flux induced inside the core (4, 81, 91) by the electric current of the primary conductor, and the thickness of the second leg portion is less than that of the other parts of the ring-shaped core (4,81,91) so that the compensation coil does not protrude from the bottom surface of the core. there is further provided a support member mountable on the circuit board, wherein the core (4, 81, 91) is fixed directly or indirectly on the support member, a bobbin is provided on a second leg portion of the ring-shaped core (4,81,91) opposite the first leg portion, a compensation coil is wound on the bobbin, the compensation coil being configured, when current flows therethrough, to induce a magnetic flux inside the core (4, 81, 91) and to cancel the magnetic flux induced inside the core (4, 81, 91) by the electric current of the primary conductor, and the thickness of the second leg portion is less than that of the other parts of the ring-shaped core (4,81,91) so that the compensation coil does not protrude from the bottom surface of the core.