Magnetic Field of a Solenoid Calculator
Field inside a long solenoid: B = μ₀ · n · I, where n is turns per unit length and I is the current.
Inputs
Drag the handle (or focus it and press ↑/↓) to reorder. Scientific notation such as 2.5e3 is accepted. Pick any unit; conversion is automatic. The result is for a long solenoid, where the length is much larger than the diameter. Pick any unit; conversion is automatic.
Results
Enter values and press Calculate. Your answer will appear here.
Magnetic field vs. current
B grows in direct proportion to the current, and doubling the turns per metre doubles the field. The solid line is your solenoid, the dashed lines are half and double the turn density, and the dot is your result.
What is being calculated
Reference values
| Current (n = 1000 turns/m) | B | B in gauss |
|---|
B = μ₀·n·I, so doubling the current doubles the field.
Typical core relative permeability μr (approximate)
| Core material | μr |
|---|---|
| Vacuum | 1 (exactly) |
| Air | ≈ 1.0000004 |
| Copper, aluminium | ≈ 1 (non-magnetic) |
| Nickel-zinc ferrite | ≈ 16 to 640 |
| Pure iron (99.8 %) | ≈ 5,000 (peak) |
| Mu-metal | ≈ 20,000 to 50,000 |
Ferromagnetic μr depends strongly on field strength, treatment and frequency; use the manufacturer’s data.
Typical magnetic fields for scale (approximate)
| Source | B |
|---|---|
| Earth’s surface | ≈ 25 to 65 µT |
| Fridge magnet | ≈ 5 mT |
| Clinical MRI scanner | ≈ 1.5 to 3 T |
| Strongest sustained lab magnets | ≈ 45 T |
Unit conversions
| Quantity | Conversion |
|---|---|
| Magnetic field | 1 T = 1,000 mT = 10⁶ µT = 10,000 G · 1 G = 100 µT |
| Turns per length | 1 /cm = 100 /m · 1 /mm = 1,000 /m · 1 /in = 39.37 /m |
| Current | 1 A = 1,000 mA · 1 kA = 1,000 A |
| Constant | μ₀ ≈ 1.2566×10⁻⁶ H/m ≈ 4π×10⁻⁷ H/m |
Formula
- B: magnetic flux density inside the solenoid (T)
- μ₀: permeability of free space ≈ 4π×10⁻⁷ H/m
- n = N / ℓ: turns per unit length (turns/m)
- I: current (A)
Example: n = 1000 turns/m and I = 2 A. B = 1.2566×10⁻⁶ × 1000 × 2 ≈ 2.513×10⁻³ T = 2.513 mT = 25.13 G.
This is the field inside an ideal long solenoid, where it is uniform and nearly zero outside. With a core, B = μ₀·μr·n·I. For a finite solenoid of length ℓ and radius R the on-axis field at the centre is B = μ₀·n·I·(ℓ/2) / √((ℓ/2)² + R²), and about half of the ideal value at the end. Advanced mode also gives the inductance L = μ₀·μr·N²·A/ℓ, the stored energy ½·L·I² and the energy density B²/(2μ). The formulas assume a uniform winding and a linear core.
References
- Wikipedia, Solenoid: field inside a long and a finite solenoid
- HyperPhysics, Magnetic Field of Solenoid: derivation of B = μ₀nI
- NIST CODATA, Vacuum magnetic permeability μ₀: value of the constant
How to Use This Tool
- Pick a preset, or enter the turns per unit length n and its unit.
- Enter the current I and its unit.
- In Advanced, enter the total turns and length instead, add the diameter for finite-length values, or a core permeability.
- Click Calculate.
- Read B in the highlighted result, check the warnings and the chart.
What This Tool Offers
- Basic and Advanced modes on one calculation engine
- Turn density, current, length and field unit conversion (T, mT, µT, nT, G)
- Comparison with Earth’s field and energy density
- N and length input, core permeability, finite-length centre and end fields, inductance and stored energy (Advanced)
- Field-vs-current chart and labelled solenoid diagram
- Reorderable inputs, presets and a mobile-friendly layout
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| B | Magnetic flux density inside the solenoid | T |
| μ₀ | Permeability of free space (4π×10⁻⁷) | H/m |
| n | Number of turns per unit length | turns/m |
| I | Electric current through the solenoid | A |
| N | Total number of turns | dimensionless |
| L | Length of the solenoid | m |
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| Parameter | Value |
|---|---|
| N | 1000 |
| L | 0.5 m |
| I | 2 A |
| μ₀ | 4π×10⁻⁷ H/m |
| Formula | B = μ₀·(N/L)·I |
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
Related calculators · Magnetics
Recently updated formulas
Suggest an improvement
Found a mistake? Have a better example? Let us know.
You may send up to 3 suggestions per 24 hours.