Solenoid Magnetic Field Calculator

Calculate the magnetic field inside a solenoid from turn count, length, and current using B = μ₀nI.
Also returns coil inductance from the bore area.

Magnetic Field

A solenoid is a coil of wire wound in a helix. When current flows through it, it creates a uniform magnetic field inside:

B = μ₀nI = μ₀NI/L

Where:

  • B = Magnetic flux density (Tesla, T)
  • μ₀ = Permeability of free space = 4π × 10⁻⁷ T·m/A ≈ 1.2566 × 10⁻⁶ T·m/A
  • n = Turn density = N/L (turns per meter)
  • N = Total number of turns
  • I = Current through the wire (amperes)
  • L = Length of the solenoid (meters)

Key observations:

  • The field inside is uniform (same everywhere along the axis, well away from the ends)
  • The field is proportional to both current and turns-per-meter
  • Outside the solenoid, the field is nearly zero (it’s a good magnetic “shield”)

Reference values:

Application Typical B
Earth’s magnetic field ~50 μT
Small electromagnet (lab) 10–100 mT
MRI machine 1.5–3 T
Strong research magnet 20–45 T
Neutron star surface 10⁸ T (magnetar: up to ~10¹¹ T)

Watch the units on that last row. Neutron star fields are usually quoted in gauss in the astrophysics literature, where a magnetar reaches 10¹⁵ G. That is 10¹¹ T, not 10¹⁵ T, because 1 T = 10,000 G. Mixing the two is the single most common error in magnetic field tables.

Adding an iron core

A ferromagnetic core multiplies B by the relative permeability μr, typically 100 to 10,000 for iron alloys, giving B = μ₀μrnI. That is why a nail wrapped in wire lifts paperclips a hand-wound air coil cannot touch.

The catch is saturation. Once the iron’s magnetic domains are all aligned, around 1.5 to 2 T for common steels, μr collapses toward 1 and extra current buys almost nothing. Any electromagnet design that quotes a field above about 2 T without a superconductor is either wrong or is talking about the air gap of a very carefully shaped pole piece.

Inductance

The same geometry sets the coil’s inductance: L = μ₀N²A/ℓ, where A is the cross-sectional area and ℓ the length. Enter an area below and the calculator returns it. Inductance is what decides how fast the current can change, so it matters as much as the field for anything switched: relays, solenoid valves, and the drivers behind them.


How we build and check this calculator

This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.

SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.