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
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.
- 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.
- Enter the total number of turns as a whole number, counting every layer of a multi-layer winding.
- Enter the steady current through the winding in amperes.
- 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.
- Read the field in tesla; multiply by 1,000 for millitesla or by 10,000 for gauss.
The formula.
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.
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.
Frequently asked questions.
Why doesn't the coil's diameter appear in the formula?
What permeability should I enter for an iron core?
How strong is the field at the ends of the coil?
Will winding more layers make the field stronger?
How do tesla and gauss compare?
References& sources.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- 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