Skip to main content
Calcimator

Magnetic Field Calculator

Calculate the magnetic field strength (B) for a straight wire, solenoid, or circular loop using Biot-Savart and Ampere's law.

About this calculator

This calculator switches between three classic current-carrying-conductor geometries, each with its own formula derived from Ampere's law. For an infinite straight wire (geometry 1), it uses B = μ₀I/(2πr), where the field forms circles around the wire and falls off in simple inverse proportion to distance. For a solenoid (geometry 2), it uses B = μ₀(N/L)I — the "distance" input is repurposed as the coil's length, so the field depends on turns-per-unit-length rather than on distance from anything, reflecting the fact that the field inside an ideal long solenoid is uniform and doesn't diminish with position inside the coil. For a circular loop measured at its center (geometry 3), it uses B = μ₀NI/(2R), where "distance" becomes the loop's radius.

In all three cases μ₀ is the permeability of free space, 4π×10⁻⁷ T·m/A. Because the raw result in tesla is often a very small or very large number, the calculator automatically rescales the displayed units to nanotesla, microtesla, or millitesla so the figure stays readable — Earth's own field, for comparison, is roughly 25–65 μT. The most common input mistake is treating "distance" the same way across geometries: it means perpendicular distance from the wire for the straight-wire case, but total coil length for a solenoid and loop radius for a circular loop — mixing these up produces a field that's off by orders of magnitude rather than merely inaccurate. The turns input only matters for the solenoid and loop cases; it's ignored for a straight wire, which has no windings.

Inputs

A
ft

Results

Magnetic Field Strength

10

UnitμT
Formula UsedB = μ₀I / (2πr)
How to Use This Calculator
  1. Enter Current, Distance / Length / Radius, and Geometry.
  2. Set Number of Turns.
  3. Review the Magnetic Field Strength result.
  4. Use Unit and Formula Used to inform your decision.
  5. Use the chart to visualize the results and explore different scenarios by adjusting inputs.

How the result changes with Distance / Length / Radius

Distance / Length / RadiusMagnetic Field Strength
0.0520
0.0813.33
0.156.67
0.254

What each input means

Current
Electric current flowing through the conductor in amperes.
Distance / Length / Radius
For wire: distance from wire. For solenoid: length. For loop: radius.
Geometry
1 = Infinite straight wire, 2 = Solenoid (uses turns & length), 3 = Circular loop (uses turns & radius).
Number of Turns
Number of turns (only used for solenoid and loop geometries).

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Current = 5, Distance / Length / Radius = 0.1, Geometry = 1, Number of Turns = 100 = 4 input(s) provided
  2. Calculate Magnetic Field Strength
    10 = 10
  3. Calculate Unit
    Unit = displayUnit
    μT = μT
  4. Calculate Formula Used
    Formula Used
    B = μ₀I / (2πr) = B = μ₀I / (2πr)

Engine last updated . Checked against 1 independently-derived test — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does the 'Distance / Length / Radius' input mean something different for each geometry?

The three formulas each use that number in a physically different role: for the straight wire it's the perpendicular distance r from the wire (B = μ₀I/2πr), for the solenoid it's the coil's total length L used to derive turns-per-length n = N/L (B = μ₀nI), and for the circular loop it's the loop's radius R (B = μ₀NI/2R). Reusing one input field keeps the form simple, but entering a solenoid's length where you meant a loop's radius (or vice versa) will scale the result by whatever ratio those two numbers differ by.

Why is the 'Number of Turns' input ignored for the straight wire option?

An infinite straight wire has no windings — Ampère's law for it, B = μ₀I/(2πr), depends only on current and distance — so the engine's straight-wire branch never reads the turns value at all. Turns only enters the calculation in the solenoid branch (as part of n = N/L) and the loop branch (as a direct multiplier N in B = μ₀NI/2R).

Why does the displayed unit change between nT, μT, and mT?

Raw magnetic field results in tesla are often tiny for everyday currents and distances, so the engine automatically checks the computed field magnitude and rescales it: below 1 μT it displays nanotesla, below 1 mT it displays microtesla, and below 1 T it displays millitesla, always converting the underlying tesla value by the matching power of ten. This keeps the headline number in an easily readable range rather than forcing you to read a string of leading zeros.

How strong is a typical result compared to something familiar, like Earth's magnetic field?

Earth's own field at the surface is roughly 25–65 μT, which the explainer text calls out for scale. A solenoid or wire carrying an ordinary current at a reasonable distance often lands in the same μT-to-mT range, while a tightly wound solenoid with many turns and a short length can reach much higher milliteslas — comparing your result against that 25–65 μT benchmark is a quick sanity check on whether an input like distance or turns was entered in the wrong unit.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Science & Physics.