Solenoid & Toroid Magnetic Field Calculator

Calculate magnetic field strength inside a solenoid or toroid from current and geometry.

Please check your inputs and try again.

Magnetic Fields Inside Solenoids and Toroids

A long solenoid creates an approximately uniform magnetic field inside because the fields from many closely spaced current loops reinforce one another. For an ideal air-core solenoid, B=μ0nI. The turns-per-length value n matters because packing more turns into each meter increases the number of loop contributions at every interior point.

A toroid bends a solenoid into a closed ring. Its magnetic field is concentrated around the circular core and varies with radius as B=μ0NI/(2πr) for the ideal air-core case. Here N is the total number of turns, not turns per meter. Confusing N and n is a common source of incorrect answers.

Solenoid: B=μ0nI    Toroid: B=μ0NI/(2πr)
SymbolMeaningWhy it appears / units
BMagnetic flux densityTesla (T).
μ0Permeability of free spaceApproximately 4π×10−7 T·m/A.
nSolenoid turns per unit lengthm−1; n=N/L.
NTotal toroid turnsDimensionless turn count.
I, rCurrent and toroid radiusA and m; toroid field decreases as r increases.

These formulas assume idealized geometry. A finite solenoid has edge effects near its ends, and magnetic cores change the field through their permeability. In many basic problems the air-core approximation is intended. Always identify whether the given turn quantity is total turns or turns per meter before choosing the formula.

Worked Examples

Example 1: Solenoid: 1000 turns/m, I=2A
B=4π×10⁻⁷×1000×2
Result: 2.51 mT = 25 Gauss
Typical laboratory solenoid
Example 2: MRI solenoid: n=1000/m, I=150A
B=4π×10⁻⁷×1000×150
Result: 0.188 T (need superconducting for 1.5T MRI)
Real MRI uses superconducting coils
Example 3: Denser solenoid winding
n=2500m−1, I=3A → B=4π×10−7×2500×3
Result: B = 9.42 mT
Doubling either turns per meter or current would double the ideal solenoid field.
Example 4: Air-core toroid
N=500, I=0.80A, r=0.050m → B=μ0NI/(2πr)
Result: B = 1.60 mT
Toroid calculations use total turns N and the radius of the circular magnetic path.

Common Mistakes

⚠️
Using total turns N where a solenoid needs turns per meter n

For a solenoid, first calculate n=N/L when only total turns and coil length are given.

⚠️
Applying the toroid formula without a radius

The ideal toroid field varies as 1/r, so the radius at which B is evaluated is part of the calculation.

⚠️
Ignoring a magnetic core when permeability is specified

The air-core formulas use μ0. If relative permeability μr is provided, the ideal material result includes the factor μr.

Frequently Asked Questions

Solenoid vs bar magnet field?
Solenoid: B = μ₀nI inside, approximately zero outside (infinite solenoid). Bar magnet: field wraps around, extends far outside. MRI uses solenoids for strong uniform fields.
Relative permeability?
With ferromagnetic core: B = μ₀μᵣnI where μᵣ can be 1000-100,000 for iron/mu-metal. Transformers use ferromagnetic cores to dramatically increase flux density.
Why is the field inside a long solenoid nearly uniform?
Away from the ends, contributions from many closely spaced turns add in nearly the same axial direction. Ampere's law then gives a field that depends mainly on turns per meter and current, not on position across the central interior. Near the ends, this ideal uniformity breaks down.
How do I convert total solenoid turns into turns per meter?
Divide the total turn count N by the wound length L in meters: n=N/L. For example, 600 turns spread uniformly over 0.30 m gives n=2000 m−1. Using N directly in B=μ0nI would overstate the field unless the coil happened to be one meter long.
Why does a toroid keep most of its field inside the core region?
The circular symmetry makes the magnetic field wrap around the ring. For an ideal tightly wound toroid, fields from the turns reinforce along the interior magnetic path while largely cancelling outside. Real toroids still have leakage and fringing, especially when winding or core geometry is imperfect.
Does increasing current always increase magnetic field linearly?
In the ideal air-core formulas, yes: B is directly proportional to I. With ferromagnetic cores, however, permeability can change with field strength and the material may approach magnetic saturation. Then the actual B-versus-I relationship is no longer perfectly linear even though the simple formula suggests it.

Formula Explorer connections

Interpretation: This relationship connects magnetic fields, moving charge, flux, induction or electromagnetic material response. Assumption: Specify field direction and sign convention. Uniform fields, linear materials, negligible edge effects or sinusoidal steady state may be assumed.

Magnetic Flux Calculator →Mutual Inductance Calculator →Skin Depth Calculator →Physics Formula Explorer →