Magnetic field calculator

Pick the conductor – a long straight wire, a flat circular coil or a solenoid – and enter the current and its size. The calculator gives the magnetic flux density B in tesla, millitesla, microtesla and gauss and the field strength H. For a coil you can also move along its axis; for a solenoid you can add an iron core by its relative permeability.

Conductor
A
Length unit
Magnetic field B0.0002 T
In millitesla
0.2 mT
In microtesla
200 µT
In gauss
2 G
Field strength H
159.155 A/m

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Choose a straight wire, a circular coil or a solenoid.
  2. Enter the current in amperes.
  3. Enter the size: the distance from the wire; the number of turns and the radius of a coil (and the distance along its axis, 0 for the centre); or the number of turns and length of a solenoid, with μr for its core (1 for air).
  4. Pick the length unit and read B in T, mT, µT and gauss, and H in A/m.

Formulas

μ₀ = 1.25663706212 × 10⁻⁶ N/A².

  • Long straight wire: B = μ₀ I ÷ (2π r)
  • N-turn circular coil on its axis: B = μ₀ N I R² ÷ (2 (R² + z²)^(3/2)); at the centre B = μ₀ N I ÷ (2R)
  • Long solenoid: B = μr μ₀ N I ÷ ℓ = μr μ₀ n I
  • Field strength: H = B ÷ (μr μ₀)

Worked example

A long wire carries 10 A. At 1 cm: B = 1.25663706 × 10⁻⁶ × 10 ÷ (2π × 0.01) = 0.0002 T = 200 µT = 2 G.

A coil of 100 turns, radius 5 cm, 10 A: B = μ₀ × 100 × 10 ÷ 0.1 = 12.566371 mT at the centre. 5 cm along the axis it drops to 4.442883 mT.

A solenoid with 1000 turns on 10 cm and 1 A: n = 10,000 turns per metre, B = μ₀ × 10,000 × 1 = 12.566371 mT, H = 10,000 A/m.

Tips

  • The straight-wire formula needs a long wire: much longer than the distance r. Near the end of a short wire the field is weaker.
  • The solenoid formula needs a long coil. For a coil about as long as it is wide the real field in the middle is noticeably lower.
  • An iron core multiplies B by μr only until the iron saturates; this calculator assumes a constant μr.

Frequently asked questions

What is the magnetic field around a straight wire?

B = μ₀ × I ÷ (2π × r). 10 A at 1 cm gives 0.0002 T, which is 200 µT or 2 G – several times the Earth's field. The field lines are circles around the wire.

What is the field at the centre of a coil?

B = μ₀ × N × I ÷ (2R) for N turns of radius R. 100 turns of 5 cm radius carrying 10 A give 12.566371 mT. On the axis it falls off as R² ÷ (R² + z²)^(3/2).

What is the field inside a solenoid?

B = μ₀ × μr × N × I ÷ ℓ, independent of the diameter, for a long coil away from its ends. 1000 turns on 10 cm with 1 A give 12.566371 mT in air.

How do tesla and gauss relate?

1 T = 10,000 G, so 1 G = 100 µT. H in A/m is B ÷ (μ₀ μr); inside a solenoid H = n × I whatever the core.

More in Math

All tools in this category: Math ·Updated November 6, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.