Skip to content

Magnetic Field of a Solenoid Calculator

Updated:

Calculate the magnetic flux density (in mT, T, or Gauss) inside a solenoid from the current, number of turns, length, and core permeability using B = μ₀μᵣNI/L.

Find the Magnetic Flux Density Inside a Solenoid

Input Fields
I
Electric current flowing through the solenoid wire
N
Total turns of wire wound along the solenoid
L
Length of the winding (should be much larger than the coil diameter)
μᵣ
1 for air or vacuum (no core); typical ferromagnetic cores: iron ≈ 200–5000, ferrite ≈ 20–3000, steel ≈ 100–4000
If enabled, the result will update automatically when you change any value.

Solenoid Magnetic Field

Formula
\[ B = \frac{\mu_0 \, \mu_r \, N \, I}{L} = \mu_0 \, \mu_r \, n \, I \]

Where:

  • \(B\) — magnetic flux density inside the solenoid (tesla, T)
  • \(\mu_0 = 4\pi \times 10^{-7}\ \text{T·m/A}\) — permeability of free space
  • \(\mu_r\) — relative permeability of the core (1 for air or vacuum)
  • \(N\) — total number of turns of wire
  • \(I\) — current through the wire (amperes)
  • \(L\) — length of the winding (metres)
  • \(n = N/L\) — turn density (turns per metre)

This is the standard long-solenoid formula: the field inside a solenoid depends only on the turn density, the current, and the core material — not on the coil's diameter or the wire's thickness.

Solenoid Magnetic Field – Calculation Example

Example: an air-core solenoid has 200 turns wound along a length of 10 cm and carries a current of 2 A. What is the flux density at its centre?

\[ n = \frac{N}{L} = \frac{200}{0.10} = 2000\ \text{turns/m} \]

\[ B = \mu_0 \, \mu_r \, n \, I = 4\pi \times 10^{-7} \times 1 \times 2000 \times 2 \approx 5.03 \times 10^{-3}\ \text{T} \]

Result: \(B \approx 5.03\ \text{mT} = 5.03 \times 10^{-3}\ \text{T} \approx 50.3\ \text{G}\).

How to Use the Solenoid Magnetic Field Calculator

  1. Enter the Current (I) flowing through the wire and choose the unit (mA or A) from the dropdown.
  2. Enter the Number of Turns (N) — the total turns wound along the solenoid.
  3. Enter the Solenoid Length (L) — the length of the winding, not the wire — and select its unit (mm, cm, m, or in).
  4. Enter the Relative Permeability (μᵣ). Leave it at 1 for an air core; use a higher value for ferromagnetic materials such as iron, ferrite, or steel.
  5. Read the Flux Density Inside in millitesla, tesla, and Gauss. The Calculation Details block shows the full substitution so you can verify every step.

What Is the Magnetic Field of a Solenoid?

A solenoid is a coil of wire wound in a tight helix. When current flows through it, each turn acts like a small loop magnet, and their fields add up. Inside a long solenoid the field lines run nearly parallel to the axis, producing a remarkably uniform field — this is why solenoids are used to create controlled magnetic fields in physics experiments, relays, valves, MR scanners, and particle accelerators.

The key insight of the formula is that the interior field \(B = \mu_0 \mu_r n I\) depends only on how densely the wire is wound (turns per metre) and how much current flows. Doubling the turns while also doubling the length leaves the field unchanged; only the ratio matters. A solenoid of any diameter produces the same central field as long as \(n\) and \(I\) are the same.

The core material multiplies the field through its relative permeability \(\mu_r\). Air and vacuum have \(\mu_r \approx 1\). Inserting an iron core (\(\mu_r \approx 200\text{–}5000\)) can amplify the field hundreds of times, which is the basis of electromagnets. In Gauss units, remember that \(1\ \text{T} = 10\,000\ \text{G}\); the Earth's field is roughly 0.05 mT (0.5 G), so even a modest solenoid like the example above produces a field about 100 times stronger.

If this solenoid's field changes over time — for instance, when the current is switched on or off — it induces a voltage according to Faraday's Law. You can also compute the force that the resulting field exerts on moving charges with the Magnetic Force on a Charge calculator.

Assumptions, Limitations, and Practical Tips

  • Long-solenoid approximation: the formula is accurate near the centre of a solenoid whose length is much greater than its diameter (a ratio of at least 10 is a common rule of thumb). For short, squat coils the real central field is smaller than the estimate.
  • End effects: at the very ends of the solenoid the field drops to roughly half the central value, \(B_{\text{end}} \approx B/2\).
  • Core saturation: the linear relation with \(\mu_r\) holds only while a ferromagnetic core is unsaturated. Iron cores saturate at about 1–2 T, so entering a very large \(\mu_r\) will overestimate \(B\). Real cores also exhibit hysteresis and permeability that varies with field strength.
  • Leakage and gaps: air gaps in the magnetic circuit, non-uniform winding, or a core that does not fill the bore all reduce the actual field.
  • Heating: higher fields require more current or more turns, which increases resistive heating in the wire; real designs are limited by temperature rise and available voltage, not just by the formula.
  • When estimating with ferromagnetic data, use a conservative \(\mu_r\) and check that the predicted \(B\) stays well below the core's saturation flux density.

Quick Reference: Typical Core Materials

Core material Relative permeability μᵣ (typical)
Air / vacuum 1
Ferrite 20–3000
Cast iron ~100–600
Steel 100–4000
Pure iron (annealed) up to ~5000 and beyond

Permeability of ferromagnetic materials varies strongly with purity, field strength, and temperature, so treat these values as rough guides. For related electromagnetism calculations, see also the Parallel Plate Capacitor and Point Charge Electric Field calculators.

Frequently Asked Questions

How do I calculate the solenoid field by hand?

First convert everything to SI units: current in amperes, length in metres. Then divide the number of turns by the length to get the turn density \(n\), and multiply \(B = \mu_0 \mu_r n I\) with \(\mu_0 \approx 1.257 \times 10^{-6}\ \text{T·m/A}\). For example, 300 turns on 15 cm carrying 3 A gives \(n = 2000\) turns/m and \(B \approx 7.5\ \text{mT}\) for an air core. Always divide by the winding length, never by the total wire length.

Why doesn't the coil's diameter or wire thickness change the field?

This follows from Ampère's law: the field inside a very long solenoid equals \(\mu_0 n I\) regardless of radius, because the loop you integrate around encloses the same total current \(nI\) per unit length no matter how wide the coil is. Wire thickness only matters indirectly — thicker wire lowers resistance and heating. However, for short coils the diameter does matter: the wider the coil relative to its length, the weaker the real central field.

What is the magnetic field outside a solenoid?

For an ideal infinitely long solenoid, the field outside is exactly zero. In practice, a long solenoid has only a small fringing field outside — typically a few percent of the interior value near the middle of the coil, rising near the ends where the field lines bulge outward. This near-zero exterior field is why solenoids are preferred over bare coils or bar magnets when you need a clean, contained field for experiments or shielding-sensitive equipment.

How accurate is the formula for a short or wide coil?

The formula overestimates the field for short coils. The exact central field of a finite solenoid with radius \(R\) is \(B = \mu_0 \mu_r n I \cdot \frac{L}{\sqrt{L^2 + 4R^2}}\). If \(L \geq 10R\) the correction is under 2%, which is why the long-solenoid formula works well there. For a flat coil, use the circular loop field \(B = \mu_0 N I / (2R)\) at the centre instead.

How do I convert between tesla, millitesla, and gauss?

The conversions are simple: \(1\ \text{T} = 1000\ \text{mT}\) and \(1\ \text{T} = 10\,000\ \text{G}\), so 1 mT = 10 G. For example, the Earth's field of about 0.05 mT equals 0.5 G, and a strong refrigerator magnet (~5 mT) is 50 G. Gauss is common in older literature and in the USA; tesla is the SI unit used in physics and engineering, so double-check which unit a datasheet uses before comparing values.

How can I make a solenoid's magnetic field stronger?

You have three levers: more turns per metre, more current, or a ferromagnetic core. Note that adding turns only helps if the winding length stays the same. Practical limits kick in quickly: more current or thinner wire increases resistive heating, and an iron core saturates at roughly 1–2 T, beyond which raising \(\mu_r\) or the current no longer raises the field proportionally. Real electromagnets are usually limited by heat dissipation and the power supply, not by the formula.

Can I use this calculator with AC or pulsed current?

Yes, but interpret the input carefully. The calculator treats the current as a steady DC value, so for AC enter the RMS current to get the RMS field (the peak field is \(\sqrt{2}\) times higher for a sine wave). Be aware that a changing current also induces back-EMF through the solenoid's inductance, and at high frequencies skin effect and core losses (especially in iron, which conducts) reduce the effective field. Ferrite cores perform much better at high frequency.

Leave a Reply

Your email address will not be published. Required fields are marked *