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
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.
| Term | Meaning |
|---|---|
| Solenoid | A 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
| Field | What to enter |
|---|---|
| Number of turns | The 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.
| Number of turns | Magnetic field (mT) | Turns per unit length |
|---|---|---|
| 250 turns | 3.142 mT | 1,250.00 turns/m |
| 500 turns | 6.283 mT | 2,500.00 turns/m |
| 1,000 turns | 12.566 mT | 5,000.00 turns/m |
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.