Magnetic Field of a Straight Wire Calculator

Quick answer

The magnetic field of a straight wire calculator finds the magnetic flux density at a distance from a long straight wire carrying a current.

Magnetic field B
20
Compared with Earth's field (≈ 50 µT)
40 %

Current in a wire creates circular magnetic field lines around it. A 10 A cable produces 20 µT at 10 cm – about half of Earth’s field – which is why compasses misbehave near power cables.

How to use the Magnetic Field of a Straight Wire Calculator

  1. Current I
  2. Distance from the wire d

Results update as you type, every field has its own unit menu, and everything is calculated in your browser.

How it works

Enter the current and the distance from the wire.

Inputs explained

Field What to enter
Current I Units: A, mA, µA, kA
Distance from the wire d Units: cm, mm, m, in, ft

What each result means

  • Magnetic field B = 1.25663706212e-06×[Current I]÷(2×pi×[Distance from the wire d])
  • Compared with Earth’s field (≈ 50 µT) = [Magnetic field B]÷50e-6×100

Example values

How the main result changes when Current I changes and everything else stays at the example values above:

Current I (A) Magnetic field B (µT)
5 10
7.5 15
10 20
12.5 25
15 30
20 40

Formula

B = μ₀·I / (2π·d)

Worked example

Inputs — Current I: 10 A; Distance from the wire d: 10 cm.
Results — Magnetic field B = 20 µT; Compared with Earth's field (≈ 50 µT) = 40 %.

Key terms

Tesla
SI unit of magnetic flux density.

Frequently asked questions

Which way do the field lines go?

Circles around the wire – use the right-hand grip rule.

Why does a two-core cable produce little field?

The opposite currents cancel each other.

How does the field change with distance?

It falls as 1/d.

Is the formula valid near the wire's ends?

No – it assumes an infinitely long wire.

Sources

  1. OpenStax – University Physics Volume 2
  2. HyperPhysics (Georgia State University)

Cite this calculator

Speedy Calculator. (2026). Magnetic Field of a Straight Wire Calculator. Speedy Calculator. https://speedycalculator.com/calculators/physics/magnetic-field-of-straight-current-carrying-wire/