Solenoid Magnetic Field Calculator
Magnetic field inside a solenoid, B = μ₀μᵣNI/L, from the number of turns, coil length, current and core permeability, with turns per metre, H field, flux through the core and a long-coil accuracy check.
How it works
B = μ₀·μᵣ·N·I / L = μ₀·μᵣ·n·I · μ₀ = 4π × 10⁻⁷ T·m/A · H = n·I · Φ = B·π·r² · at either end of a long solenoid the field is about B/2
Inside a long, tightly wound solenoid the fields of all the turns add to a nearly uniform field along the axis, and Ampère’s law gives B = μ₀nI — it depends only on the turns per unit length and the current, not on the radius. A ferromagnetic core multiplies the field by its relative permeability until the core saturates. The formula is accurate for coils several times longer than their diameter; short coils have weaker, less uniform fields. The derivation is in OpenStax University Physics Vol. 2, section 12.7, with μ₀ from CODATA.
Worked example
A 25 cm air-core coil with 500 turns carries 2 A. n = 500 / 0.25 = 2,000 turns per metre, so H = 2,000 × 2 = 4,000 A/m and B = 4π × 10⁻⁷ × 4,000 = 5.027 mT (50.27 G). Through a 2 cm radius the flux is 5.027 mT × π × 0.02² = 6.317 µWb. The coil is 6.25 times longer than its diameter, so the long-solenoid formula is accurate.
Sources: OpenStax University Physics Vol. 2 — Solenoids and Toroids · HyperPhysics — Solenoid field
Frequently asked questions
Does the radius of the solenoid affect the field?
Not for an ideal long solenoid — only turns per metre and current matter. The radius affects the total flux (Φ = B·πr²), the inductance and how long the coil must be for the formula to hold.
How much does an iron core increase the field?
By its relative permeability, often hundreds to thousands of times, but only up to saturation at roughly 1.5–2 T for soft iron. Beyond that, extra current adds little.
What is the field at the end of a solenoid?
About half the central value for a long coil, because only the turns on one side contribute.
How do I get a stronger field without more current?
Wind more turns into the same length (multiple layers), shorten the coil while keeping the turns, or add a ferromagnetic core.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.