Magnetic Field of a Straight Wire Calculator – B = μ₀I/(2πr)

Use this free Magnetic Field of a Straight Wire Calculator to find the field strength at a distance from a long straight wire carrying a current, using B = μ₀I ÷ (2πr).

Every current-carrying wire wraps itself in a magnetic field, whether we want it to or not. The field is invisible, but iron filings sprinkled around a wire betray its shape at once: perfect circles centred on the wire, like the rings around a stone dropped in a pond. This was Ørsted's great discovery of 1820 — a compass needle twitching beside a wire — and it was the first proof that electricity and magnetism are one subject, not two. The formula on this page gives the strength of that circular field at any distance from the wire.

The strength depends on just two things. It grows in direct proportion to the current I: double the current, double the field, everywhere. And it fades with distance r — but gently, as 1/r rather than the 1/r² of a point source. Double your distance and the field halves; move ten times further away and it falls only to a tenth. That slow fade is why a wire's field can still disturb a compass centimetres away, and why the fields of power lines, though weak, reach further than intuition suggests.

Magnetic Field of a Straight Wire Calculator — formula and diagram

The constant out front, μ₀/(2π), works out to almost exactly 2 × 10⁻⁷ in SI units, which gives the formula a memorable working form: B = 2 × 10⁻⁷ × I ÷ r tesla, with I in amps and r in metres. A single amp at a distance of 1 cm gives 2 × 10⁻⁵ T = 20 µT — already comparable to the Earth's field. Currents of a few amps therefore dominate their immediate neighbourhood magnetically, while the Earth wins only once you step back or the current stops. The examples below keep returning to that comparison, because the Earth's field (about 50 µT) is the natural yardstick for fields of this size.

wire, current out of page r field here = μ₀I/(2πr), tangent to the circle rings get weaker as r grows — as 1/r

Formula

B = μ₀ × I ÷ (2π × r)  •  B in tesla (T), I in amps (A), r in metres (m), μ₀ = 4π × 10⁻⁷ H/m.

Because μ₀/(2π) = 2 × 10⁻⁷, the formula is often written B = 2 × 10⁻⁷ × I/r. Its rearrangements answer the two natural inverse questions: I = 2πrB ÷ μ₀ finds the current from a measured field — the working principle of the clamp meter, which reads a cable's current without touching it — and r = μ₀I ÷ (2πB) finds how far from a wire the field falls to a chosen strength, as in Example 5. The formula assumes a long, straight wire and a point not too close to its ends; near an end, or for a short wire, the field is weaker and the exact result needs the fuller Biot–Savart law. It also assumes empty space (or air, which is magnetically the same); threading the wire through iron changes everything, as the solenoid page shows.

SymbolMeaningUnits
Bmagnetic field strength at the pointtesla (T), often µT here
Icurrent in the wireamps (A)
rperpendicular distance from the wiremetres (m)
μ₀permeability of free space, 4π × 10⁻⁷H/m

Why 1/r? The geometry of an endless source

Students often expect 1/r², because that is how a point charge's electric field fades. The difference is the shape of the source. A point is surrounded by spheres whose area grows as r², so its influence dilutes as 1/r². A long wire is surrounded by cylinders whose circumference grows only as r — so its influence dilutes as 1/r. Every point of the endless wire contributes, and the contributions from far along the wire, though individually weak, are numerous enough to soften the fall-off. The same geometry explains the companion results in this batch: squash the wire into a loop and the centre field goes as 1/R; stretch loops into a solenoid and the interior field stops depending on distance at all.

The circular shape matters as much as the strength. The field has no poles and no beginning: each field line is a closed ring around the wire. Cut the current and the rings vanish; reverse it and every ring flips direction. Superimpose the rings of two nearby wires and you get the field patterns that make wires attract or repel — the force-between-wires result used to define the ampere. And because the rings pass through everything, including the wire's own insulation and the air, a clamp meter can sense the field outside a cable and report the current inside without breaking the circuit.

B falls as 1/r… …not as fast as 1/r² (dashed, for comparison) B r doubling r only halves B

How to use

  1. Enter the current I in the wire, in amps.
  2. Enter r, the perpendicular distance from the centre of the wire to your point, in metres — 5 cm is 0.05, 2 cm is 0.02.
  3. Click "Calculate" to get B in tesla; multiply by 10⁶ to express it in microtesla (µT) for comparison with the Earth's ~50 µT.
  4. For direction, use the right-hand grip rule: thumb along the conventional current, fingers curl with the field. The field at your point runs tangent to the circle through it.
  5. Remember the idealisation: the wire should be long compared with r. At r = 5 cm from the middle of a metre-long wire the formula is excellent; near a wire's end it overestimates.

Worked examples

Example 1 — a bench wire. A wire carries 10 A; find the field 0.05 m (5 cm) away.
B = μ₀I ÷ (2πr) = (4π × 10⁻⁷ × 10) ÷ (2π × 0.05) = 4 × 10⁻⁵ T = 40 µT.
At just 5 cm from an ordinary current, the wire's field already rivals the Earth's — which is why Ørsted's compass needle moved.

Example 2 — a heavy cable. A cable carries 100 A; the field at 0.1 m is
B = 2 × 10⁻⁷ × 100 ÷ 0.1 = 2 × 10⁻⁴ T = 200 µT, four times the Earth's field, at a full 10 cm away. Fields near industrial cabling are not negligible for sensitive instruments.

Example 3 — a single amp, close in. At 0.02 m (2 cm) from a wire carrying 1 A:
B = 2 × 10⁻⁷ × 1 ÷ 0.02 = 1 × 10⁻⁵ T = 10 µT. Even one amp produces a fifth of the Earth's field at fingertip distance — the basis of sensitive current probes.

Example 4 — a lightning strike. A lightning channel carries about 30,000 A. At a distance of 10 m:
B = 2 × 10⁻⁷ × 30,000 ÷ 10 = 6 × 10⁻⁴ T = 600 µT, twelve times the Earth's field, arriving as a sharp pulse. Pulses like this are what "lightning detectors" and the magnetic component of EMP measurements actually sense.

Example 5 — how far until the Earth wins? For the 10 A wire of Example 1, where does B fall to the Earth's 50 µT = 5 × 10⁻⁵ T?
r = μ₀I ÷ (2πB) = 2 × 10⁻⁷ × 10 ÷ (5 × 10⁻⁵) = 0.04 m = 4 cm. Inside 4 cm the wire dominates; outside it, the Earth's field is the larger of the two (though the wire's is still there, adding vectorially).

Example 6 — a busbar. A busbar carries 500 A; at 0.25 m:
B = 2 × 10⁻⁷ × 500 ÷ 0.25 = 4 × 10⁻⁴ T = 400 µT. Eight times the Earth's field at arm's length — enough to upset a nearby compass, a magnetometer, or an old CRT monitor, all from a conductor that is just sitting there doing its job.

The wire's field in real life

Clamp meters. An electrician's clamp meter is this formula with a handle: its jaws gather the circular field around a cable, measure B, and work backwards to I. No contact, no broken circuit — possible only because the field escapes the insulation and rings the wire in public.

Compass interference. A compass near a DC cable reads the sum of the Earth's field and the wire's. With the wire's 40 µT of Example 1 against a horizontal Earth component of about 20 µT, the needle swings to tan⁻¹(40/20) ≈ 63° away from north — the reason ship and aircraft compasses are sited away from wiring, and why Ørsted noticed anything at all.

Power lines and instruments. Under a transmission line the fields are microtesla-scale, easily computed from this formula with the line's current and height. Surveyors, pipeline inspectors and environmental monitors use exactly this estimate before reaching for instruments.

Electromagnet windings. Every coil is this field, accumulated: each turn contributes its own rings, and inside a winding they add constructively. The loop and solenoid calculators in this batch are this page's formula wrapped into circles and helices.

Current sensing in electronics. Hall sensors placed beside a PCB track read the track's current from its field — the same clamp-meter trick at millimetre scale, used by battery-management systems in phones and electric cars.

Cathodic protection and railways. DC currents in rails and pipelines advertise themselves magnetically; engineers map the fields above buried lines with this formula inverted, locating the conductor and estimating its current without digging.

I up right-hand grip rule: thumb = current, fingers curl = field a compass needle lines up with the total field

Two wires are more interesting than one

A single wire's field is a curiosity; two wires' fields are a technology. Where the rings of two parallel wires overlap, the fields add between the wires if the currents run opposite, and cancel between them if the currents run the same way — and the wires are pulled or pushed accordingly, with F/L = μ₀I₁I₂/(2πd). There is also a quieter cancellation with real economic value: a cable carrying current out and back in two close conductors (every lamp cord, every twisted pair) has two nearly opposite fields that almost annihilate each other beyond a few wire-widths away. That is why household wiring, a maze of amps, does not scramble every compass in the house — except very close to a single separated conductor, where a 13 A ring-main wire at 1 cm still makes 2 × 10⁻⁷ × 13 ÷ 0.01 = 260 µT, briefly five times the Earth's field.

The go-and-return trick: why paired conductors are quiet

Real circuits always have two wires: one carrying current out, one bringing it back. Their fields oppose, and away from the pair they nearly erase each other. Put numbers to it with this page's formula. Two conductors 5 mm apart carry 10 A in opposite directions. At a point 0.1 m away, the nearer wire (0.0975 m) makes B = 2 × 10⁻⁷ × 10 ÷ 0.0975 = 20.5 µT in one sense, and the farther wire (0.1025 m) makes 19.5 µT in the opposite sense. The net field is the difference: about 1 µT — twenty times weaker than the 20 µT a single unpaired wire would make at the same distance, and fifty times weaker than the Earth's field. Move further away and the cancellation improves steadily; twist the pair around each other, as in a twisted-pair cable, and the residual field alternates sign every half-twist and averages away faster still. This is why the wiring in a building full of amps leaves compasses and cassette tapes unmolested, why sensitive measurement leads are twisted, and why a clamp meter must be closed around one conductor only: clamp both, and you measure the honest sum — almost nothing.

At the wire's own surface: the strongest address on the street

The 1/r law has a near end as well as a far one: the field is strongest right at the conductor's surface, the smallest r the outside world offers. For a wire of radius 1 mm carrying 10 A, the surface field is B = 2 × 10⁻⁷ × 10 ÷ 0.001 = 2 × 10⁻³ T = 2 mT — forty times the Earth's field, clinging to a millimetre of copper. Nothing outside the wire can exceed it, which is why magnetic effects that need the field at its best — the pull on iron filings, the signal in a Rogowski coil hugging a busbar, the heating of a wire's own surface in a strong self-field — all live at the surface. Inside the metal the story inverts, as FAQ 4 notes: the field falls back to zero at the axis, so the surface is a true maximum, the crest of the 1/r hill.

Quick reference: field around a 10 A wire

Distance rField BCompared with Earth (≈50 µT)
1 cm200 µT4× stronger
2 cm100 µT2× stronger
5 cm40 µTabout equal
10 cm20 µT0.4×
20 cm10 µT0.2×

Scale any row by the current: at 1 A divide by ten, at 100 A multiply by ten. The 1/r pattern — each doubling of distance halving the field — is visible down the middle column.

Common mistakes

  • Using 1/r². The field of a long wire falls as 1/r, not 1/r². At 20 cm the true field of a 10 A wire is 10 µT; a 1/r² guess from the 5 cm value would say 2.5 µT — four times too small.
  • Measuring r from the wire's surface. r is measured from the wire's centre (axis). For thin wires the difference is trivial; for a fat busbar it is not.
  • Leaving r in centimetres. The formula wants metres. Entering 5 instead of 0.05 shrinks the answer a hundredfold and hides a field that really rivals the Earth's.
  • Applying it to a short wire or near an end. B = μ₀I/(2πr) assumes the wire stretches far in both directions compared with r. Near the end of a short stub, the true field is smaller; the formula is the long-wire limit.
  • Forgetting the field is a vector. Fields from several wires add as vectors, not as numbers — two equal fields at right angles give √2 times one field, not twice. The calculator gives one wire's contribution; the total needs the directions too.

FAQ

Which way does the field point?
The field forms circles around the wire. Use the right-hand grip rule: point your right thumb along the current and your fingers curl in the direction of the field.

How does the field change with distance?
It weakens as 1/r — double the distance and the field halves. This is slower than the 1/r² fall-off of a point charge's electric field, because the wire is a line, not a point.

What is μ₀?
μ₀ is the permeability of free space, 4π × 10⁻⁷ H/m. It measures how easily a magnetic field can form in empty space, and it appears in almost every formula for fields made by currents.

Does the field exist inside the wire?
Yes, but it is weaker there and grows from zero at the axis to the surface value — inside a uniform conductor B is proportional to r rather than 1/r. This calculator gives the field outside the wire, which is where it is almost always needed.

What if the current is AC?
The field follows the current instant by instant, so it oscillates too, at the same frequency. The formula gives the field for the current at that moment (or for the RMS current, the RMS field). At mains frequency the quasistatic picture on this page is an excellent approximation.

Why doesn't the field of my lamp cord disturb my compass?
Because the cord contains both the outgoing and return conductors side by side. Their fields nearly cancel beyond a few millimetres. Separate the two conductors, or clamp a meter around just one, and the field appears at full strength.

How does this formula lead to the force between two wires?
Wire 2 sits in wire 1's field, B = μ₀I₁/(2πd), and feels F = BIL with L the parallel length. Dividing by L gives F/L = μ₀I₁I₂/(2πd) — attraction for currents in the same direction, repulsion for opposite ones.

Can the field be shielded?
Not by ordinary materials the way electric fields are blocked by metal. High-permeability alloys such as mu-metal can reroute field lines around a protected volume, but mostly engineers manage wire fields by distance (1/r is slow but sure) and by pairing conductors so the fields cancel.

What field does a wire make at 1 metre?
For 10 A: B = 2 × 10⁻⁷ × 10 ÷ 1 = 2 × 10⁻⁶ T = 2 µT, about 4% of the Earth's field. Small, but well within the reach of a phone magnetometer — which is why compass apps wobble near cabling.

Is the formula exact for a real wire?
It is exact for an infinitely long, straight, thin wire in empty space, and an excellent approximation for real wires when r is small compared with the wire's length and the distance to any return conductor. Those conditions cover most bench and building situations.

Thomas Becker

Thomas Becker

Physics Writer · Electricity & Magnetism

Thomas Becker creates and reviews our magnetism and electrostatics calculators at CalcVIP. Every calculator is checked against hand-worked examples before it is published, so the formula, the diagram and the answer all agree.

View full profile & all calculators by Becker →