Solenoid Magnetic Field Calculator

A current-carrying coil produces a nearly uniform magnetic field inside. This solenoid calculator gives the field at the centre of a real, finite coil and at its ends, compares it with the ideal long-solenoid formula, and estimates the inductance and stored energy, so you can design electromagnets, sensor coils and lab demonstrations.

Inputs

Results

Field at the centre (finite coil)
6.161
Ideal long-solenoid field μ₀μr·nI
6.283
Field on the axis at one end
3.126
Turns per metre n
2,500
Inductance, long-solenoid formula
1.974
Inductance, Wheeler’s formula (air core)
1.806
Stored energy ½LI²
0.003948
Length of wire
62.83

    RefPHY-EM-006
    MethodB = μ₀μr·nI·L/√(L² + D²) at the centre; L_ind = μ₀μrN²A/ℓ
    UnitsSI
    Date2026-11-24

    Working

    Calculated in SI base units; inputs are converted from the units you choose.

    1. Turns per metren = N/ℓn = 500 / 0.2 = 2,500 m⁻¹
    2. Ideal long solenoidB = μ₀μr·nIB = 1.25664e-6 × 1 × 2,500 × 2 = 0.006283 T
    3. Finite length, centre of the axisB = μ₀μr·nI·ℓ/√(ℓ² + D²)B = 0.006283 × 0.980581 = 0.006161 T
    4. End of the coilB = ½μ₀μr·nI·ℓ/√(ℓ² + R²)B = 0.003126 T
    5. InductanceL = μ₀μrN²A/ℓ; Wheeler: L(µH) = r²N²/(9r + 10ℓ), r and ℓ in inchesL = 0.001974 H, Wheeler 0.001806 H

    Finite coils are weaker than the ideal formula

    B = μ₀nI is exact only for an infinitely long solenoid. On the axis of a real coil of length ℓ and diameter D the centre field is reduced by the factor ℓ/√(ℓ² + D²), and at each end it is close to half the centre value. The long-coil inductance formula overestimates short coils; Wheeler’s 1928 formula corrects for the end effect and is good to about 1 % for single-layer coils longer than 0.8 radius.

    Assumptions and limits

    • Closely wound single-layer coil with uniform current density.
    • Field values are on the axis.
    • Air core unless μr is entered; magnetic saturation of cores is not modelled.

    References

    • Griffiths, D. J., Introduction to Electrodynamics, 4th ed., Cambridge University Press, 2017, chapter on magnetostatics.
    • Wheeler, H. A. (1928), Simple inductance formulas for radio coils, Proceedings of the IRE 16(10), 1398–1400.

    Questions

    What field does a 500-turn, 200 mm long, 40 mm diameter coil give at 2 A?
    6.16 mT at the centre, compared with 6.28 mT from the ideal formula. Its inductance is about 1.97 mH by the long-coil formula and 1.81 mH by Wheeler’s formula.
    How can I double the field?
    Double the current or the number of turns per metre. Doubling the turns in the same length also quadruples the inductance.

    This calculator is a design aid. Check results against the governing code or standard and have critical work verified by a qualified engineer. Read the disclaimer.