Home/Electrical Engineering/Magnetics/Magnetic Field of a Solenoid

Formula & Calculator

Magnetic Field of a Solenoid

The magnetic field inside a long, tightly wound solenoid, where n is turns per unit length.

MagneticsSolenoids

Magnetic Field of a Solenoid Calculator B = μ₀ · n · I

B = μ₀ · n · I
B = magnetic flux density (T)  ·  μ₀ = permeability of free space (4π×10⁻⁷ T·m/A)  ·  n = turns per unit length (turns/m)  ·  I = current (A)
⟹ Solve B, n, I
T
turns/m
A
μ₀ = 4π × 10⁻⁷ T·m/A  ≈  1.2566370614×10⁻⁶ T·m/A
Please fix the errors above.
Solve for:
Presets:
Magnetic Field (B)
B: n: I:
✓ Copied!
Magnetic Field Gauge
Weak (< 1 mT) Moderate (1–100 mT) Strong (> 100 mT)
B = μ₀ · n · I  ·  For an ideal solenoid (long, tightly wound). μ₀ = 4π×10⁻⁷ T·m/A.

Interpretation

Magnetic field inside a long solenoid is B = μ₀·n·I, where n is the number of turns per unit length.
The field is nearly uniform and parallel to the solenoid axis.
Example: n=1000 turns/m, I=2A → B = 4π×10⁻⁷ × 1000 × 2 ≈ 2.51×10⁻³ T (tesla).

B = μ₀·n·I
Magnetic Field of a Solenoid

Variables

SymbolQuantityUnit
BMagnetic flux density inside the solenoidT
μ₀Permeability of free space (4π×10⁻⁷)H/m
nNumber of turns per unit lengthturns/m
IElectric current through the solenoidA
NTotal number of turnsdimensionless
LLength of the solenoidm

What it means

The magnetic field inside a long solenoid (coil) is uniform and given by B = μ₀·n·I, where n is the number of turns per unit length (turns/m) and I is the current. The field is directed along the axis of the solenoid. This formula is derived from Ampere’s law and assumes the solenoid is infinitely long. In practice, the field near the centre is approximately uniform. Solenoids are used to generate controlled magnetic fields for electromagnets, relays, speakers, and magnetic resonance imaging (MRI). The magnetic field is independent of the solenoid’s cross‑sectional area. Example: A solenoid with 1000 turns per metre and a current of 2A produces B = 4π×10⁻⁷ * 1000 * 2 = 4π×10⁻⁴ = 1.257×10⁻³ T (≈1.26 mT). This is a moderate field, strong enough for many laboratory applications.

Worked example

Magnetic Field of a Solenoid – Practical Example

Real‑World
Scenario: A solenoid has 1000 turns, length 0.5 m, and carries 2 A. Find the magnetic field inside (assume air core).
ParameterValue
N1000
L0.5 m
I2 A
μ₀4π×10⁻⁷ H/m
FormulaB = μ₀·(N/L)·I
1n = N/L = 1000/0.5 = 2000 turns/m
2B = 4π×10⁻⁷ × 2000 × 2 = 4π×10⁻⁷ × 4000 = 1.6π×10⁻³ T
Final Design B ≈ 5.03 mT ✓ Uniform field inside
Why: The field inside a long solenoid is uniform and proportional to the product of turns per unit length and current.

Common mistakes

  • n: Number of turns per unit length – not total turns.
  • Units: n in turns/m, I in amperes → B in teslas.
  • Uniform field: Inside a long solenoid, the field is approximately uniform.
  • Core material: If a magnetic core is present, B = μ·n·I (where μ = μ₀·μ_r).
  • End effects: Near the ends, the field is weaker and non‑uniform.

Applications

The magnetic field inside a long solenoid is B = μ₀·n·I, where n is the number of turns per unit length. This formula is used to design electromagnets, inductors, and magnetic actuators. Engineers use it to determine the required current and turns to achieve a desired flux density, which is crucial for relay operation, magnetic recording, and magnetic resonance imaging. The uniform field of a solenoid also serves as a reference for calibrating magnetic sensors. By understanding this relation, professionals can design efficient and compact magnetic devices. This formula is fundamental to magnetic circuit design and educational physics.

  • Design of solenoids for actuators and relays
  • Inductor and transformer core design
  • Magnetic field generation for MRI and NMR
  • Calibration of magnetometers and Hall sensors
  • Educational demonstration of magnetic field

Frequently Asked Questions

Q01What is the magnetic field inside a long solenoid?
A01

The field inside a long solenoid is B = μ₀·n·I, where n is the number of turns per unit length.

Q02What is the direction of the magnetic field inside a solenoid?
A02

Parallel to the axis, determined by the right-hand rule (current direction).

Q03What is the field outside a long solenoid?
A03

Approximately zero for an ideal solenoid (all field lines are confined inside).

Q04What are the units of n?
A04

turns per meter (m⁻¹).

Q05How does the field depend on the number of turns?
A05

Directly proportional to the total turns N and inversely proportional to length L, so B ∝ N/L.

Q06What is the inductance of a solenoid?
A06

L = μ₀ N² A / l, where A is the cross-sectional area and l is length.

Q07How does the field change when a ferromagnetic core is inserted?
A07

B increases by a factor of μ_r (relative permeability), so B = μ μ₀ n I.

Q08What are the applications of solenoids?
A08

Electromagnets, relays, actuators, MRI machines, and inductive sensors.

Q09What is the magnetic field of a short solenoid?
A09

The formula is an approximation; for short solenoids, use the exact Biot-Savart integration.

Q10What are the common mistakes when using the solenoid field formula?
A10

Common errors include: 1) using the wrong n (turns per unit length), 2) forgetting the permeability of the core, 3) applying to short solenoids, 4) using the wrong units, and 5) ignoring the end effects.