Calculate current, distance, or magnetic field around a wire with Ampere’s law by entering any two values in preferred units and see steps.

Ampere’s Law Calculator

Enter any 2 values to calculate the missing variable


Related Calculators

Ampere’s Law Formula

This calculator uses the magnetic field formula for a long, straight current-carrying wire. It is a common result from Ampere’s law.

B = (μ₀ I) / (2π r)
I = (B × 2π r) / (μ₀)
r = (μ₀ I) / (2π B)
  • B = magnetic field strength, in teslas (T)
  • I = electric current through the wire, in amperes (A)
  • r = distance from the center of the wire, in meters (m)
  • μ0 = permeability of free space, equal to 4π × 10-7 T·m/A
  • π = pi, approximately 3.14159

If you enter current and distance, the calculator solves for the magnetic field. If you enter magnetic field and distance, it solves for current. If you enter current and magnetic field, it solves for distance from the wire. Unit selections are converted to base SI units first, then the result is converted back to the unit you selected.

Supported Unit Conversions

The formula is evaluated in amperes, meters, and teslas. These conversions are applied before and after the calculation.

Quantity Unit Base-unit conversion
Current mA 1 mA = 0.001 A
Current kA 1 kA = 1000 A
Distance cm 1 cm = 0.01 m
Distance mm 1 mm = 0.001 m
Distance in 1 in = 0.0254 m
Distance ft 1 ft = 0.3048 m
Magnetic field G 1 G = 0.0001 T

Magnetic Field Values Around a Straight Wire

Current Distance from wire Magnetic field
1 A 0.1 m 2.0 × 10-6 T
5 A 0.1 m 1.0 × 10-5 T
10 A 0.05 m 4.0 × 10-5 T
100 A 0.1 m 2.0 × 10-4 T

Example Calculations

Example 1: Find the magnetic field

Suppose a straight wire carries a current of 10 A, and you want the magnetic field 0.05 m from the wire.

B = ((4π × 10⁻⁷)(10)) / (2π(0.05))
B = 4.0 × 10⁻⁵ T

The magnetic field is 0.00004 T, which is also 0.4 G.

Example 2: Find the current

Suppose the magnetic field is 0.00002 T at a distance of 0.1 m from a straight wire.

I = ((0.00002)(2π)(0.1)) / (4π × 10⁻⁷)
I = 10 A

The current in the wire is 10 A.

FAQ

What form of Ampere’s law does this calculator use?

It uses the long, straight wire result: B = μ0I/(2πr). This assumes the wire is very long compared with the distance where the field is measured, and that the current is steady.

Why does the magnetic field decrease as distance increases?

For a straight wire, the magnetic field is inversely proportional to distance. If you double the distance from the wire, the magnetic field becomes half as large, assuming the current stays the same.

Can distance be zero?

No. The formula divides by distance, so r = 0 is not valid. In real wires, the field inside the conductor depends on the wire radius and current distribution, which is not handled by this calculator.