Magnetic Field of a Straight Wire Calculator

Enter the current and distance to find the magnetic field.

How it is calculated

The tool applies the field of an infinitely long straight wire: B = μ0 × I ÷ (2π × r), with μ0 = 4π × 10-7 T·m/A. The current I is entered in amperes and the distance r from the wire's centre line in millimetres; the tool converts r to metres before calculating. The result is given in tesla in scientific notation, then as microtesla (B × 106) and gauss (B × 104). The distance must be above zero. Current may be any number; a negative current just reverses the field direction, so the answer comes out negative. The formula assumes a long wire in air or vacuum and no other currents or magnetic materials nearby; near the ends of a short wire, or inside the conductor itself, it does not apply.

Worked example

A wire carries 10 A and you want the field 50 mm from it. Convert the distance: 50 mm = 0.05 m. Since μ0 ÷ (2π) = 2 × 10-7, B = 2 × 10-7 × 10 ÷ 0.05 = 4 × 10-5 T. The tool displays 4.0000 × 10⁻⁵ T, which equals 40.0000 µT or 0.4000 G. Doubling the distance to 100 mm would halve the field to 20 µT.

Try this example →

Common mistakes

  • Entering the distance in metres or centimetres. The field is in millimetres, so 5 cm must be typed as 50; typing 0.05 treats it as 0.05 mm and gives a field 1,000 times too strong.
  • Measuring from the wire's surface instead of its centre. The formula uses the distance to the axis, so add half the wire's diameter for thick conductors.
  • Reading the tesla value as a plain decimal. 4.0000 × 10⁻⁵ T means 0.00004 T, not 4 T.
  • Confusing µT with gauss. 1 gauss is 100 µT, so 40 µT is 0.4 G; compare numbers in the same unit.
  • Using the result for a wire loop, a coil or a very short wire. The formula describes a long straight conductor only; coils and loops need different equations.

About this calculator

Ampère's law shows that a long, straight wire carrying a steady electric current generates a magnetic field that circles the wire, with a strength given by B = μ₀I/(2πr), where I is the current, r is the distance from the wire, and μ₀ is the permeability of free space. The field is strongest close to the wire and weakens in inverse proportion to distance.

This calculator computes that flux density in tesla, along with the more practically-sized microtesla and gauss units, from any current and distance you enter. It's a foundational formula in introductory electromagnetism courses, used to build intuition before tackling solenoids and Biot–Savart law problems, and it's also applied by electrical engineers estimating stray magnetic fields near power cables or busbars for safety and interference assessments.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    For scale, 100 A at 50 mm from the axis gives 4.0000 × 10⁻⁴ T, which the tool also shows as 400.0000 µT and 4.0000 G. That is a single conductor on its own. In an ordinary cable the current goes out and comes back, so the two fields largely cancel and the real field outside is much smaller than this figure. Do you want to compare it with a particular appliance or cable layout? Post the current and distance you used.

Popular calculators

All Calculators