StatGardenREF. DESK
Calculators/Physics/Magnetic field of a straight wire
Physics

Magnetic field of a straight wire calculator

Field strength at a distance from a long straight wire, from Ampère's law.

Published 6 August 2026 · Updated 21 September 2026

What this calculator does

A current flowing through a wire creates a magnetic field that circles around it. The field strength is proportional to the current and falls off with distance, though only with distance itself rather than its square, which is a consequence of the wire being a line rather than a point.

The field from ordinary household wiring is small, typically measured in microtesla. For comparison, Earth's own magnetic field is around 50 microtesla, so a 10 amp current at 5 centimetres produces a field of similar order to the planet's.

The formula

FormulaB = μ₀I/(2πr), μ₀ = 1.25663706212×10⁻⁶ N/A²

Multiply the permeability of free space by the current, then divide by two π times the distance from the wire. The result is in tesla, converted to millitesla and microtesla alongside since those are more practical units here.

TermMeaning
Tesla (T)The SI unit of magnetic flux density. A very large unit: an MRI scanner runs at a few tesla, while everyday fields are millionths of one.
Permeability of free space (μ₀)The constant 1.2566 × 10⁻⁶ N/A² relating current to the magnetic field it produces.
Ampère's lawThe relationship that gives the field around a current, of which this straight-wire case is the simplest example.

The inputs explained

FieldWhat to enter
Current (A)The current flowing in the wire, in amps.
Distance from the wire (m)The perpendicular distance from the centre of the wire, in metres.

When to use it

Estimating field near household wiring

A known current and distance give the field, which can be compared against Earth's field for a sense of scale.

Checking interference with a sensitive instrument

Magnetometers and some sensors are affected by nearby currents, and this gives the size of the effect.

Working through an electromagnetism problem

The straight wire is the standard first application of Ampère's law in any course.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does the field grow with current at a fixed distance?

A range of currents measured at the same distance.

Distance fixed at 5 cm from the wire
CurrentMagnetic field (µT)Field at double the distance
5 A20.000 µT0.00001000 T
10 A40.000 µT0.00002000 T
20 A80.000 µT0.00004000 T
40 A160.000 µT0.00008000 T
The field is directly proportional to current: 10 A gives 40 µT at 5 cm, and 40 A gives 160 µT, four times as much. Doubling the distance always halves the field, since the relationship is inverse in distance rather than inverse square.

Questions

Which way does the field point?

It circles the wire. Point the right thumb along the direction of conventional current and the fingers curl the way the field goes, which is the standard right-hand grip rule.

Why is this inverse distance rather than inverse square?

Because a long wire is a line source rather than a point. The field spreads over the surface of a cylinder, whose area grows in proportion to radius rather than radius squared.

How does this compare with Earth's magnetic field?

Earth's field is roughly 25 to 65 microtesla depending on location. A 10 amp current at 5 centimetres produces about 40 microtesla, so the two are comparable at close range, though the wire's field drops away far more quickly.

Does the calculation hold near the ends of a wire?

No. It assumes an infinitely long straight wire, which is a good approximation when the distance is small compared with the wire's length. Near the ends, or for a coil, a different treatment is needed.

For the electric counterpart, see the electric field of a point charge calculator. For energy stored in a coil's magnetic field, see the inductor stored energy calculator.