Solenoid Magnetic Field Calculator

Enter the number of turns, coil length, current, and core permeability to get the magnetic field inside a solenoid using B = μ₀ × μr × n × I, the standard result from Ampère's law.

Quick Facts

Field formula
B = μ₀ × μr × n × I
μ₀ = 4π×10⁻⁷ T·m/A is the permeability of free space; n = N/L is turns per meter.
Ideal-solenoid assumption
Length ≫ diameter
The uniform-field formula is most accurate for long, tightly-wound coils; short or fat coils need a finite-length correction.
Core multiplier
μr(air) = 1, μr(soft iron) ≈ 100-5,000
A ferromagnetic core boosts B by its relative permeability until the core saturates.
Unit conversion
1 T = 10,000 G
Tesla is the SI unit for B; gauss (CGS) still appears in many older references and magnet specs.

Your Results

Calculated
Magnetic Field (B)
-
B = μ₀ × μr × n × I
Magnetic Field (Gauss)
-
1 T = 10,000 G
Turns per Meter (n)
-
n = N / L
Field Intensity (H)
-
H = n × I, independent of the core

Ready

Enter turns, coil length, current, and core permeability, then press Calculate.

Formula and Method for Solenoid Magnetic Field

A solenoid is a coil of wire wound in a tight helix; when current flows through it, the coil produces a magnetic field concentrated inside the windings. Applying Ampère's law to an idealized (infinitely long, tightly-wound) solenoid shows that the field inside is uniform and points along the coil's axis, with magnitude B = μ₀ × n × I, where μ₀ = 4π×10⁻⁷ T·m/A is the permeability of free space, n = N/L is the number of turns per meter of coil length, and I is the current in amperes. If the coil is wound around a magnetic core instead of air, the field scales up by the core's relative permeability: B = μ₀ × μr × n × I.

How the calculation works

Enter the total number of turns (N) and the coil's length (L), and the calculator first finds the turns density n = N/L in turns per meter. It multiplies n by the current I to get the magnetic field intensity H = n × I (in amperes per meter) — a quantity that depends only on the winding geometry and current, not on any core material. Multiplying H by μ₀ and the core's relative permeability μr gives the magnetic flux density B = μ₀ × μr × H in tesla, which the tool also converts to gauss (1 T = 10,000 G) for reference.

Common mistakes

  • Using total turns instead of turns per length: the formula needs n = N/L, not N by itself — a coil with 500 turns over 1 m has a very different field than the same 500 turns over 10 cm.
  • Mixing length units: keep the coil length in one consistent unit before computing n; convert inches or millimeters to meters first (this calculator's unit selector does that for you).
  • Forgetting the core multiplier: a bare-wire estimate assumes μr = 1 (air/vacuum); an iron or ferrite core can multiply the field by a factor of 100 or more, so leaving μr at 1 for a cored coil drastically underestimates B.
  • Trusting the formula for short, fat coils: B = μ₀nI is the infinite-solenoid limit; it overstates the field near the open ends of a real coil and loses accuracy when the length is not much greater than the diameter.

Real-world applications

  • Electromagnet and solenoid-valve design uses B = μ₀μrnI to pick a turns count and current that hit a target force or flux without overheating the winding.
  • Inductor and transformer coil design uses the same turns-density relationship to estimate the field (and, from it, inductance) inside a wound core.
  • Physics lab experiments (e.g., measuring the field of a solenoid with a Hall probe or gaussmeter) use this formula as the theoretical prediction to check against a measured value.
  • MRI and NMR magnet coils, relay coils, and speaker voice-coil actuators all rely on the same turns-per-length and permeability relationship at very different scales of current and field strength.

Frequently Asked Questions

What is the formula for the magnetic field inside a solenoid?
For an ideal (long, tightly-wound) solenoid, the field inside is B = μ₀ × n × I, where μ₀ = 4π×10⁻⁷ T·m/A is the permeability of free space, n = N/L is the number of turns per meter, and I is the current in amperes. If the coil is wound around a magnetic core, multiply by the core's relative permeability: B = μ₀ × μr × n × I.
Does adding an iron core increase the magnetic field?
Yes. A ferromagnetic core (soft iron, ferrite, etc.) multiplies the field by its relative permeability μr, which can range from about 100 to several thousand, producing a much stronger field than an air core (μr = 1) for the same current. This holds until the core saturates, after which further current gives little extra field.
Why is B = μ₀nI only accurate for long solenoids?
The formula comes from applying Ampère's law to an infinitely long solenoid, which produces a perfectly uniform field inside and zero field outside. Real solenoids are finite, so the field is strongest and most uniform near the center and drops off near the open ends (to roughly half the center value right at an end). The approximation is accurate when the coil's length is much greater than its diameter.
What is the difference between B and H in this calculator?
H is the magnetic field intensity (or magnetizing field), H = n × I, measured in amperes per meter — it depends only on the winding geometry and current, not the core material. B is the magnetic flux density, B = μ₀ × μr × H, measured in tesla — it includes the amplifying effect of any core material via μr.