MAGNETIC FIELD OF A WIRE CALCULATOR

Magnetic field of a wire

Enter the current and distance, get the magnetic field.

A

How strong is the field around a wire?

For a long straight wire, B = μ₀I ÷ (2πr), where I is the current and r the distance from the wire (OpenStax University Physics). The field circles the wire; the right-hand rule gives its direction.

Example

A 2 A current produces 4 × 10⁻⁵ T (40 μT) at 1 cm from the wire. Twice as far away, the field is half as strong.

What value of μ₀ is used?

μ₀ = 1.25663706127 × 10⁻⁶ N/A², the CODATA 2022 value. It differs from the old exact 4π × 10⁻⁷ by about one part in ten billion.

What is a gauss?

An older unit of magnetic field still common in everyday use: 1 tesla = 10,000 gauss. The calculator shows tesla, microtesla and gauss.

Does the formula work near the end of a wire?

It assumes a very long, straight wire compared with the distance. Near bends, ends or coils, the field is different.

How does the field of a wire compare with the Earth’s field?

NOAA gives the Earth’s main magnetic field as typically 20,000 to 60,000 nT, which is 20 to 60 µT, or 0.2 to 0.6 gauss. A wire carrying 20 A produces 50 µT at a distance of 8 cm, inside that range. The 157 µT found 1 inch from the wire in the example below is therefore a few times the Earth’s field.

How do I find the direction of the field?

Use the right-hand rule: point your right thumb along the current, and your fingers curl in the direction of the field. The field lines are circles centered on the wire, in planes perpendicular to it (OpenStax University Physics, Volume 2, section 12.2).

What current gives a particular field at a distance?

Solve B = μ₀I ÷ (2πr) for the current: I = 2πrB ÷ μ₀. To get 1 gauss (100 µT) at 5 cm from a long straight wire you need I = 2π × 0.05 × 0.0001 ÷ μ₀ = 25.0 A.

The formula and what it assumes

The field a distance r from a long straight wire carrying current I is B = μ₀I ÷ (2πr) (OpenStax University Physics, Volume 2, section 12.2, Eq. 12.8, derived from the Biot–Savart law). It is proportional to the current and inversely proportional to the distance. OpenStax assumes the wire is infinitely long, so the result holds well away from the ends, bends and coils. Since μ₀ ÷ 2π is very close to 2.0000 × 10⁻⁷ T·m/A, a quick estimate is B ≈ 2 × 10⁻⁷ × I ÷ r in tesla, with I in amperes and r in meters.

Worked example: 20 A, one inch away

Convert the distance: 1 in = 0.0254 m. Then B = μ₀ × 20 ÷ (2π × 0.0254) = 157.5 µT, which is 1.57 gauss. At 10 inches the field is ten times weaker, 15.7 µT. As a check against OpenStax Example 12.3, 2 A at 1 cm gives 4 × 10⁻⁵ T (40 µT).

Common mistakes

Use the distance from the center of the wire, perpendicular to it, not from the insulation surface or along the wire. Do not mix the units of field: 1 tesla is 10,000 gauss, so 50 µT is 0.5 gauss, not 5. And remember the single-wire assumption. The field of several wires is the vector sum of their separate fields, as in OpenStax Example 12.3; two wires carrying equal currents in opposite directions, as in a typical two-conductor cable, largely cancel each other at distances much greater than their spacing, so one wire’s formula greatly overstates the field there.

Sources: OpenStax University Physics, Volume 2, section 12.2 (magnetic field due to a thin straight wire, Eq. 12.8; Example 12.3); μ₀ from CODATA 2022 (NIST), where OpenStax uses 4π × 10⁻⁷ T·m/A; the gauss is exactly 10⁻⁴ tesla (NIST SP 811, Appendix B.8); the Earth’s field range is from NOAA’s World Magnetic Model page. Related: Coulomb’s law calculator, Ohm’s law calculator, wire size calculator and watts to amps calculator.