Magnetic Field of a Wire Calculator (Straight Wire & Circular Loop)
Magnetic flux density B around a long straight current-carrying wire (B = μ₀I/2πr) or at the centre of a circular loop or flat coil, in tesla, microtesla and gauss.
How it works
Long straight wire: B = μ₀·I / (2π·r) · centre of a loop of N turns, radius R: B = μ₀·N·I / (2R) · μ₀ = 4π × 10⁻⁷ T·m/A · H = B/μ₀ · 1 T = 10,000 G
A current produces a magnetic field that circles the wire (right-hand rule: thumb along the current, fingers show the field). Ampère’s law gives the field of a long straight wire, which falls off as 1/r. At the centre of a circular loop the Biot–Savart law gives B = μ₀I/2R, multiplied by N for a flat coil of N turns. Both formulas assume a vacuum or air around the conductor and, for the straight wire, a wire much longer than the distance r. Values use the CODATA vacuum permeability, as in OpenStax University Physics Vol. 2, chapter 12.
Worked example
A long straight wire carries 10 A. At 5 cm (0.05 m) the field is B = 4π × 10⁻⁷ × 10 / (2π × 0.05) = 40.00 µT, or 0.4000 G — about 0.8000 times the Earth’s magnetic field, which is why power cables can disturb a compass close up.
Sources: OpenStax University Physics Vol. 2 — Magnetic Field due to a Thin Straight Wire · NIST CODATA — vacuum magnetic permeability μ₀
Frequently asked questions
How does the field change with distance from a wire?
It falls in inverse proportion: double the distance and the field halves. A loop’s field far away falls much faster, as 1/r³.
Which way does the field point?
Use the right-hand rule: point your thumb along the conventional current and your fingers curl in the direction of the field lines around the wire.
What is the difference between B and H?
B (tesla) is the magnetic flux density that exerts forces; H (A/m) is the magnetising field set up by currents. In vacuum or air B = μ₀H.
Is the field from household wiring dangerous?
At 1 m from a cable carrying 10 A the field is about 2 µT, well below the ICNIRP public guideline of 200 µT at 50/60 Hz. Live and neutral run side by side, so their fields largely cancel.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.