Magnetic Field of a Solenoid

B=μ0NILB = \frac{\mu_0 N I}{L}

Worked example: 1000 turns, 5 A, 20 cm → B = 31.4159 mT — press Try an example to run it live, then adjust anything.

Enter your known values, leave one input blank, and solves for the missing one. Tap a variable’s symbol to see what it means, with a typical value. Try different units for next level excitement!

Here the solver did the work — could you?

The flux through the loop →

Grade 12Grade 12 Physics

The solenoid →

UniversityCircuits & Electrical Power

Test your skills in the Exam Room: new numbers every attempt — free lessons for students, no sign-up, just pure learning. Find 1 more lesson on this formula.

See your Report Card
Compete with your friends
share your results
Learning zone

Magnetic Field of a Solenoid explained

INBL

A single loop of wire makes a field that is strong at its centre and sprawls untidily everywhere else. Wind many loops into a tight helix and something better happens: inside the coil every turn's field points the same way and they add, while outside they point in opposing directions and largely cancel. What is left is a nearly uniform field along the axis, and Ampère's law applied to a rectangular path straddling the wall of a long solenoid gives it as B=μ0NI/LB = \mu_0 N I / L. The striking thing about that result is what is missing — the diameter of the coil does not appear. Only the current and the turns per unit length matter, so a broomstick-sized coil and a pencil-sized one with the same winding density and current produce the same interior field.

A 200 mm coil wound with 1000 turns and carrying 5 A gives B=(1.257×10−6×1000×5)/0.2=31 mTB = (1.257 \times 10^{-6} \times 1000 \times 5)/0.2 = 31\ \text{mT}, roughly six hundred times Earth's field of about 50 µT. Halving the current to 2.5 A halves the field; stretching the same 1000 turns over 400 mm also halves it, because the turns are now half as dense. That second sensitivity is the one people forget, and it is why the equation is better read as B=μ0nIB = \mu_0 n I with nn the turns per metre.

André-Marie Ampère coined the word solénoïde in the 1820s from the Greek for a channel or pipe, and the coil is still the standard way to make a field you can switch. Relays, contactors, solenoid valves, MRI bores and every particle-physics magnet are variations of it. Wrapping the coil around soft iron multiplies the result by the material's relative permeability — a factor of several thousand for good silicon steel — which is how a modest coil can lift a car, and the equation then reads B=μrμ0nIB = \mu_r \mu_0 n I. Superconducting magnets take the other route and simply run enormous current, since with zero resistance there is no I2RI^2R heat to remove.

The formula is an idealisation for a long coil, and it fails where the coil ends. Field lines have to turn around and come back, so at the mouth of a solenoid the axial field falls to about half its interior value, and outside it is weaker still and spread out. Treating a short, fat coil — anything much wider than it is long — with this equation will overstate the field substantially; that geometry needs the exact axial expression or a numerical model. The second failure is saturation. The iron-core multiplication is not a licence to keep raising current: ordinary steels saturate somewhere around 1.5 to 2 T, after which μr\mu_r collapses toward 1 and every further ampere buys only the modest air-core contribution. Third, watch the length variable: LL is the length of the winding, not the length of the wire, and confusing them can be a factor of a thousand. And a coil is an inductor: switching that 31 mT off in a millisecond will produce a voltage spike large enough to arc a contact, which is why a solenoid valve gets a flyback diode.

Magnetic Field of a Solenoid formula

B=μ0NILB = \frac{\mu_0 N I}{L}
Where
  • BB= Magnetic field (T)
  • NN= Number of turns
  • II= Current (A)
  • LL= Solenoid length (m)

Missing one of these? Work it out first, then come back