Magnetism is just electricity with relativity stirred in
An interactive, from-first-principles explainer on why magnetic force is not a separate thing — it's what electric force looks like to a moving observer.
Part 1 of 5
The wire, the electrons, and the test charge
Before anything else, let's set up the scene. A wire carries current. Inside it, two populations of charge are at work: positive ions — the metal atoms, locked in the lattice, going nowhere — and electrons, which drift slowly leftward through the gaps.
Now hover a positive test charge above the wire. The question is: does the wire attract it, repel it, or nothing? The answer depends entirely on how fast the test charge is moving, and in which direction. Pick a case below and watch what happens.
Positive ions (fixed)
Electrons (drift ←)
Test charge +q
Magnetic force on +q
"Magnetism needs motion. A charge sitting still feels nothing from a wire. The moment it starts moving, it feels a sideways shove. This asymmetry is the first clue that something deeper is going on."
Key intuition — Part 1
CONCEPT 01
Why is the wire electrically neutral?
In the lab frame, the ions and electrons have equal and opposite charge densities. They cancel exactly. So the net charge on the wire is zero — no electric field radiates outward. A static positive charge placed nearby feels nothing. This is why you can touch a current-carrying wire without being zapped (ignoring the Joule heating of course).
CONCEPT 02
The cross product F = qv × B
The cross product is a machine that takes two vectors and spits out a third one that is perpendicular to both. If v points right (→) and B points out of the page (⊙), then v × B points downward (↓). If you flip v to left (←), then v × B flips to upward (↑). This is why reversing the charge velocity reverses the force direction.
CONCEPT 03
Why does the force need motion?
Because the magnetic force F = qv × B has v baked in. No motion, no force. This is the fundamental asymmetry between electric and magnetic forces: electric force acts on any charge, moving or not. Magnetic force only acts on moving charges. This isn't arbitrary — it's a consequence of how relativity transforms forces between frames.
Part 2 of 5
The magnetic field wraps around the wire like invisible rings
This is where people often get confused. The magnetic field from a straight wire doesn't shoot outward like an electric field. It loops in circles around the wire — like someone wrapping rings around a broomstick. Above the wire the field points out of the page (when current flows right). Below the wire, it points into the page.
Hover over the field symbols in the diagram. The ⊙ symbol means "arrow coming toward you" (like seeing the tip of an arrow). The ⊗ means "arrow going away" (like seeing the feathers of an arrow).
Hover anywhere above or below the wire to see how B points and how F is computed at that point for a rightward-moving test charge.
Current flows right → (by convention)
Electrons actually drift left, but we define conventional current as the direction positive charges would flow. So current I points right. This matters for the right-hand rule.
Right-hand rule for B around a wire
Point your right thumb in the direction of conventional current (→). Your fingers curl in the direction of B. Above the wire, fingers come out of the page (⊙). Below the wire, they go into the page (⊗).
Apply F = qv × B
For +q moving right (→), v = →. Above the wire B = ⊙ (out of page). Right-hand rule: fingers point right, curl toward "out of page" — thumb points downward. Force on +q is toward the wire. Geometric reasoning, no numbers needed.
Field weakens with distance: B ∝ 1/r
The field rings get bigger (wider circumference) further out, so the field dilutes. This gives the 1/r relationship. Double the distance from the wire → half the field strength.
Part 3 of 5
Switch frames: the magnetic force vanishes — and something else takes its place
Now for the deep magic. Imagine you jump onto a skateboard and coast alongside the test charge, matching its speed perfectly. In your frame, the test charge is sitting still. So F = qv × B = q(0) × B = 0. No magnetic force. Zero.
But wait — you and the person standing in the lab are both watching the same physical event. The test charge must get deflected toward the wire in both views! So if the magnetic force is gone in your frame, something else must be providing the push. What is it?
Toggle between frames below and watch carefully what happens to the spacing of the ions vs. the electrons.
THE KEY QUESTION
Why do ions and electrons end up at different speeds?
In the lab frame: ions have speed 0, electrons have speed v_e left. When you boost into the charge's frame (moving right at v_q), you subtract v_q from everyone's velocity. Ions go from 0 to −v_q (left). Electrons go from −v_e to −v_e − v_q (left, but faster). Different final speeds → different Lorentz factors → different contractions → different charge densities.
THE RESOLUTION
Wire becomes net negative in the charge's frame
Electrons end up moving faster than ions in the new frame. Faster motion = more length contraction = charges packed more densely per meter. The electron density per meter exceeds the ion density. Net negative charge on wire. Net negative wire → electric field pointing toward wire → electric force on +q toward wire. Same deflection, electric explanation.
THE DEEP POINT
The force is the same physical event described differently
Neither frame is "wrong." Both describe the same universe. One observer says "magnetic force." The other says "electric force." The underlying reality is a single electromagnetic field — a tensor — whose electric and magnetic components rotate into each other when you change frames, the same way x and y coordinates rotate when you turn your head.
Part 4 of 5
Length contraction: why motion changes charge density
Lorentz contraction is the key mechanism here. When a row of charges moves, the space between them shrinks in the direction of motion. The same number of charges now occupy a shorter length. So charge per meter goes up.
The formula is simple: a length L at rest appears as L/γ when moving at speed β = v/c, where γ = 1/√(1−β²). Drag the slider below from slow to near-light-speed and watch the charges pile up.
0.30c
"The Lorentz factor γ = 1/√(1−β²) starts at 1 (no contraction) and shoots to infinity as β → 1. At 99% of lightspeed, γ ≈ 7. At 99.9%, γ ≈ 22. Space itself squeezes in the direction of motion."
Key formula — Part 4
In everyday wires, the drift speed of electrons is tiny — maybe 1 mm/s. So γ is essentially 1.000000000... The charge density difference is microscopically small. Yet the resulting magnetic force is exactly what you measure with an ammeter and a compass. The math holds even at these absurdly slow speeds.
Part 5 of 5
The punchline: electricity + relativity = magnetism
Let's pull it all together in one picture. Below you can see both frames simultaneously, side by side, showing the same instant in time.
This diagram shows both frames side by side. Left: what the lab observer sees. Right: what the test charge sees riding alongside itself. Same physical event — two different stories.
ELECTRIC FIELD
Coulomb's law: E ∝ q/r²
A charge creates a field radiating outward in all directions. Another charge placed in that field feels a force F = qE. This works whether the charges are moving or not. It's the "base" force that exists in the rest frame of the source charge.
MAGNETIC FIELD
Biot–Savart: B ∝ I/r
A moving charge (or current) creates a magnetic field that loops around it. Another moving charge placed in that field feels F = qv × B. This is the "relativistic correction" that appears when the source is moving in your frame. It's the electric field, partially transformed.
UNIFIED VIEW
The electromagnetic tensor Fμν
In special relativity, E and B are not separate fields — they're components of a single antisymmetric 4×4 tensor. A Lorentz boost (changing reference frame) mixes the E and B components, the same way rotating axes mixes x and y. What's purely electric in one frame has a magnetic component in another.
"If you know Coulomb's law and special relativity, you can derive all of magnetism. You don't need Ampère's law or the Biot–Savart law as extra postulates — they fall out for free. Magnetism is relativity applied to electricity."
The deepest take-away
Start: Coulomb's law + special relativity
These two ingredients are all you need. Coulomb gives you the force between charges. Relativity tells you how forces transform between frames moving relative to each other.
Apply to a current-carrying wire
In the wire's rest frame, it's neutral and there's a pure electric scenario (no net force on external charges). Now change to a frame where the test charge is at rest. The wire's charge densities shift. A net electric force appears.
Transform back to the lab frame
The electric force in the charge's frame, when Lorentz-transformed back to the lab frame, becomes exactly qv × B — the magnetic force law. No new physics was introduced. No new constants. It was electrostatics all along.
Generalize: Maxwell's equations are relativistically covariant
This works in every situation, not just the wire. All four Maxwell equations can be written as a single tensor equation: ∂ᵥF^μν = μ₀J^μ. Electric and magnetic fields are one field. The split into "E" and "B" depends on your motion through spacetime.