Logo

MonoCalc

/

Solenoid Magnetic Field Calculator

Physics

The exact on-axis field of a uniform current sheet. It is the right model for a single-layer coil of any length.

B(z) = (µ₀µᵣnI / 2) · [ (z + ℓ/2) / √((z + ℓ/2)² + R²) − (z − ℓ/2) / √((z − ℓ/2)² + R²) ]
n = 2000.00 turns/m
Mean winding radius

No core: the field is set by the winding alone and the result is exact for the model.

On-axis only — off-axis fields are not computed.

Field at the centre of the coil (on axis)

4.9634 mT

0.004963 T · 4.9634 mT · 4963.42 µT · 49.6342 G (pointing along +z)

Field, inductance and energy

Centre field B₀

4.9634 mT

99.3 × Earth's ~50 µT field

End-face field B_end

2.5053 mT

50.47 % of B₀

Ideal field µ₀µᵣnI

5.0265 mT

Finite / ideal at centre: 98.74 %

Magnetising field H = nI

4.0000 kA/m

Independent of the core

Turn density n

2000.0000 turns/m

Ampere-turns NI

1000.0000 A·t

Uniform region (≥ 99 % of B₀)

11.0564 cm

Centred on the coil, along the axis

Uniform region (≥ 95 % of B₀)

17.5695 cm

Inductance (Nagaoka)

1.4769 mH

K_N = 0.93528; ideal 1.579 mH

Inductance (Wheeler)

1.4731 mH

-0.26 % vs Nagaoka

Stored energy ½LI²

2.9539 mJ

Flux per turn Φ = B₀·πR²

6.2372 µWb

Flux linkage NΦ ≈ 3.119 mWb

Coil cross-section

Not to scaleField lines schematic
NSℓ = 25.0000 cmR 2.000 cmz

⊙ current out of the page, ⊗ into the page. The shaded band in the bore is the region where B ≥ 99 % of B₀.

On-axis field profile B(z)

Shaded: the winding. Dashed line: the ideal µ₀µᵣnI. Click the chart to move the probe.

How strong is that?

Logarithmic scale, 1 µT to 10 T. Marker at the centre field. Values marked ≈ are order-of-magnitude references.

1 µT10 µT100 µT1 mT10 mT100 mT1 T10 TEarth ≈Fridge magnet ≈NdFeB surface ≈MRI 1.5 TMRI 3 T4.963 mT

Step-by-step working (SI units)

Turn density

n = N / ℓ = 500 / 0.25 m = 2000 turns/m

Ideal field

B_ideal = µ₀µᵣnI = 1.2566e-6 × 1 × 2000 × 2 = 0.0050265 T

Centre field (finite)

B₀ = µ₀µᵣNI / √(ℓ² + 4R²) = 1.2566e-6 × 500 × 2 / √(0.25² + 4 × 0.02²) = 0.0049634 T

End field

B_end = (µ₀µᵣnI/2) · ℓ / √(ℓ² + R²) = 0.0025053 T

Finite / ideal

ℓ / √(ℓ² + 4R²) = 0.98744 (98.74 %)

Inductance (Nagaoka)

L = K_N · µ₀µᵣN²πR²/ℓ = 0.93528 × 0.0015791 = 0.0014769 H

Stored energy

W = ½LI² = 0.5 × 0.0014769 × 2² = 0.0029539 J

About This Tool

Solenoid Magnetic Field Calculator – From B = µ₀nI to Real Coils

A solenoid is a coil of wire wound as a helix, and it is the simplest way to make a strong, predictable magnetic field on demand. Every introductory physics course gives its field as B = µ₀ · n · I, where n is the number of turns per metre and I the current. That result is exact only for an infinitely long coil. This solenoid magnetic field calculator evaluates the textbook formula and also the exact on-axis field of a coil you could actually build, with finite length, real radius, several layers of real wire and a real power supply.

Where the ideal formula comes from, and where it fails

Apply Ampère's law to a rectangular loop that runs along the inside of a very long coil and returns outside it. Outside, the field is negligible; inside, it is uniform; and the loop encloses n · ℓ turns each carrying I. That gives B = µ₀nI, and the companion magnetising field H = nI, which is independent of what fills the coil. The argument quietly assumes there are no ends. A real coil leaks field at both ends. Integrating the Biot–Savart law over a uniform current sheet of radius R gives the exact on-axis result:

B(z) = (µ₀nI / 2) · [ (z + ℓ/2) / √((z + ℓ/2)² + R²) − (z − ℓ/2) / √((z − ℓ/2)² + R²) ]

At the centre this simplifies to B₀ = µ₀NI / √(ℓ² + 4R²), so the real coil reaches only ℓ / √(ℓ² + 4R²) of the ideal value. A coil ten times longer than its radius gets 98 %; a coil as long as its diameter gets about 71 %. At each end face the field drops to roughly half the centre value, because only one side of the winding is contributing. As the coil shrinks to zero length the formula becomes the familiar µ₀NI / (2R) of a flat loop, which is a useful sanity check.

The uniform region

Experiments that need a known field, such as sensor calibration, Hall probe tests and NMR samples, use only the middle of the coil. The calculator finds how long that region is by bisecting B(z) for the points where the field falls to 99 % and 95 % of B₀. For a 25 cm coil of 2 cm radius the 99 % zone is only about 11 cm long, well under half the winding. The profile chart makes the drop-off visible, and the shaded band in the cross-section shows where it lies.

Thick, multilayer windings

Practical electromagnets use many layers. Treating the winding as a uniform current density between an inner radius R₁ and an outer radius R₂ gives a closed form built on logarithms of g(a, r) = r + √(r² + a²). The outer layers sit further from the axis and contribute less, so a thick coil gives slightly less field than the same turns wound at the mean radius would. In the design from wire mode the calculator packs real wire onto a former, counting turns per layer from the insulated diameter, and reports wire length, resistance, the current a supply can drive, power dissipated and current density.

Heat is usually the real limit
Field grows with current, but dissipation grows with current squared. Around 3 A/mm² is a common rule of thumb for continuous duty without forced cooling; above about 10 A/mm² a small coil heats within seconds. Copper resistance also rises about 0.4 % per °C, so a hot coil draws less current from a fixed voltage.

Inductance: Nagaoka and Wheeler

The long-coil inductance L = µ₀N²πR² / ℓ also ignores the ends. Nagaoka's coefficient corrects it exactly for a single-layer coil using complete elliptic integrals, which the tool evaluates with the arithmetic–geometric mean. Wheeler's formula, L ≈ µ₀N²πR² / (ℓ + 0.9R), is shown alongside as a quick cross-check. It agrees within about 1 % for coils longer than 0.8R and drifts for short, fat ones. Stored energy follows from W = ½LI².

Cores, saturation and honesty

Filling the bore with iron or ferrite multiplies the field by the relative permeability µᵣ, but only when the core forms a closed magnetic path. An open rod in a short coil is limited by its own demagnetising field to a small fraction of the material's µᵣ. Every ferromagnetic core also saturates, at about 0.4 T for ferrite and near 2 T for iron and silicon steel. Above that, extra current adds field at roughly the air-core rate. The calculator flags both effects instead of reporting an impossible number.

Direction and poles
Curl the fingers of your right hand along the current; your thumb points along B inside the coil and marks the north end. Current running counter-clockwise when viewed from the right puts the north pole on the right.

Frequently Asked Questions

Is the Solenoid Magnetic Field Calculator free?

Yes, Solenoid Magnetic Field Calculator is totally free :)

Can I use the Solenoid Magnetic Field Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Solenoid Magnetic Field Calculator?

Yes, any data related to Solenoid Magnetic Field Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does this solenoid calculator work?

It evaluates the Biot–Savart law integrated over the winding, on the coil's axis. The ideal model uses B = µ₀µᵣnI, the finite model uses the exact current-sheet formula, the thick model integrates over the winding depth, and the wire designer builds the coil from real wire and a supply before evaluating the thick model.

Why is my coil's field lower than B = µ₀nI?

B = µ₀nI assumes an infinitely long coil. A real coil of length ℓ and radius R reaches only ℓ/√(ℓ² + 4R²) of that at its centre — about 98 % when ℓ = 10R and much less for short, fat coils — and roughly half of it at each end.

Does adding an iron core multiply the field by µᵣ?

Only if the core forms a closed magnetic path or is very long compared with its diameter. A short open rod is limited by demagnetisation to a small fraction of its material µᵣ, and any core saturates (around 0.4 T for ferrite, about 2 T for iron and silicon steel), so the linear result is an upper bound.

How accurate is the inductance figure?

For a single-layer air coil the Nagaoka-corrected value is accurate to the precision of the coil dimensions. Wheeler's approximation is shown alongside and agrees within about 1 % when ℓ > 0.8R. Multilayer and cored inductances are estimates.

Are fields off the axis calculated?

No. Every value, including the profile chart and the probe readout outside the coil, is the on-axis field. Off-axis fields require elliptic-integral solutions in both r and z and are not computed.

What current density is safe for a coil winding?

As a rule of thumb, around 3 A/mm² is comfortable for continuous duty in a coil without forced cooling, and above about 10 A/mm² the winding heats quickly enough that it suits short pulses only. Real limits depend on insulation class, ventilation and duty cycle.