Works on this device
Magnetic Field Calculator
Work out the magnetic field B, in teslas or gauss, made by a current or a magnet. Choose a long wire, a piece of wire, a loop or flat coil, a Helmholtz pair, a toroid or several wires around a point. You can also find the field on the axis of a neodymium or ceramic magnet, or the flux density of an electromagnet with an air gap.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose what makes the field: a wire, a loop or coil, a Helmholtz pair, a toroid, several wires, a permanent magnet or an electromagnet.
- Type the current, the turns and the sizes, and pick the unit of each from its menu. For a long wire you can also find the current or the distance for a field.
- For several wires, add one row for each wire with its current and its place (x, y). A plus current comes out of the page; a minus current goes into it. Type the place of the point P.
- For a magnet, take the remanence Br of its grade from the maker's data sheet.
- Choose Calculate. The answer shows B (you can change its unit: nT, µT, mT, T or G), the field strength H and the working.
The formulas
- Long straight wire: B = μ0 × I ÷ (2π × r).
- Straight piece of wire: B = μ0 × I ÷ (4π × d) × (b ÷ √(b² + d²) − a ÷ √(a² + d²)), with a and b the ends measured along the wire.
- Loop of N turns: B = μ0 × N × I ÷ (2R) at the centre; B = μ0 × N × I × R² ÷ (2 × (R² + z²)^(3/2)) on the axis.
- Helmholtz pair (two coils one radius apart): B = (4/5)^(3/2) × μ0 × N × I ÷ R = 0.7155 × μ0 N I ÷ R at the middle.
- Toroid: B = μ0 × μr × N × I ÷ (2π × r) inside the winding.
- Several wires: the field of each wire is added as a vector at the point P (superposition).
- Cylinder magnet on its axis: B = (Br ÷ 2) × ((L + z) ÷ √(R² + (L + z)²) − z ÷ √(R² + z²)). Block magnet: B = (Br ÷ π) × (atan(A W ÷ (2z √(4z² + A² + W²))) − atan(A W ÷ (2(L + z) √(4(L + z)² + A² + W²)))).
- Electromagnet (magnetic circuit): reluctance ℛ = l ÷ (μ0 × μr × A); flux Φ = N × I ÷ (ℛ core + ℛ gap); B = Φ ÷ A.
- Field strength: H = B ÷ μ0 in air, in amperes per metre. μ0 = 1.25663706127 × 10^-6 T·m/A (CODATA 2022); since 2019 it is measured and no longer exactly 4π × 10^-7.
- Right-hand rule: point your right thumb along the current; the fingers curl the way the field goes round a wire. For a loop, curl the fingers with the current; the thumb points along the field inside.
Worked examples
Wire. 10 A at 5.0 cm: B = 2 × 10^-7 × 10 ÷ 0.05 = 4.0 × 10^-5 T = 40 µT, and H = 31.8 A/m.
Loop. 10 turns of radius 5.0 cm with 2.0 A: B = μ0 × 10 × 2.0 ÷ 0.10 = 251 µT at the centre. On the axis, 5.0 cm from the centre, it falls to 88.9 µT.
Helmholtz pair. Two coils of 100 turns and radius 15 cm with 1.0 A: B = 0.7155 × μ0 × 100 × 1.0 ÷ 0.15 = 0.599 mT at the middle.
Point P. A wire at (0, 0) carries 10 A out of the page and a wire at (10, 0) cm carries 5.0 A out of the page. At P = (5, 5) cm the fields add to B = (−30, 10) µT: 31.6 µT, at 161.6° from the +x axis.
Magnet. A neodymium disc 20 mm across and 10 mm thick with Br = 1.3 T gives about 460 mT at the centre of its face and 250 mT at 5 mm from it.
Electromagnet. 400 turns with 1.5 A on an iron core (μr = 2,000, path 30 cm, area 4.0 cm²) with a 1.0 mm gap: the gap has 87% of the reluctance, Φ = 0.262 mWb and B = 0.656 T.
Limits you should know
- Wires are taken as thin, loops and Helmholtz coils as flat, and fields on an axis are worked out on the axis only.
- The magnet formulas are exact for an ideal magnet magnetised evenly along its axis. Real magnets come close; Br depends on the grade and the temperature. This tool does not give the pull force of a magnet.
- The magnetic circuit takes the core as linear, with no saturation, no leakage and no spreading of the field at the gap. Iron saturates at about 1.5 T to 2 T. It is arithmetic for learning, not professional advice.
- Answers are shown to the significant figures of your least precise input. A permeability of exactly 1 counts as exact.
- For a long coil see the Solenoid Magnetic Field Calculator. For the force of a field on a wire see the Magnetic Force On Wire Calculator, and on a moving charge the Lorentz Force Calculator. For the flux through a surface see the Magnetic Flux Calculator.