DEV Community

Cover image for The Biot-Savart Law: Calculating the Magnetic Field of Any Current
NovaSolver
NovaSolver

Posted on • Originally published at novasolver.jp

The Biot-Savart Law: Calculating the Magnetic Field of Any Current

Hold a compass near a wire carrying current and the needle swings. That small deflection, first noticed by Oersted in 1820, was the spark that linked electricity and magnetism for good. Within months, two French physicists — Jean-Baptiste Biot and Felix Savart — had turned the observation into something quantitative: a precise rule for how much magnetic field a current produces, and in which direction. Two centuries later, that rule is still the foundation under every magnetic field calculation in engineering.

This article explains what the Biot-Savart law says, how it collapses into a simple formula for the most common geometry, and how to use it with confidence.

Why this calculation matters

Magnetic fields from currents are everywhere in engineering, and most of them are not produced by neat textbook shapes. Power cables, busbars, motor windings, transformer coils, printed circuit traces, and signal cables all generate fields that affect nearby equipment. The Biot-Savart law is the tool that lets you predict those fields from the geometry of the conductor alone.

The applications run in two directions. Sometimes you want the field — to design an electromagnet, a coil, or a magnetic sensor. Other times you want to control or minimise it: keeping a high-current cable far enough from a sensitive instrument, or arranging conductors so their fields cancel. Electromagnetic compatibility work leans heavily on this. In every case, the Biot-Savart law is the starting equation, and the more specialised results — the field of a solenoid, of a coil, of a loop — are all derived from it.

The core method

The Biot-Savart law gives the magnetic field contribution from a tiny element of current. Each short segment of wire, carrying current I over a length dl, produces a small piece of field dB at a point in space. The law states that this contribution is proportional to the current, falls off as the inverse square of the distance, and points perpendicular to both the current direction and the line to the observation point.

In words rather than vector calculus: add up the contributions from every segment of the conductor, and you get the total field. That summation — an integral over the whole current path — is the general method. For complicated geometries it is done numerically, but for several important shapes it can be solved exactly.

The most useful exact result is the field around a long straight wire. Carrying out the integration along an infinitely long conductor gives a clean formula:

B = mu_0 * I / (2 * pi * r)
Enter fullscreen mode Exit fullscreen mode

Here B is the magnetic flux density in tesla, mu_0 is the permeability of free space (4 * pi * 1e-7 H/m), I is the current in amperes, and r is the perpendicular distance from the wire. The field circles the wire — its direction is given by the right-hand rule, with the thumb along the current and the fingers curling the way B points.

Two features are worth fixing in mind. The field falls off as 1/r, not 1/r squared, because a long straight wire is effectively a line of sources rather than a point. And the field depends only on the enclosed current and the distance — the wire's thickness and the rest of the circuit do not enter, as long as the straight-wire approximation holds.

A worked example

Take a long straight wire carrying a current of I = 10 A. Find the magnetic field at a perpendicular distance of r = 0.05 m (5 cm) from the wire.

Step 1 — write down the formula.

B = mu_0 * I / (2 * pi * r)
Enter fullscreen mode Exit fullscreen mode

Step 2 — substitute the values.

B = (4 * pi * 1e-7 * 10) / (2 * pi * 0.05)
B = 1.2566e-5 / 0.31416
B = 4.0e-5 T
Enter fullscreen mode Exit fullscreen mode

So the field 5 cm from a 10 A wire is about 40 microtesla. That figure is worth holding onto, because it is comparable to the strength of the Earth's own magnetic field at the surface — roughly 25 to 65 microtesla depending on location. A perfectly ordinary current, at a hand's-width distance, produces a field of the same order as the planet's.

The 1/r dependence also tells you how the field changes as you move. Step out to 10 cm and the field halves to about 20 microtesla; move in to 2.5 cm and it doubles to about 80 microtesla. There is no sudden cut-off — just a steady, predictable decline with distance.

Common mistakes

Assuming an inverse-square law. The field of a point source falls as 1/r squared, but the field of a long straight wire falls as 1/r. Using the wrong power overstates how quickly the field fades and can lead to underestimating interference at a distance.

Applying the straight-wire formula to short wires. B = mu_0 * I / (2 * pi * r) assumes a wire much longer than the distance r. Near the end of a short conductor, or close to a bend, the full Biot-Savart integral is needed and the simple formula no longer holds.

Losing track of direction. Biot-Savart gives a vector, not just a magnitude. The field encircles the wire, and when several conductors are present their field vectors must be added head to tail — not as plain numbers. Two parallel wires can reinforce or partly cancel depending on their current directions.

Confusing B and H. The Biot-Savart law as written here gives the magnetic flux density B in tesla. The magnetic field strength H differs by a factor of the permeability. Mixing the two scrambles the units.

Forgetting the medium. The formula uses mu_0, the permeability of free space, which is fine for air. Inside or near a ferromagnetic material the effective permeability is far larger, and the field is correspondingly different.

Try the interactive NovaSolver calculator

The straight-wire formula is one slice of the Biot-Savart law; the circular current loop is another, and seeing how its field varies along the axis builds real intuition. The Biot-Savart Law Simulator on NovaSolver computes the on-axis magnetic flux density of a circular current loop in real time. You set the current, the loop radius, the axial position, and the number of turns, and it returns the field B(z), the center field B(0), the ratio B(z)/B(0), and the half-width, alongside a 3D view of the loop and the bell-shaped field profile.

Related calculators

You can browse the full set in the electromagnetics tools hub.

Closing note

The Biot-Savart law is the bedrock of magnetostatics. It says something simple and powerful: every flowing current makes a magnetic field, and you can find that field by adding up the contributions of every piece of the current path. For a long straight wire the sum collapses to B = mu_0 * I / (2 * pi * r), a formula clean enough to use in your head. Remember the 1/r falloff, keep track of direction, and check whether the geometry really matches your assumptions — and the Biot-Savart law will carry you through most practical magnetic field problems.

Top comments (0)