Solenoid Magnetic Field Calculator

Magnetic field5.03 mT
Field in tesla5.03e-03 T
Field in gauss50.27 G
How this was calculated
  1. Turns per metre n = 500 turns / 0.25 m = 2,000.0 per metre.
  2. B = mu0 x n x I = (4 x pi x 10^-7) x 2,000.0 x 2.00 = 5.03e-03 T.
  3. In everyday units that is 5.03 mT, or 50.27 gauss.

A solenoid magnetic field calculator lets you find the magnetic field inside a long coil by entering the number of turns per metre and the current. The field is uniform inside and nearly zero outside the coil, and the calculator gives the answer in tesla, millitesla, and gauss. For example, 500 turns over 25 cm (2,000 turns per metre) at 2 A gives 5.03 mT (50.27 gauss), while 1,000 turns over 10 cm (10,000 per metre) at 0.5 A gives 6.28 mT. The field strength depends only on the product of turns per metre and current, so a sparse coil at 5 A (3.14 mT) can lose to a dense coil at 0.5 A (6.28 mT). For scale, Earth's magnetic field is roughly 0.025-0.065 mT and a fridge magnet's surface field is about 5 mT, comparable to the first verified solenoid.

The accepted standard for this calculation is the formula B = mu0 x n x I, where mu0 = 4 pi x 10^-7 T·m/A. This relationship is the established method because it directly captures how the field depends on turns per metre and current, verified across multiple cases. This page shows the formula, step-by-step workings, worked examples and sources so you can confirm every result yourself.

Worked examples

A bench electromagnet

Primary result: 5.03 mT — 2,000 turns per metre at 2 A, about a hundred times Earth's field. (500 · 25 cm · 2 A)

Magnetic field5.03 mT
Field in tesla5.03e-03 T
Field in gauss50.27 G

Tight winding, gentle current

Primary result: 6.28 mT — 10,000 turns per metre compensates for the 0.5 A current. (1000 · 10 cm · 0.5 A)

Magnetic field6.28 mT
Field in tesla6.28e-03 T
Field in gauss62.83 G

Few turns, high current

Primary result: 3.14 mT — only 500 turns per metre, but 5 A of current. (200 · 40 cm · 5 A)

Magnetic field3.14 mT
Field in tesla3.14e-03 T
Field in gauss31.42 G

What the solenoid formula describes

The solenoid formula describes the uniform axial magnetic field that runs straight down the center of a tightly wound coil. Inside a long solenoid, the field is B = mu0 x n x I, where n is the number of turns per metre and mu0 is the permeability of free space, equal to 4 pi x 10^-7 T·m/A. The field is uniform inside the coil and nearly zero outside it, which is what makes a solenoid so useful as a controlled, predictable source of magnetism.

This simple relationship is the starting point for a wide range of electromagnetic devices. Electromagnets, relays, valves, and MRI shim coils all begin from B = mu0 x n x I because it tells engineers exactly how much magnetic field they will get for a given winding density and current. A solenoid magnetic field calculator applies this formula instantly, letting you compare coil designs without working through the algebra by hand each time.

Only the product n x I matters when comparing solenoid designs. A sparse coil carrying high current can produce less field than a dense coil carrying low current. The verified examples make this clear: 200 turns over 40 cm, which is 500 turns per metre, at 5 A gives 3.14 mT, while 1000 turns over 10 cm, which is 10,000 turns per metre, at just 0.5 A gives 6.28 mT. The dense coil at low current wins by a factor of two despite using one-tenth the current, because its turn density is twenty times higher.

For a quick sense of scale, consider a third verified case: 500 turns over 25 cm, which is 2,000 turns per metre, at 2 A gives B = 5.03e-03 T, equal to 5.03 mT or 50.27 gauss. Earth's magnetic field is roughly 0.025 to 0.065 mT, so this solenoid produces a field about 100 to 200 times stronger than the planet's background field. A typical fridge magnet has a surface field of about 5 mT, which is comparable to the first verified solenoid. These comparisons help you judge whether a particular coil design will generate a field strong enough for your intended application.

The solenoid field formula, step by step

To use the solenoid magnetic field calculator, start by converting the total number of turns into turns per metre, written as n. If a coil has 500 turns spread over 25 cm, first convert the length to metres: 25 cm equals 0.25 m. Then divide the turns by that length, so n = 500 / 0.25 = 2,000 turns per metre. This step matters because the formula needs the winding density, not the raw turn count.

Once n is known, apply the field formula for a long solenoid: B = mu0 x n x I. Here mu0 is the permeability of free space, 4 pi x 10^-7 T·m/A, and I is the current in amperes. The field is uniform inside the coil and nearly zero outside it. For the verified case of 2,000 turns per metre at 2 A, the calculation is B = (4 pi x 10^-7) x 2,000 x 2. That gives B = 5.03e-03 T. To make this value easier to read, convert tesla to millitesla by multiplying by 1,000, which gives 5.03 mT. The same value equals 50.27 gauss.

Only the product n x I matters, so a sparse coil at high current can lose to a dense coil at low current. The verified cases show this clearly: 200 turns over 40 cm gives 500 turns per metre, and at 5 A the field is 3.14 mT. Meanwhile, 1,000 turns over 10 cm gives 10,000 turns per metre, and at just 0.5 A the field reaches 6.28 mT. The dense coil wins despite carrying one-tenth the current, because its turns-per-metre value is twenty times higher.

For scale, Earth's magnetic field is roughly 0.025-0.065 mT, and a fridge magnet's surface field is about 5 mT. The first verified solenoid, at 5.03 mT, is comparable to that fridge magnet, which shows how a modest coil and current can match a familiar household field.

Worked examples

The solenoid magnetic field calculator uses the formula B = mu0 x n x I, where mu0 = 4 pi x 10^-7 T·m/A and n is turns per metre. The field is uniform inside and nearly zero outside the coil. Three verified cases demonstrate how turns density and current interact to produce different field strengths.

Only the product n x I matters, so a sparse coil at high current can lose to a dense coil at low current. The verified cases show a sparse coil at 5 A (3.14 mT) losing to a dense coil at 0.5 A (6.28 mT). This is why turns density often matters more than current when designing a solenoid for a target field.

For scale, Earth's magnetic field is roughly 0.025-0.065 mT and a fridge magnet's surface field is about 5 mT — comparable to the first verified solenoid. The table below summarizes the three verified cases with turns density and current.

TurnsCoil lengthTurns per metre (n)Current (I)Magnetic field (B)
50025 cm2,0002 A5.03 mT (50.27 gauss)
100010 cm10,0000.5 A6.28 mT
20040 cm5005 A3.14 mT

Turns density vs current

A solenoid magnetic field calculator shows that the field inside a long solenoid follows B = mu0 x n x I, where n is turns per metre and mu0 = 4 pi x 10^-7 T·m/A. The field is uniform inside and nearly zero outside the coil. Because mu0 is a fixed constant, only the product n x I — the ampere-turns per metre — determines the strength. You can raise that product by winding more turns per metre or by driving more current through the wire. The two approaches are not equally practical, and understanding the trade-offs helps you choose the right design.

Consider three verified examples. A coil with 500 turns over 25 cm (2,000 turns per metre) at 2 A produces B = 5.03e-03 T, which equals 5.03 mT or 50.27 gauss. A denser coil with 1000 turns over 10 cm (10,000 per metre) at just 0.5 A gives 6.28 mT. A sparse coil with 200 turns over 40 cm (500 per metre) at 5 A gives only 3.14 mT. The sparse coil at 5 A loses to the dense coil at 0.5 A because the product n x I is lower: 2,500 versus 5,000 ampere-turns per metre. Only the product matters, not how you split it between turns and current.

Driving more current seems like the simpler option, but it brings heating. Wire resistance turns current into heat, and a coil running at 5 A must dissipate far more energy than one running at 0.5 A. Excess heat can damage insulation, shift resistance, and waste power. Winding more turns avoids that penalty but adds length, cost, and bulk. A longer winding also raises resistance, which reduces current for a given supply voltage. Designers balance these factors to reach a target field without overheating.

Magnetic saturation sets another limit. Once the core material (if present) saturates, adding turns or current produces little extra field. Air-core solenoids avoid saturation, but their fields stay modest. For scale, Earth's magnetic field is roughly 0.025-0.065 mT and a fridge magnet's surface field is about 5 mT — comparable to the first verified solenoid. Most practical solenoids produce fields in this range, so small changes in n x I matter.

Adding an iron core

The air-core formula B = mu0 x n x I is exact for an empty coil, but it sets a hard ceiling on what you can build. The reason is that mu0, the permeability of free space, is a tiny constant: 4 pi x 10^-7 T·m/A. Even a dense coil pushing real current tops out in the millitesla range. The verified examples make this plain — 10,000 turns per metre at 0.5 A gives just 6.28 mT, which is barely stronger than a fridge magnet's surface field of about 5 mT. A solenoid magnetic field calculator using only the air-core equation will confirm the same ceiling no matter how you trade turns for current, because only the product n x I matters.

Slipping a ferromagnetic core inside the coil changes the physics. Iron and similar materials respond to the coil's field by aligning their internal magnetic domains, adding their own contribution on top of what the current produces. The practical result is that the field is multiplied by the material's relative permeability — a factor that can reach into the thousands for common iron alloys. Where an air-core coil at 2,000 turns per metre and 2 A produces 5.03 mT, the same coil wound on a high-permeability iron core can in principle reach several hundred times that value before other effects intervene. This single change is why real-world electromagnets, relays, and actuators can grip scrap metal or actuate valves, while an identical air-core coil cannot.

The multiplication does not continue forever. As the core material's domains align, fewer remain available to reinforce the field, and the gain from relative permeability falls off. Iron saturates at roughly 1.5 to 2 T, meaning that beyond this point, additional current or turns produce only the same linear increase the air-core formula predicts. In practice, a well-designed electromagnet operates near but not beyond this saturation region, because pushing further wastes power as heat without meaningfully increasing the field. The air-core equation still describes the underlying relationship among turns, length, and current; the core simply scales the result up until the material can align no further.

This is why any solenoid magnetic field calculator that ignores the core will understate a real electromagnet by orders of magnitude at moderate currents, yet still predict the correct saturation ceiling. For air-core coils — the ones the basic formula actually describes — the calculator's output is exact and the millitesla-scale results it returns are the whole story. For iron-core devices, treat the calculator's result as the starting point to which the core's relative permeability applies, capped by the 1.5 to 2 T saturation limit.

An iron core can multiply a solenoid's field by hundreds or thousands, but the gain stops at saturation — around 1.5 to 2 T for iron. Beyond that point, more current just produces heat.

Limits of the formula

The standard solenoid formula B = mu0 x n x I assumes an infinitely long coil, where n is turns per metre and mu0 = 4 pi x 10^-7 T·m/A. In this idealized model, the field is perfectly uniform inside and nearly zero outside. Real solenoids, of course, have finite length, and the shorter or more sparse the coil, the more reality diverges from the math. A solenoid magnetic field calculator built on this formula will overestimate the field for short coils, because the formula cannot account for the fringing that occurs at the ends.

The core problem is fringing. In an infinitely long solenoid, every turn contributes equally to the field at any interior point, and the contributions from distant turns cancel outside the coil. In a short coil, the ends behave differently. Field lines bulge outward instead of running straight, so the field near the ends is weaker and less uniform than the centerline value the formula predicts. The shorter the coil relative to its diameter, the more pronounced this effect. A coil only twice as long as its diameter may have a centerline field tens of percent below the calculated value, and the field drops further as you approach either end.

Sparse windings compound the problem. The formula treats the turns as a continuous current sheet, but a real coil with widely spaced turns has gaps. Current flows in discrete loops rather than a smooth sheet, so the field between turns is not truly uniform. The verified examples show that only the product n x I matters in the ideal formula: a sparse coil at 5 A (200 turns over 40 cm, giving 3.14 mT) produces less field than a dense coil at 0.5 A (1000 turns over 10 cm, giving 6.28 mT), because the dense coil has a higher n x I product. But density affects uniformity as well as magnitude. A sparse coil has more variation between the field directly under a wire and the field in the gap between wires.

For practical sense of scale, the verified cases span a useful range. The 500-turn, 25 cm coil at 2 A produces 5.03 mT, comparable to a fridge magnet's surface field of about 5 mT. All three verified fields sit well above Earth's magnetic field of roughly 0.025-0.065 mT. But these are calculated centerline values for coils long enough that the infinite-solenoid approximation holds reasonably well. A short, sparse coil driven at the same current would deliver less than the formula predicts.

  • Formula assumes infinite length — real coils fringe at the ends
  • Short coils (length comparable to diameter) see the largest overestimates
  • Sparse windings break the continuous-current-sheet assumption, reducing uniformity
  • The calculator gives the centerline value for a long coil; actual fields near the ends will be lower
The infinite-solenoid formula is an upper bound for real coils. The shorter and more sparse the winding, the more the actual field falls below the calculated value.

FAQs

How do you calculate the magnetic field of a solenoid?

Use the formula B = mu0 x n x I, where n is in turns per metre. In the verified example: 4 pi x 10^-7 x 2,000 x 2 = 5.03e-03 T, which equals 5.03 mT. This gives the magnetic field strength along the central axis of an ideal long solenoid.

What is n in the solenoid formula?

The variable n represents turns per metre. For example, 500 turns over 0.25 m gives n = 2,000 per metre. Similarly, 1000 turns over 0.10 m gives 10,000. It is the number of coil windings divided by the solenoid length, not the total turn count alone.

How many gauss is the field?

Since 1 T = 10,000 gauss, the verified 5.03 mT field equals 50.27 gauss. That is about a thousand times Earth's field. To convert any tesla value to gauss, multiply by 10,000; to convert gauss to tesla, divide by 10,000.

Does a longer solenoid make a stronger field?

Only through n. Spreading the same 500 turns over twice the length halves n and halves the field. Total turns alone do not matter. What drives the field is the density of turns per metre, so a longer coil with the same turn count produces a weaker field.

Why is the field uniform inside?

The windings' fields add along the axis and cancel outside in the ideal long coil, leaving a near-uniform interior field. This is the property MRI and particle beams exploit. Inside an ideal solenoid, the magnetic field lines run parallel and evenly spaced, creating a consistent strength throughout the interior.

What does an iron core do?

It multiplies B by the material's relative permeability, which can range from hundreds to thousands, until the core saturates. This pushes the field far beyond the air-core values computed here. Once the iron saturates, further increases in current produce only small gains in field strength.

Sources

Related calculators

Magnetic Force Calculator
The Lorentz force on a moving charge, F = qvB sin θ — or on a current-carrying wire, F = BIL sin θ — with the angle between the motion and the field taken into account.
Inductor Energy Calculator
The energy stored in an inductor's magnetic field, E = 1/2 L I^2, in joules and millijoules.
Voltage Divider Calculator
Output voltage of a two-resistor voltage divider, the current through it, power in each resistor, and the output impedance your load will see.