JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Where Magnetic Fields Come From

Currents are the true source of every magnetic field. Count their contributions with the Biot–Savart law, exploit symmetry with Ampère's law, then wind them into a solenoid.

Every field traces back to a current

Ørsted showed that currents make fields; now we make it quantitative. The elemental rule is the Biot–Savart law: it gives the tiny field d\vec{B} contributed by a short piece d\vec{l} of current-carrying wire. Every current element adds its own little swirl of field, and to get the total field at a point you add — integrate — the contributions of all the elements.

d\vec{B} = \frac{\mu_0}{4\pi}\,\frac{I\,d\vec{l}\times\hat{r}}{r^{2}}

The Biot–Savart law. The 1/r² falloff and the cross product (field circles the current) echo Coulomb's law but with a twist — the field wraps around the current, it does not point away from it.

The constant \mu_0 = 4\pi\times10^{-7}\,\text{T·m/A} is the permeability of free space, the magnetic counterpart of the electric constant \varepsilon_0. It sets the strength of the magnetic response of empty space itself.

The field of a long straight wire

Integrate the Biot–Savart law along an infinitely long straight wire and the field at distance r comes out clean. The lines are the concentric circles you saw in Guide 1, and the strength falls off as $1/r$.

B = \frac{\mu_0 I}{2\pi r}

The magnetic field a distance r from a long straight wire carrying current I. Its direction is given by the right-hand grip rule.

Ampère's law: the symmetry shortcut

Integrating Biot–Savart by hand is painful. When the geometry is symmetric, Ampère's law delivers the field almost for free — it is the magnetic analogue of Gauss's law. It says the field circulating around any closed loop is set by the total current threading through that loop.

\oint \vec{B}\cdot d\vec{l} = \mu_0 I_{\text{enc}}

Ampère's law. Choose a loop that follows the field's symmetry (a circle around a wire) and B pops straight out — reproducing B = μ₀I/(2πr) in one line.

The solenoid: a magnet you can switch on

Wind a wire into a tight helix of many turns and you have a solenoid. Inside, the loops' fields reinforce one another into a nearly uniform field pointing along the axis; outside, the field is weak and spread out — exactly the pattern of a bar magnet. Ampère's law applied to a rectangular loop gives the interior field in terms of n, the number of turns per unit length.

B = \mu_0 n I

The uniform field inside a long solenoid, where n = N/L turns per metre. Switch the current off and the field vanishes — an electromagnet.

Inside a solenoid the field is strong and uniform along the axis; outside it is weak and returns like a bar magnet's field.

Parallel wires, and a worked example

Put two current-carrying wires side by side and each sits in the other's field, so each feels a force. Parallel currents attract, antiparallel currents repel — a force so fundamental it was once used to define the ampere itself.

\frac{F}{L} = \frac{\mu_0 I_1 I_2}{2\pi d}

Force per unit length between two parallel wires a distance d apart. This combines B = μ₀I/(2πr) with F = BIL.

  1. Problem. Find the magnetic field 5.0 cm from a long straight wire carrying 10 A.
  2. Set up. Use B = \dfrac{\mu_0 I}{2\pi r} with I = 10 A and r = 0.050 m. Note \dfrac{\mu_0}{2\pi} = 2\times10^{-7}\,\text{T·m/A}.
  3. Compute. B = (2\times10^{-7})\dfrac{10}{0.050} = (2\times10^{-7})(200) = 4\times10^{-5}\,\text{T} = 40\,\mu\text{T}.
  4. Interpret. That is about the same size as Earth's field — which is why a compass held right next to a current-carrying wire is noticeably deflected, just as Ørsted found.