StatGardenREF. DESK
Calculators/Physics/Solenoid Magnetic Field
Physics

Solenoid Magnetic Field calculator

Magnetic field strength inside a long, tightly-wound solenoid carrying a steady current.

Published 8 August 2026 · Updated 21 September 2026

What this calculator does

A solenoid is a coil of wire that produces a nearly uniform magnetic field along its inside. What matters is not the total number of turns but how densely they are packed, so a long coil and a short one with the same turns per metre give the same field.

That uniformity is what makes solenoids so useful. Unlike a single wire, whose field varies sharply with distance, the interior of a long solenoid offers a predictable field that is essentially constant across the bore.

The formula

FormulaB = μ₀nI, n = N/L, μ₀ = 4π×10⁻⁷ T·m/A

Multiply the permeability of free space by the turns per unit length and by the current. Turns per unit length is the number of turns divided by the coil length, which is the quantity the field actually depends on.

TermMeaning
SolenoidA helical coil of wire, long compared with its diameter, producing a uniform internal field.
Turns per metre (n)Winding density: total turns divided by coil length. This is what sets the field, not the turn count alone.
Permeability of free space (μ₀)4π × 10⁻⁷ T·m/A, the constant relating current to magnetic field in vacuum.

The inputs explained

FieldWhat to enter
Number of turnsThe total number of turns of wire.
Coil length (m)The length of the coil in metres.
Current (A)The current through the winding, in amps.

When to use it

Designing an electromagnet

The field follows directly from winding density and current, which is the starting point for any coil design.

Producing a uniform field for an experiment

A solenoid gives a predictable and nearly constant field inside, unlike the field near a single wire.

Understanding a relay or actuator

Solenoid actuators work by the field pulling on a ferromagnetic core, and that field comes from this relationship.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does winding density change the field?

The same coil length and current with different turn counts.

0.2 m coil carrying 2 A
Number of turnsMagnetic field (mT)Turns per unit length
250 turns3.142 mT1,250.00 turns/m
500 turns6.283 mT2,500.00 turns/m
1,000 turns12.566 mT5,000.00 turns/m
The field is directly proportional to winding density: 500 turns on a 0.2 m coil gives 6.283 mT, and doubling to 1,000 turns doubles it to 12.566 mT. Stretching the coil to twice the length with the same turns would halve it again.

Questions

Does the coil diameter affect the field?

Not for an ideal long solenoid. The field inside depends only on turns per metre and current, which is a genuinely surprising result and one of the reasons solenoids are so useful.

Does the field vary across the inside?

Very little in a long solenoid, which is the point. It is essentially uniform through the middle and falls off near the ends, so short coils deviate from the ideal considerably.

What happens with an iron core?

The field increases dramatically, often by hundreds or thousands of times, because the core's permeability replaces that of free space. This is how practical electromagnets achieve useful strength.

What is the field outside?

Close to zero for an ideal long solenoid. The return flux spreads over a large volume outside, so the external field is weak compared with the concentrated interior field.

For the field around a single straight wire, see the magnetic field of a straight wire calculator. For the energy stored in the coil, see the inductor stored energy calculator.