Straight Wire Magnetic Field Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/9/2026

The magnetic field created by an infinite straight wire is calculated with B = μ₀ × I ÷ (2π × r), where μ₀ is the permeability of free space, I the current, and r the distance from the wire. A wire carrying 10 A creates a field of about 40 µT at 5 cm.

Explanation

Any electric current flowing through a conducting wire creates a magnetic field around it, a central phenomenon in electromagnetism discovered by Hans Christian Ørsted in 1820. For a sufficiently long straight wire (ideally infinite, an approximation valid as long as you stay close to the wire relative to its total length), this magnetic field forms concentric circles around the wire, its intensity decreasing with the inverse of the distance r — twice as far from the wire, the field is half as strong, a slower decay than that of a point electric charge's field (which decreases as 1/r²). The direction of this circular field is determined with the right-hand rule: with the thumb pointing in the direction of the current, the fingers indicate the direction the magnetic field wraps around the wire. This same formula, applied to a solenoid made of many turns rather than a single straight wire, produces a much stronger and, above all, uniform magnetic field inside the coil — winding a conducting wire is precisely what multiplies the magnetic effect of each individual segment. This field created by the wire itself is also what, in the presence of a second current-carrying conductor, generates a force between the two — a magnetic interaction fundamentally different from the electrostatic force between charges described by Coulomb's law, which requires no motion at all. The value B=2×10⁻⁷ T obtained for 1 A at 1 m distance is, in fact, historically tied to the very definition of the ampere, before its modern redefinition based on the elementary charge.

Example: a wire carrying 10 A, at 5 cm distance

Inputs

Current: 10 A. Distance from the wire: 0.05 m (5 cm).

Calculation

B = (0.0000012566370614 × 10) ÷ (2 × π × 0.05) ≈ 0.00004 T, or about 40 µT.

Result

At 5 cm from this wire carrying 10 A, the magnetic field measures about 40 microteslas — comparable in order of magnitude to Earth's magnetic field (about 25 to 65 µT depending on latitude).

Frequently asked questions

Why does the field decay as 1/r rather than 1/r² like a point electric charge?

Because the geometry is different: a point electric charge creates a field that spreads in every direction of space (a sphere, whose surface grows as r²), while an infinite straight wire creates a field that spreads only around a cylinder (whose circumference grows only as r, not r²). This difference in propagation geometry directly explains the difference in decay between the two types of field.

Does this formula apply to a wire of finite length?

This formula assumes an infinitely long wire, an approximation that remains excellent as long as the distance r from the wire is small compared with its actual length. For a short wire, or for a distance comparable to its length, the full Biot-Savart formula must be used, which accounts for the wire's exact geometry and gives a weaker field, especially near the ends.

How do you determine the direction of the magnetic field around the wire?

The right-hand rule gives this direction directly: by pointing the right thumb in the direction of the electric current, the other fingers naturally curl in the direction the magnetic field wraps around the wire, forming concentric circles perpendicular to the wire itself.

Related resources