Solenoid Magnetic Field Calculator
Enter the number of turns, solenoid length, and current to calculate the magnetic field (flux density) inside the coil. Switch core materials to model ferromagnetic or non-magnetic cores, use metric or imperial length units, and reverse-solve for any missing variable. The field-vs-current chart shows how B scales with drive current.
Formula
Worked example
A solenoid with 500 turns wound over 20 cm (0.20 m) carries 2 A and has a soft-iron core (μr = 5,000). Turn density: n = 500 / 0.20 = 2,500 turns/m. H = 2,500 × 2 = 5,000 A/m. μ = 4π × 10⁻⁷ × 5,000 ≈ 6.28 × 10⁻³ T·m/A. B = 6.28 × 10⁻³ × 5,000 ≈ 31.4 T (extreme; in practice the iron saturates well below this).
What is a solenoid and how does it produce a magnetic field?
A solenoid is a coil of wire wound in a tight helix. When an electric current flows through the winding, each loop acts like a small magnetic dipole, and the fields from all the loops add along the axis to produce a nearly uniform field inside the coil. For a long solenoid (length much greater than diameter) this uniform-field approximation is excellent at the centre and deteriorates only near the ends, where fringing effects appear. The field outside an ideal infinite solenoid is zero, and the flux is entirely contained within the bore. Real solenoids deviate from this ideal near the coil ends, but for most engineering purposes the centre-field formula is sufficiently accurate.
The solenoid magnetic field formula explained
The magnetic flux density B at the centre of a long solenoid is given by B = mu0 * mu_r * n * I, where mu0 = 4pi x 10^-7 T·m/A is the permeability of free space, mu_r is the relative permeability of the core material, n = N/L is the winding density in turns per metre, and I is the current in amperes. The H-field (magnetising intensity) H = nI is purely geometrical and current-dependent: it does not change when you swap the core. The B-field, however, scales with the core material through mu_r, so replacing an air core with soft iron can multiply B by 5,000 or more. The relationship B = mu * H holds until the core material magnetically saturates, after which B no longer rises proportionally with I. This calculator assumes linear (unsaturated) behaviour throughout.
Core materials and magnetic permeability
The relative permeability mu_r describes how much better a material conducts magnetic flux compared with vacuum (mu_r = 1). Diamagnetic materials such as copper and water have mu_r slightly below 1 and slightly reduce the field. Paramagnetic materials such as aluminium and platinum have mu_r marginally above 1 with negligible effect. Ferromagnetic and ferrimagnetic materials including soft iron, silicon steel, nickel, and various ferrites have mu_r from hundreds to hundreds of thousands, allowing solenoid cores to achieve industrial field strengths at modest currents. Permalloy (an 80:20 nickel-iron alloy) reaches mu_r up to 100,000 in carefully annealed form, making it useful for magnetic shielding and precision sensing coils. All these materials exhibit hysteresis and eventually saturate; the values in this tool are representative unsaturated linear permeabilities.
How to use the reverse-solve mode
Use the "Solve for" selector to choose which quantity you want to find. Select "Magnetic field (B)" for the standard forward calculation. Select "Current (I)" to find what current produces a target field with your coil geometry. Select "Number of turns (N)" to design a coil that achieves a target field at a given current and length. Select "Length (L)" to find the solenoid length needed for a target B. In every mode the three known quantities are used in the rearranged form of B = mu * n * I to recover the unknown.
Typical magnetic field strengths
| Application | Typical B (mT) | Notes |
|---|---|---|
| Earth magnetic field | 0.025 - 0.065 | Varies by latitude |
| Refrigerator magnet | ~5 | Ferrite permanent magnet |
| Small solenoid valve | 50 - 200 | Air-core or soft-iron core |
| Relay coil | 100 - 500 | Soft-iron armature |
| Loud speaker voice coil | 500 - 2,000 | Permanent magnet gap |
| Clinical MRI (1.5 T) | 1,500 | Superconducting solenoid |
| Clinical MRI (3 T) | 3,000 | High-field research scanner |
| Research magnet (Bitter) | 10,000 - 45,000 | Water-cooled copper magnet |
Reference values for common solenoid and magnet applications.
Frequently asked questions
What is the formula for the magnetic field inside a solenoid?
The magnetic flux density is B = mu0 * mu_r * (N/L) * I, where mu0 = 4pi x 10^-7 T·m/A, mu_r is the core relative permeability, N is the total number of turns, L is the solenoid length in metres, and I is the current in amperes. This simplifies to B = mu * n * I where n = N/L is the turn density.
Does the diameter of the solenoid affect the magnetic field?
For an ideal infinitely long solenoid the interior field is independent of the coil diameter. In practice, solenoids whose length is at least five times their diameter behave very close to the ideal, and the centre-field formula is accurate to within a few percent. Shorter, fatter coils deviate noticeably and require Biot-Savart integration for an accurate answer.
What is the difference between B and H?
H (magnetic field intensity, in A/m) describes the magnetising force produced by the current and geometry alone: H = n * I. B (magnetic flux density, in tesla) describes the total field including the response of the core material: B = mu0 * mu_r * H. Inside a vacuum or air core, B = mu0 * H. When you insert a ferromagnetic core, B increases by the factor mu_r while H stays the same.
What is the magnetic field outside a solenoid?
For an ideal infinitely long solenoid the external magnetic field is exactly zero, because the field from the return path of each loop cancels the external contribution of the forward path. For real, finite solenoids a small stray field exists outside the coil ends, and the fringing field can be significant at the very tips. In most engineering applications the external field of a long solenoid is treated as negligible.
How can I make a solenoid with a stronger magnetic field?
B = mu0 * mu_r * n * I, so you can increase any factor on the right. Use more turns per metre (tighter winding or shorter coil), drive higher current (needs thicker wire and better cooling), or insert a ferromagnetic core to multiply B by mu_r. High-field research solenoids use superconducting wire to eliminate resistive heating, allowing very high current densities and fields above 10 T. Water-cooled "Bitter" magnets achieve up to 45 T using copper sheets with axial holes for coolant flow.
What units is the magnetic field measured in?
The SI unit is the tesla (T). For everyday solenoids the millitesla (mT, 1/1000 of a tesla) is more convenient. The older CGS unit, the gauss (G), is still common in magnetics: 1 T = 10,000 G. The Earth's field is about 25 to 65 microtesla (0.25 to 0.65 G), a fridge magnet is around 5 mT, and a clinical MRI scanner operates at 1.5 T or 3 T.