Magnetic Field of a Straight Current-Carrying Wire Calculator

Enter the current and the perpendicular distance from a long, straight wire to find the magnetic field strength using Ampere's law, B = μ₀I / (2πr).

Quick Facts

Ampere's law (straight wire)
B = μ₀I / (2πr)
Valid for an infinitely long, straight conductor; a good approximation at points close to the wire.
Permeability of free space
μ₀ = 4π × 10⁻⁷ T·m/A
≈ 1.2566 × 10⁻⁶ T·m/A; used for air and vacuum (μr = 1).
Field falls off as 1/r
Not 1/r²
Doubling the distance from the wire halves the field — the source is a line, not a point.
Field direction
Right-hand rule
Thumb points along conventional current; curled fingers show the field circling the wire.

Your Results

Calculated
Magnetic Field (B)
-
In microtesla (µT)
Magnetic Field (Tesla)
-
SI unit, B = μ₀I / (2πr)
Magnetic Field (Gauss)
-
1 T = 10,000 G
Vs. Earth's Field
-
Compared to ~50 µT surface average

Ready

Enter a current and distance from the wire, then press Calculate.

How to use the Magnetic Field of a Straight Current-Carrying Wire Calculator

A current flowing through a long, straight wire creates a magnetic field that circles the wire in concentric loops. Ampere's law gives the field strength at any perpendicular distance from the wire: B = μ₀I / (2πr), where B is the magnetic flux density in tesla, I is the current in amperes, r is the perpendicular distance from the wire in meters, and μ₀ is the permeability of free space (4π × 10⁻⁷ T·m/A ≈ 1.2566 × 10⁻⁶ T·m/A). This calculator converts your current and distance to SI units, applies the formula, and reports the result in tesla, microtesla, and gauss.

Deriving and applying the formula

  • Ampere's law: integrating the magnetic field around a circular loop of radius r centered on the wire gives ∮B·dl = μ₀I_enclosed. Because B is constant in magnitude around that loop, this simplifies to B(2πr) = μ₀I, or B = μ₀I / (2πr).
  • Medium matters: μ₀ is the permeability of vacuum (air is close enough for everyday use). If the wire runs through a magnetic material, multiply by that material's relative permeability μr — use the optional field above (leave at 1 for air or vacuum).
  • Right-hand rule: point your right thumb along the direction of conventional current flow; your curled fingers show the direction the field circles the wire at every point around it.
  • Unit conversions: 1 tesla (T) = 10⁶ microtesla (µT) = 10,000 gauss (G). Fields near household wiring are typically a few microtesla; Earth's surface field averages roughly 25–65 µT.

Practical notes and limits

  • This formula assumes an infinitely long, thin, straight wire. It is an excellent approximation when the distance r is small compared to the wire's length and you are not near its ends.
  • The field strength depends only on distance from the wire's axis, not on which side you measure from — the field lines form perfect circles around a straight conductor.
  • For two parallel wires, the total field at a point is the vector sum of each wire's individual field — direction, not just magnitude, matters when combining sources.
  • Multi-turn coils and solenoids use different formulas (Biot-Savart integrated over the coil geometry); this calculator applies specifically to a single straight conductor.

Frequently Asked Questions

What is the formula for the magnetic field around a straight wire?
For an infinitely long, straight conductor, Ampere's law gives B = μ₀I / (2πr), where B is the magnetic flux density in tesla, μ₀ is the permeability of free space (4π × 10⁻⁷ T·m/A), I is the current in amperes, and r is the perpendicular distance from the wire in meters.
Which direction does the magnetic field point?
The field forms concentric circles around the wire. Use the right-hand rule: point your thumb in the direction of conventional current flow, and your curled fingers show the direction the field circles the wire.
Why does distance matter so much?
The field falls off as 1/r, not 1/r² as with a point charge, because the source is a line, not a point. Doubling your distance from the wire halves the field strength; moving to 10× the distance drops it to one-tenth.
Does the medium around the wire change the result?
Yes. The μ₀ in the formula applies to a vacuum (air is close enough for most purposes). If the wire passes through a magnetic material, multiply by that material's relative permeability μr — this calculator includes a field for it, with a default of 1 for air or vacuum.