Skip to content
Physics

Magnetic Field of a Straight Current-Carrying Wire Calculator

Enter the current flowing through a long, straight wire and the perpendicular distance from the wire to find the magnetic field strength at that point. The calculator uses the Ampere / Biot-Savart formula B = mu_0 * I / (2 * pi * r). You can also solve in reverse: provide B and r to find the required current, or provide B and I to find the distance at which that field occurs. Switch freely between SI and practical units; all conversions happen automatically.

Your details

Choose which quantity to calculate. Provide the other two as inputs.
SI uses amperes, metres, and tesla. Practical uses amperes, centimetres, and millitesla.
Electric current flowing through the wire in amperes.
A
Perpendicular distance from the centre of the wire to the point where you want to know B.
m
Magnetic field (B)
0

Field strength at the specified distance from the wire

Magnetic field400.0000 nT
Required current (I)-
Distance (r)-
Compared to Earth's field0.01
Field directionUse the right-hand rule: curl your right-hand fingers around the wire with your thumb pointing in the current direction; your fingers indicate the field circulation direction.
0.01 x Earth B
Sub-geomagnetic<0.1Near Earth field0.1-110x Earth field1-10100x Earth field10+
00011325
Distance from wire (m)

At 5 m from a 10 A wire, B = 400.0000 nT

  • This field is about 125 times weaker than Earth's surface field. It would be difficult to measure without sensitive instrumentation.
  • Field strength falls off inversely with distance (1/r). Doubling the distance from the wire halves B; halving the distance doubles B.

Next stepTo reverse-solve - for example, to find the current needed to produce a given field at a known distance - switch the 'Solve for' selector to 'Current I'.

Formula

B=μ0I2πr,μ0=4π×107  Tm/AB = \dfrac{\mu_0 \, I}{2\pi r}, \quad \mu_0 = 4\pi \times 10^{-7}\;\text{T}\cdot\text{m/A}

Worked example

A wire carries 10 A. At r = 5 cm = 0.05 m: B = (4*pi*10^-7 * 10) / (2*pi*0.05) = (1.257e-5) / (0.3142) = 4.0e-5 T = 40 uT, about 0.8x Earth's surface field.

The physics: how a wire creates a magnetic field

When electric current flows through a conductor, it produces a magnetic field in the surrounding space. For a long, straight wire this was first described mathematically through the Biot-Savart law and then more elegantly summarised by Ampere's circuital law. The magnetic field lines form concentric circles centred on the wire, lying in planes perpendicular to the wire. The direction of circulation follows the right-hand rule: point your right thumb in the direction of conventional current flow and your curled fingers show which way B circulates around the wire. Field strength is directly proportional to the current (double I, double B) and inversely proportional to the radial distance (double r, halve B). This 1/r dependence distinguishes a straight wire from a magnetic dipole (which falls off as 1/r^3) or a solenoid (nearly uniform field inside, rapidly decaying outside).

The formula: Ampere's law for an infinite straight wire

Using Ampere's law with a circular Amperian loop of radius r centred on the wire gives B = mu_0 * I / (2 * pi * r), where mu_0 = 4*pi * 10^-7 T*m/A is the permeability of free space. This formula assumes the wire is infinitely long (or at least very long compared to r) and carries a uniform, steady current I. For a wire of finite length, the field at a perpendicular distance r from the midpoint is B = (mu_0 * I) / (4 * pi * r) * (sin(theta_1) + sin(theta_2)), where theta_1 and theta_2 are the angles subtended by each end from the field point. As the wire becomes much longer than r, both angles approach 90 degrees, and the finite formula reduces to the standard infinite-wire result.

Real-world applications

Straight-wire magnetic fields appear throughout electrical engineering and physics. Power engineers must consider magnetic fields near transmission lines and cables to assess interference with sensitive equipment and comply with exposure guidelines. PCB designers route return currents alongside signal traces to minimise the net magnetic field (reducing EMI). Magnetometers used in navigation and geology exploit the fact that any current-carrying conductor creates a measurable B field. In fundamental physics, the force between two parallel wires carrying currents was historically used to define the ampere - and the formula for that force is directly derived from the magnetic field of a straight wire. Understanding this simple geometry is also the first step toward analysing more complex geometries like toroids, solenoids, and Helmholtz coils.

Assumptions and limitations

The B = mu_0 * I / (2 * pi * r) formula rests on three key assumptions. First, the wire must be straight and effectively infinite in length (or the observation point must be close to the midpoint of a long wire with r much smaller than the wire's half-length). Second, the current must be steady (DC). For alternating currents, the time-varying field generates a displacement current and the full Maxwell's equations are needed; at low frequencies the quasi-static approximation holds and the formula still gives a good estimate. Third, the formula gives the field outside the wire. Inside a solid conductor of radius a, the field grows linearly with radius: B = mu_0 * I * r / (2 * pi * a^2). For hollow conductors (co-axial cables), the interior field depends on whether you are inside the inner conductor, between conductors, or outside both.

Typical magnetic fields for reference

SourceTypical B (Tesla)Notes
Earth's surface field~5 x 10^-5 T (50 uT)Varies by latitude and location
Household wiring (at 1 cm)~0.1 uT to 10 uTDepends on load current 1-100 A
Refrigerator magnet~5 mTNear the magnet surface
MRI machine1.5 to 7 TClinical scanners
Strong lab electromagnet1 to 2 TIron-core electromagnet
Neodymium permanent magnet~1 T (surface)Near the pole face
Lightning strike (at 1 m)~10 mTBrief transient pulse
High-voltage power line (at 1 m)~10 to 100 uTDepends on current load

Approximate values for common sources and environments.

Frequently asked questions

What is the formula for the magnetic field around a straight wire?

B = mu_0 * I / (2 * pi * r), where mu_0 is the permeability of free space (4*pi * 10^-7 T*m/A), I is the current in amperes, and r is the perpendicular distance from the wire in metres. The result is the magnetic field strength in tesla at that point.

In which direction does the magnetic field point around a straight wire?

The field forms concentric circles centred on the wire. The direction follows the right-hand rule: wrap your right-hand fingers around the wire with the thumb pointing in the direction of conventional (positive) current flow. Your fingers curl in the direction of the magnetic field lines. Reversing the current reverses the field direction.

How does the magnetic field change with distance from the wire?

The field falls off inversely with distance (B proportional to 1/r). If you double your distance from the wire, the field halves. If you move three times farther away, the field drops to one-third. This is a much slower fall-off than a magnetic dipole (which falls as 1/r^3), which is why transmission-line fields can be detected at considerable distances.

What current would produce a field equal to Earth's magnetic field at 1 cm from a wire?

Earth's surface field is approximately 5 * 10^-5 T. Rearranging the formula: I = B * 2 * pi * r / mu_0 = (5e-5 * 2 * pi * 0.01) / (4*pi * 10^-7) = 2.5 A. So about 2.5 amperes through a straight wire produce a field equal to Earth's field at a distance of 1 cm. Use the 'Solve for Current' mode in this calculator to confirm.

Does the formula work inside the wire too?

No. B = mu_0 * I / (2 * pi * r) applies outside a solid cylindrical conductor. Inside the conductor (assuming uniform current density), Ampere's law gives B = mu_0 * I * r / (2 * pi * a^2), where a is the wire's radius. The field inside grows linearly from zero at the centre to its maximum value at the surface, then falls off as 1/r outside.

What is the difference between this calculator and a solenoid calculator?

A straight wire produces circular field lines with 1/r dependence. A solenoid (many loops of wire wound in a helix) concentrates the field inside the coil where it is approximately uniform and much stronger (B = mu_0 * n * I, where n is turns per metre). Outside a long solenoid the field is nearly zero. Use a solenoid calculator when you need a strong, uniform field in a region of space.

Does alternating current (AC) affect the formula?

At power-line frequencies (50 or 60 Hz) and for typical distances, the quasi-static approximation holds and B = mu_0 * I / (2 * pi * r) gives a good estimate of the peak field when you substitute the peak current. The field oscillates at the same frequency as the current. At radio frequencies, radiation effects and skin depth in the conductor become important, and the simple formula breaks down.

Sources

Written by Dr. Tomás Okafor, PhD Physicist · Lagos, Nigeria

Physicist specializing in classical mechanics, bringing 17 years of research and applied dynamics expertise to every calculator he reviews.

Search 3,500+ calculators

Loading search…