Solenoid Magnetic Field Calculator
Calculate flux density, magnetic field strength, and field energy density.
About solenoid magnetic fields
A current-carrying solenoid produces a concentrated magnetic field along its axis. For an ideal long solenoid, Ampere's law gives magnetic field strength H = NI/l, where N is the total number of turns, I is current in amperes, and l is winding length in metres. H is measured in amperes per metre and describes the magnetizing force created by the winding independently of the core response. Magnetic flux density includes that material response. It is calculated as B = μ₀μᵣH, where μ₀ is the permeability of free space and μᵣ is relative permeability. The result is measured in teslas. Air and vacuum have relative permeability near 1. Ferromagnetic cores can have much larger permeability, so they can produce a stronger flux density for the same ampere-turns. The calculator also reports ideal magnetic energy density using u = B²/(2μ₀μᵣ), measured in joules per cubic metre. Increasing current or turn count raises both H and B linearly in the ideal model. Increasing coil length while keeping the same turns spreads the winding out and lowers the field. Unlike an inductance calculation, solenoid diameter is not required for the ideal internal field because Ampere's law depends on turns per unit length. Diameter becomes relevant when calculating total flux, inductance, force, or finite-length corrections. Real devices depart from this simple model. Fields weaken and spread near coil ends, magnetic circuits may include air gaps, and core permeability varies with frequency, temperature, and flux level. A core can saturate, after which increasing current produces much less additional flux and substantially more heating. This calculator is therefore most useful for classroom problems, first-pass electromagnet sizing, and comparison of winding choices. For safety-critical or high-power designs, compare the result with the core manufacturer's B-H curve, winding temperature limits, and measured field data. Always verify that the selected wire can safely carry the intended current without excessive temperature rise.
Magnetic field examples
| Inputs | Results | Use |
|---|---|---|
| 2 A, 500 turns, 0.10 m, μᵣ 1 | B 12.57 mT; H 10,000 A/m | Air-core coil |
| 0.5 A, 200 turns, 0.05 m, μᵣ 1 | B 2.513 mT; H 2,000 A/m | Compact test coil |
| 1 A, 1000 turns, 0.20 m, μᵣ 100 | B 0.6283 T; H 5,000 A/m | Idealized core |
How to calculate a solenoid field
- Enter the steady current flowing through the winding.
- Enter the total turns and wound length in metres.
- Use 1 for air or enter an effective core permeability.
- Select Calculate and compare flux density, field strength, and energy density.
Frequently asked questions
What is the difference between B and H?
H is magnetizing field strength created by current and winding geometry. B is magnetic flux density and also reflects the permeability of the material.
Why is diameter not required?
The ideal long-solenoid field depends on turns per unit length rather than cross-sectional area. Diameter matters for flux, inductance, and finite-coil corrections.
What value should I use for an air core?
Use relative permeability 1 for air or vacuum. Most non-magnetic supports are also close enough to 1 for this approximation.
Does the calculator account for saturation?
No, it treats relative permeability as constant. Real ferromagnetic cores lose effective permeability as they approach saturation.
Is the field uniform everywhere?
The ideal field is approximately uniform near the center of a long solenoid. It decreases and bends outward near both ends.