Solenoid Magnetic Field Calculator — Inside the Coil
Inside a long coil, the magnetic field is uniform, axial, and computable from three numbers: the turns density and the current (times the core’s permeability). Enter the turns, the coil’s length, the current and the core material’s relative permeability, and this calculator returns the field.
Ampère’s Law, Wound Into a Tube
The solenoid is electromagnetism’s cleanest machine: wrap a wire into a tight helix and the fields of its turns conspire to cancel outside and reinforce inside, producing (for a long coil) a uniform axial field B = μ₀μrnI, with n the turns per metre. Ampère’s law derives it in four lines (the Amperian loop threads the interior’s turns and nothing else), and the design consequences print directly off the formula: the field cares about turns density times current — the ampere-turns per metre — and not at all about the coil’s diameter; the core multiplies by μr until it saturates; and doubling the length at fixed turns dilutes the field, the trap for builders who stretch a design. Every electromagnet, relay, solenoid valve and MRI magnet is this equation with a budget attached. The calculator returns B with the turns density and ampere-turns displayed, because designers think in those currencies and the field is their exchange product. A pocket sanity scale helps the intuition settle: the worked example’s 12.6 mT will deflect a compass violently and hold a paperclip against gravity through a few millimetres of card; the tesla-scale fields of the research magnets belong to another engineering civilisation of cryogenics and megawatt supplies, reached from this page’s multiplication by turning every factor to its practical extreme at once.
Worked Example: A Thousand Turns, Two Amps
The defaults: N = 1,000 turns over 20 cm (n = 5,000 per metre), I = 2 A, air core. B = 4π×10⁻⁷ × 5,000 × 2 = 12.57 mT — two hundred and fifty times Earth’s field, respectable for a bench coil and enough to swing compasses across the room. The ampere-turns figure, 2,000, is the design’s fuel gauge. Now slide a ferrite core in (μr = 800, entered in the fourth field) and the same winding returns 10.05 T by the formula — which the note’s saturation warning immediately overrules: no ferrite holds that; real cores saturate in the tenths of a tesla (ferrites) to about 2 T (the best irons), and the formula’s linearity ends there. The calculator prints the ideal and carries its ceiling on its face — the standing arrangement of this hub’s physics pages with the engineered world.
From Field to Force: What Solenoids Are For
The field’s uniformity is the point of most applications: NMR and MRI demand it to parts per million over a volume (their superconducting solenoids are this page’s formula executed with obsessive winding discipline and persistent currents); particle accelerators focus beams with it; calibration laboratories keep standard fields in it. The force applications — the plunger pulled into a solenoid valve or relay — live off the field’s nonuniformity at the coil’s ends (the iron plunger is drawn toward the centre where the energy is lowest), a derivative application the calculator does not price but whose input is this page’s B. Even the humble doorbell chime is a solenoid spending its field on a hammer: the formula’s reach, from MRI suites to front doors, is the reach of wound wire itself.
The Solenoid That Hears the Universe
The most sensitive magnetometers ever flown are search-coil and fluxgate instruments — solenoid physics run in reverse, a changing field inducing its signature in a precision winding — and the same geometry in superconducting dress (the SQUID’s pickup loops) resolves fields of femtoteslas, the brain’s and heart’s magnetic whispers among them. The calculator’s formula prices the transmitter’s version of the coil; the receiver’s is its reciprocal portrait, and the identity of the geometry across the two directions is why one page can speak for both: wind it, drive it, and you command a field; wind it, listen, and the field confesses. Henry’s coils were already both, in embryo.
The Latching Relay and the Doorbell: Field at Work
The solenoid’s force career deserves its concrete census: a relay’s coil of a few thousand turns at tens of milliamps (this formula’s millitesla range, concentrated by an iron circuit into a gap field far stronger) snaps contacts that switch kilowatts; a doorbell’s coil drives its striker with a field the same equation sizes; the starter solenoid in every car throws a pinion and closes contacts for hundreds of amps from a dashboard key’s whisper. In each, the calculator’s B is the upstream quantity — the field the iron circuit then concentrates, the force being roughly B² × (gap area) ÷ 2μ₀’s business — and the design loop starts, invariably, with turns times amps per metre.
Related Tools
More from the Physics Calculators hub: the dB Gain Calculator — for the amplifiers that drive this coil’s current in signal work — and the Inductive Reactance Calculator, the coil’s other electrical personality at AC.
Frequently Asked Questions
Why doesn’t the diameter matter?
Because the interior field of the ideal (long, tightly wound) solenoid is set by the surface current density along its length — turns per metre times amps — and the contributions of the far side of the winding cancel the diameter’s influence out in the Amperian bookkeeping. Diameter matters enormously to everything else: the wire length (hence resistance and heating), the inductance (which scales with area), the volume of uniform field, the plunger’s force. The field strength’s indifference to it is one of those cancellations that feels like a trick until the loop integral is drawn once — the calculator’s inputs honour it by asking for length and turns, never a diameter.
What happens at the coil’s ends?
The field fringes: on the axis it falls to exactly half its interior value at the end face (a neat result of the finite-solenoid integral) and spreads outward beyond, the leakage that couples neighbouring equipment and pulls plungers in. Short coils (length comparable to diameter) fringe throughout — the calculator’s long-coil formula then overstates the centre field, and the correction factors (Nagaoka’s coefficient) that coil-winders apply are functions of the length-to-diameter ratio. The calculator’s jurisdiction is the long coil it names; the ends’ behaviour is described here because every real coil has ends.
How strong can an electromagnet get?
The record books divide by technology: iron-cored DC magnets saturate near 2 T; superconducting solenoids reach 20–30 T in laboratories (MRI’s 1.5–11.7 T are their tame commercial cousins); resistive Bitter magnets touch 40 T at megawatt appetites; hybrid systems exceed 45 T; pulsed coils flirt with 100 T microseconds before physics (and sometimes the coil) objects destructively. The calculator’s formula caps none of these — the materials do — and its saturation note marks the first ceiling the reader will meet. Field strength records are a materials-science leaderboard wearing a formula’s clothes.
Does the wire’s own resistance enter?
Not into B directly — the formula takes current as given — but it decides what voltage buys that current and what heat must leave: a 1,000-turn coil of fine wire may present hundreds of ohms, so 2 A could demand hundreds of volts and dissipate kilowatts in a fist-sized winding. Real solenoid design iterates the calculator’s field target against the winding’s resistance and thermal budget (thicker wire: fewer turns fit; the optimisation is the profession’s daily bread). The calculator prices the magnetics; the thermal-electrical iteration around it is named here as the rest of the job.
What is the field outside?
Near zero for the ideal long solenoid — the return flux spreads through all of surrounding space so thinly that the exterior resembles a bar magnet’s field only at a distance (weak, dipolar) while close alongside the winding it nearly vanishes, the cancellation that makes solenoids good neighbours and MRI suites shieldable. The exterior’s weakness is a design feature the formula’s interior focus undersells: the coil concentrates its field where the work is and abandons it elsewhere. Mu-metal cans finish the job where “nearly” is not enough.
What is a Helmholtz coil, and how does it relate?
Two identical flat coils separated by their radius, wired in series — a solenoid unrolled into its most uniform limit: at their centre the field’s uniformity beats a simple solenoid’s over a small volume, and the field there is a known multiple of μ₀nI ÷ radius, the geometry laboratories use to calibrate magnetometers and to cancel Earth’s field around delicate experiments (the hub’s magnetometer-era instruments were zeroed inside such pairs). The calculator’s solenoid is the long-coil member of the family; Helmholtz’s pair is the family’s precision instrument, and both are Ampère’s law with the winding pattern chosen by the uniformity the job demands.
Who first wound one?
The electromagnet is Sturgeon’s (1825) — soft iron, varnished wire, a horseshoe that lifted nine pounds on a battery’s whim — and the solenoid as an instrument is Ampère’s naming and analysis (his solénoïde, from the Greek for pipe). Joseph Henry, the American contemporary, wound miles of insulated wire into the powerful multi-layer coils that made telegraphy and the motor age possible, and published the turns-and-current wisdom this page formalises. The calculator’s B is the Sturgeon–Henry machine reduced to its governing multiplication, two centuries of winding practice confirming it daily.