Audited 31 Jul 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

Solenoid Magnetic Field Calculator

Calculate the magnetic field inside a long coil, B = μNI/L, from core permeability, number of turns, current and coil length, with the answer in tesla.

Solenoid Magnetic Field Calculator

H/m
A
m
Ideal interior magnetic field
0.005
Magnetic flux density inside an ideal long solenoid, in its central region away from the ends, in tesla.
Model scope
Long, closely wound ideal solenoid with uniform permeability; finite-length/end effects, winding thickness, core nonlinearity, hysteresis, saturation, heating, frequency, and fringe field are outside it.

Background.

Wind wire into a long, tight coil, pass a current through it, and the magnetic field inside becomes remarkably simple: strong, nearly uniform and pointing straight along the axis, while just outside it almost vanishes. That arrangement is the solenoid, the working part of relays, electric door locks, valves, MRI magnets and the electromagnets on a physics bench.

For a long coil, the interior field depends on just three things besides the material inside it: how many turns there are per metre of length, how much current flows through them, and the permeability of the core. B = μNI/L. The coil's radius does not appear at all. A fat coil and a thin one with the same turns per metre and the same current produce the same interior field, provided both are long compared with their width.

With an air or vacuum core the permeability is μ₀ — 1.25663706127 × 10⁻⁶ H/m, the CODATA 2022 value used as the default — and fields stay modest: a thousand turns over half a metre carrying 2 A give about 5 millitesla, on the order of a hundred times the Earth's field at the surface. A ferromagnetic core multiplies μ by a large factor, which is why electromagnets are built around iron, but the gain is not linear. Iron's effective permeability falls as it nears saturation, around 2 T, after which extra current adds little; a single permeability value cannot represent that, so for cored coils treat the result as an upper bound.

The equation describes the ideal case. Near the ends the field spreads out, falling on the axis to about half its central value, and short, stubby coils never reach the ideal figure anywhere. Winding thickness, heating, alternating current and hysteresis are left out as well.

What is solenoid magnetic field calculator?

The solenoid field is the magnetic flux density B inside a long, closely wound coil, measured in tesla. In the ideal model the interior field is uniform and parallel to the axis and the exterior field is zero; Ampère's law then gives B as the permeability multiplied by the current carried per unit length of coil, μnI, where n = N/L is the number of turns per metre. It describes the central region of the coil, away from both ends.

How to use this calculator.

  1. Leave the permeability at μ₀ = 1.25663706127 × 10⁻⁶ H/m for an air-cored or hollow coil. For a core material, enter its relative permeability multiplied by μ₀, and read the result with caution.
  2. Enter the total number of turns as a whole number, counting every layer of a multi-layer winding.
  3. Enter the steady current through the winding in amperes.
  4. Enter the length of the winding in metres, measured end to end along the coil — not the length of wire. The answer is trustworthy only when this is several times the coil's diameter.
  5. Read the field in tesla; multiply by 1,000 for millitesla or by 10,000 for gauss.

The formula.

B = μNI/L

B = μNI/L. B is the magnetic flux density in tesla, μ the permeability of the core in henries per metre, N the number of turns, I the current in amperes and L the coil length in metres. N/L is the turn density n, so the equation is often written B = μnI: what matters is current per unit length, in ampere-turns per metre. It follows from Ampère's law applied to a rectangular path straddling the winding, assuming a uniform field inside and none outside, both good approximations only for a long, tightly wound coil. B rises in direct proportion to μ, N and I and falls in inverse proportion to L. The default μ₀ is the CODATA 2022 vacuum permeability; since the 2019 SI redefinition it is a measured constant rather than exactly 4π × 10⁻⁷ H/m, though the two agree to within a fraction of a part per billion. Turns must be a whole number and every input positive.

A worked example.

Example

A coil 0.5 m long has 1,000 turns carrying 2 A, wound on an air core, so the permeability is μ₀ = 1.25663706127 × 10⁻⁶ H/m. The turn density is 1,000 ÷ 0.5 = 2,000 turns per metre, and 2,000 × 2 A = 4,000 ampere-turns per metre. Multiplying by μ₀ gives 1.25663706127 × 10⁻⁶ × 4,000 = 5.027 × 10⁻³ T — about 5.03 millitesla, or 50.3 gauss. Doubling the current to 4 A doubles the field to 1.005 × 10⁻² T, while stretching the same 1,000 turns over 1 m halves it to 2.513 × 10⁻³ T, which also happens to be roughly the field on the axis at either end of the original coil.

magnetic Permeability Hm0
coil Length M0.5
current A2
turn Count1,000

Frequently asked questions.

Why doesn't the coil's diameter appear in the formula?
Inside an ideal long solenoid the field depends only on current per unit length, and Ampère's law gives the same result whatever the radius. This holds only while the coil stays long compared with its width; for a short coil, making it wider weakens the field at the centre, and this formula no longer applies.
What permeability should I enter for an iron core?
Multiply the core's relative permeability by μ₀, but expect to overestimate. With a relative permeability of 1,000 the example would give 5.027 T, far beyond what iron can sustain since it saturates at around 2 T. Real cores have a permeability that changes with field strength, so a datasheet B–H curve is the better guide.
How strong is the field at the ends of the coil?
On the axis at either end of a long solenoid, the field is about half the central value, because the winding extends to only one side of that point. In the 1,000-turn example that is roughly 2.513 × 10⁻³ T against 5.027 × 10⁻³ T in the middle. Off-axis and beyond the ends, the field spreads into a fringe this model ignores.
Will winding more layers make the field stronger?
At a fixed current, yes: more turns over the same length raise N and the field in proportion. At a fixed supply voltage it is less simple, because each extra turn adds wire resistance and the current drops, so the ampere-turns NI may barely change. What the extra turns mainly buy in that case is less heating.
How do tesla and gauss compare?
One tesla equals 10,000 gauss, so the example's 5.027 × 10⁻³ T is about 50.3 G. The Earth's field at the surface is a few tenths of a gauss, or a few tens of microtesla. SI calculations use tesla, while gauss still turns up on older equipment labels and some magnetometers.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
B = μNI/L
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon