Magnetic Field of a Wire, a Coil and a Solenoid Calculator
Magnetic Field of a Straight Wire, a Circular Coil and a Solenoid
The three geometries every syllabus asks for, in one place, with the Earth’s own field printed beside the answer as a yardstick — and a note on why μ₀ is no longer exactly 4π × 10⁻⁷ and why the ampere is no longer defined by the force between two wires.
Field from a current, in three standard geometries
A 50-turn circular coil of radius 4 cm carrying 5 A, field at its centre
Two laws, three geometries, and a constant that lost its exactness in 2019
- µ₀
- 1.256 637 061 27(20)×10−6 N/A², the vacuum magnetic permeability. Note the bracket again: until 2019 this was EXACTLY 4π×10−7 by the old definition of the ampere, and it is now a measured quantity with an uncertainty of about 1.6 parts in 1010. School books almost universally still print the exact form, and at school precision it makes no difference at all — but “exactly 4π×10−7” is now a very good approximation rather than a definition
- r (wire)
- perpendicular distance from the wire to the point, in metres. First power of r, not the square — a straight wire’s field falls off as 1/r, not as an inverse square, because the wire is a line of sources rather than a point
- r (coil)
- the RADIUS of the coil, and the field is at its centre. Note that the coil’s field goes as 1/r while the number of turns multiplies it: a small coil of many turns is the way to a strong field, which is why every laboratory coil is small and heavily wound
- n
- turns per unit LENGTH for the solenoid, in turns per metre. Not the total number of turns, which is the standard error here. The field inside is independent of the solenoid’s radius and of where across the bore you measure, which is what makes a solenoid the practical way to make a uniform field
- F/L
- the force per metre between two parallel currents: attracting if the currents are parallel, repelling if antiparallel. Until 2019 this expression DEFINED the ampere; it is now a consequence of the ampere’s definition through the elementary charge
Worked example
A 50-turn circular coil of radius 4 cm carrying 5 A, field at its centre
CONVERT THE RADIUS. r = 4 cm = 0.04 m. One turn, one radius, in metres, before anything else
ONE TURN FIRST. B for a single turn is μ0I/2r = (1.25663706127×10−6 × 5)/(2 × 0.04) = 6.2832×10−6/0.08 = 7.854×10−5 T, which is 0.0785 mT — only about 1.6 times the Earth's field
MULTIPLY BY THE TURNS. Fifty turns at the same radius give fifty times the field: B = 3.9270 mT. The turns are the cheap way to a strong field, and that is the whole design principle of a coil
PUT IT IN CONTEXT, which is the part that makes the number mean something. 3.927 mT is 78.5 times the Earth's surface field of about 50 µT, and 39.27 gauss in the older unit still used on magnet data sheets. It will deflect a compass needle completely and it will not lift a paperclip
COMPARE THE OTHER TWO GEOMETRIES AT THE SAME CURRENT. A single straight wire 4 cm away gives only 0.025 mT — exactly half the Earth's field — because one wire is not fifty turns and the 2π in its denominator is larger than the 2 in the coil's. A solenoid at 50 turns per centimetre, which is 5000 per metre, gives 31.4159 mT, eight times the coil, because every one of those turns contributes along the whole length rather than once at a point
AND THE FORCE THAT USED TO DEFINE THE AMPERE. Two wires each carrying this 5 A, held 1 cm apart, pull on each other with μ0I²/2πd = 5.0×10−4 N/m. Until May 2019 that expression was the definition of the ampere. It is now a measured consequence of it, and it carries μ0's uncertainty
The three geometries at the same 5 A, and what the formula assumes
| Geometry | Formula | Field at 5 A | The assumption that can break it |
|---|---|---|---|
| Long straight wire, 4 cm away | μ0I/2πr | 0.0250 mT | the wire must be long compared with 4 cm; near an end or a bend this is wrong |
| One circular turn, radius 4 cm | μ0I/2r | 0.0785 mT | at the CENTRE only — off-centre needs the full axial formula |
| 50 turns, radius 4 cm | μ0NI/2r | 3.9270 mT | all turns at the same radius, and still only at the centre |
| Solenoid, 50 turns/cm | μ0nI | 31.4159 mT | deep inside a LONG solenoid; at the mouth the field is about half this |
Three formulae, two laws, and one constant that stopped being exact
These three results are the entire quantitative content of school magnetostatics, and they come from two laws. Biot–Savart, integrated round a ring, gives the field at the centre of a circular coil — that integration is the one the CBSE Unit III list names explicitly. Ampere’s circuital law, applied to a circle round a wire and to a rectangle through a solenoid, gives the other two in two lines each.
What a question is usually testing is the assumption, not the arithmetic. The straight-wire formula wants a wire long compared with the distance. The coil formula is for the CENTRE of the ring and nowhere else; a point on the axis a little way out needs the fuller expression with a (r² + x²)3/2 in it. The solenoid formula is for deep inside a long solenoid, and at the mouth the field has already fallen to about half the interior value. Each of those is a sentence worth writing in an answer.
Two features of the formulae are worth noticing because they are counter-intuitive. A straight wire’s field falls as 1/r, not as an inverse square — it is a line of current, not a point. And a solenoid’s interior field does not depend on its radius at all: a solenoid the width of a pencil and one the width of a bucket, wound at the same turns per metre and carrying the same current, have the same field inside. That is why the solenoid is the standard way to make a uniform field, and why the quantity in its formula is turns per METRE and not total turns.
And the constant has changed status. Every textbook prints μ0 = 4π×10−7 T·m/A exactly. It was exact, because until 20 May 2019 the ampere was defined by declaring the force between two parallel wires to be exactly 2×10−7 N/m at one metre’s spacing. The 2019 revision fixed the elementary charge instead, so the ampere now comes from a charge and μ0 has become something to be measured: 1.25663706127(20)×10−6 N/A², which differs from 4π×10−7 in the tenth significant figure. Nothing in a school answer changes. What changed is which statements are definitions, and the two-wire force — still printed beside “definition of ampere” in the CBSE document cited below — is now a consequence rather than a definition. For what that field then does to a current or a moving charge, see the magnetic force on a moving charge and on a wire.
Frequently asked questions
Why does a straight wire’s field fall off as 1/r instead of 1/r²?
Because the source is a line, not a point. Every element of the wire contributes, and the elements further along contribute at a shallower angle, and when you add them all up along an infinite wire the inverse squares combine into a single inverse power. The quick way to see it is Ampere’s law: the field is constant round a circle of radius r whose circumference is 2πr, and the enclosed current is fixed, so B must go as 1/r. A finite wire does eventually fall off faster, once you are far enough away that it looks like a point.
Is n in B = µ₀nI the number of turns or the turns per metre?
Turns per metre, always. This is the commonest error on the solenoid formula. A 500-turn solenoid 25 cm long has n = 2000 turns per metre, not 500. This page takes the figure in turns per CENTIMETRE, because that is the number you can actually measure on a solenoid with a ruler, and converts it for you — the converted value is printed as one of the rows.
Why does the solenoid’s field not depend on its radius?
Because of how Ampere’s law applies to it. Take a rectangular loop with one side along the axis inside and the other outside where the field is negligible; the enclosed current is the turns per metre times the length of that side times the current, and the loop integral is B times the same length. The length cancels and the radius never appeared. Physically, a wider solenoid has longer turns, each contributing less at the centre, and there are exactly enough more of them per metre to compensate.
Is µ₀ exactly 4π × 10⁻⁷?
Not since 20 May 2019. It was exactly that, by the old definition of the ampere through the force between two parallel wires. The revised SI fixes the elementary charge instead, so μ0 became a measured quantity: NIST CODATA 2022 gives 1.256 637 061 27(20)×10−6 N/A², which differs from 4π×10−7 by about 1.6 parts in 1010. Use 4π×10−7 in your answers — the difference is nine orders of magnitude below any school precision — but know that it is now an approximation.
How strong is the Earth’s magnetic field, for comparison?
Around 50 microtesla at the surface, which is 0.05 mT or half a gauss, varying with latitude and local geology by roughly a factor of two. This page prints your field as a multiple of 50 µT because that comparison is the most useful sanity check available: if a calculated field is not several times the Earth’s, a compass needle in it will not point convincingly, and if it is thousands of times larger you should check your arithmetic before you check your apparatus.
Does a magnetic field do work on the current that makes it?
No, and more generally a magnetic force never does work on a moving charge, because it is always perpendicular to the velocity. That is a strong statement with a useful consequence: a magnetic field can change the direction of a charged particle but never its speed or its kinetic energy. The companion page on the magnetic force on a charge and on a wire prints that zero explicitly, because it is a result rather than an omission.
Related calculators
References
- 2022 CODATA Recommended Values of the Fundamental Physical Constants (wallet card), NIST Committee on Data for Science and Technology, physics.nist.gov/cuu/pdf/wallet_2022.pdf (read 11 November 2026). Every constant on this page is taken from here, and the reason to read the card rather than a textbook is the bracket. The elementary charge is printed as 1.602 176 634 × 10−19 C with no bracket at all, because since the 2019 revision of the SI it is exact by definition — the coulomb is now defined from it, not the other way round. The same is true of c, h, k and NA. But the vacuum electric permittivity is printed 8.854 187 8188(14) × 10−12 F/m and the vacuum magnetic permeability 1.256 637 061 27(20) × 10−6 N/A²: both now have an uncertainty, about 1.6 parts in 1010, where before 2019 μ0 was exactly 4π × 10−7 and ε0 exactly 1/μ0c². Almost every school book still prints the old exact forms. At school precision nothing changes; the logic of which constants are definitions changed completely.
- Annual Syllabus Session 2023-24, Class XII Physics (Code 042), Central Board of Secondary Education, edustud.nic.in/edu/SYLLABUS_2023_24/12/12_physics_eng_2023_24.pdf (read 11 November 2026). The board’s own document, cited and not endorsed by it. Unit I Chapter 1 asks for “Coulomb’s law-force between two point charges; forces between multiple charges, superposition principle”; Chapter 2 for “electrical potential energy of a system of two point charges” and “capacitance of a parallel plate capacitor with and without dielectric medium between the plates, energy stored in a capacitor.(No derivation, formulae only)”. Unit II asks for “drift velocity, mobility and their relation with electric current”, “Internal resistance of a cell, potential difference and emf of a cell, combination of cells in series and in parallel, kirchhoff’s rules, Wheatstone bridge”. Unit III asks for “Biot – Savart law and its application to the current carrying circular loop”, “Ampere’s law and its applications to infinitely long straight wire. Straight solenoid (only qualitative treatment)” and “force between two parallel current-carrying conductors-definition of ampere”.
- The International System of Units (SI), 9th edition, Bureau International des Poids et Mesures, 2019. Cited for the structure the 2019 revision imposed: the ampere is now fixed by taking the elementary charge to be exactly 1.602 176 634 × 10−19 C, so the coulomb is one ampere-second and the ampere is defined through a charge. It is no longer defined by the force between two parallel wires — that force is now a measured consequence, with μ0‘s uncertainty in it. Several school syllabuses, the CBSE document cited above among them, still carry “definition of ampere” beside the two-wire force. The old definition is a good way to SEE what an ampere is; it has not been the definition since 20 May 2019.
- Syllabus: Cambridge International AS & A Level Physics 9702, for examination in 2025, 2026 and 2027 (Version 1), Cambridge Assessment International Education, cambridgeinternational.org/Images/664565-2025-2027-syllabus.pdf (read 11 November 2026). Cited for the outcomes a Cambridge candidate is examined on, which are worded differently from the Indian board’s: 18.3.2 “recall and use Coulomb’s law F = Q1Q2 /(4πε0r2) for the force between two point charges in free space”, 18.5.3 “use V = Q/(4πε0r) for the electric potential in the field due to a point charge”, 9.1.4 “use, for a current-carrying conductor, the expression I = Anvq, where n is the number density of charge carriers”, 10.1.5 “understand the effects of the internal resistance of a source of e.m.f. on the terminal potential difference”, 19.1.3 “derive, using C = Q/V, formulae for the combined capacitance of capacitors in series and in parallel”, 20.2.2 “recall and use the equation F = BIL sin θ, with directions as interpreted by Fleming’s left-hand rule” and 20.3.2 “recall and use F = BQv sin θ”. The copy read here was truncated before the data-and-formulae sheet, so what is on THAT sheet could not be established from it.
