Skip to content
Peculiar Materials
Insights · Physics

F***ing magnets, how do they work?

In 2010 a horrorcore duo from Detroit asked this question in a song and made it clear they did not want a scientist to answer it. This is a scientist answering it anyway (a materials scientist who came to the subject through chemistry, drifted into electrical engineering and nearly crossed the event horizon into physics before he hit his limit on math), using the metaphor of a relentlessly curious child who keeps asking why until you get all the way to the ground. For this to work, my precocious child also has command of quantum mechanics and multivariable calculus, so we can get this ladder of whys all the way to the ground.

Short versionA magnet pulls because a magnetized object moves toward stronger field, and the field around a magnet is strongest at its poles. Iron has no field of its own because it is divided into domains that cancel; a magnet keeps its field because its crystal and its microstructure will not let the domains move back. Domains exist because the atoms' moments line up, and they line up because of exchange, a purely quantum-mechanical effect (the Pauli principle rearranging the ordinary electric repulsion between electrons) that is thousands of times stronger than the magnetic force between the atoms. Atoms have moments because electrons have orbits and spin. The orbital part is a current loop, and a current makes a field because magnetism is what electricity looks like from a moving frame. The spin part is NOT a loop; it comes out of the Dirac equation, and below that there is no why, only measurement.

Peculiar Materials LLC · The figures are schematic and computed live: field lines are integrated from ideal dipole sheets, the domain pictures are cartoons of the Landau closure pattern, the band diagram is the shape of the answer rather than a calculation, and the relativity figures use the exact field of a moving charge. The numbers in the cards are the textbook ones, footnoted where they are not common knowledge. Nothing here is a recipe for making a magnet; that is a different page.

What this page skips, so nobody mistakes it for complete: diamagnetism (why water and graphite are pushed away), paramagnetism and the Curie transition itself, antiferromagnets beyond a mention, superexchange in oxides (ferrite is a magnet for a reason this page does not give), magnetostriction, superconductors, and the reason the Earth has a field at all. The magnet family map is on What is a magnet? and the working curve of a magnet is on Reading a B-H curve. I have chosen to go straight down the trunk of the tree and ignore the many, many, many branches we could explore, for the sake of having this page end somewhere.
Scroll to build the figure. Press Got it at the end of each step when you have it, and not before.

About that button. Each press adds one to an anonymous counter for that step, nothing else, and tells you what share of readers made it that far. I am asking mostly for my own sake: the step where the presses stop is the step I have explained badly, and that is where the next revision goes. The chart at the end shows how far people get, which is also, I admit, fun.

Short versionA magnet has a field. Things that are magnetized, or can be, move toward where that field is stronger. The pull you feel is the slope of the field, not the field.

1 · PullWhy does a magnet pull?

Start with what your hand knows. A magnet on its own does nothing you can feel. It sits there with a field around it, strongest at its two ends, falling off fast with distance (as the cube of distance, once you are a few magnet-lengths away). The figure draws that field: lines that leave one end, loop around, and come back into the other.

(Housekeeping: when you have this, press Got it below. It counts you, anonymously, and takes you to the next step. Where the presses stop is where I rewrite.)

One word before we go on, because the whole page leans on it: dipole. Every magnet has two ends, and you cannot have one without the other. Cut a magnet in half and you get two magnets, each with a north and a south, and you can keep cutting down to the atom and it stays true. There is no magnetic charge the way there is electric charge, no lone north for a field line to start on and stop at. (Yes, exotic quasi-particle exceptions have been demonstrated in materials at extreme cryogenic temperatures, and yes, I re-derived Maxwell's equations with magnetic charge put in during my electromagnetism class, so I know what the exception looks like on paper. For anything you will ever hold, magnetic fields are always dipoles, and that is true enough.) The field in the figure is what a dipole's field looks like, and every magnet on this page, down to a single electron, has that shape from far enough away.

Two things about those lines before we use them. They are a picture of a vector field, not strings: at every point they run along the direction of the field, and where they crowd together the field is strong. The figure puts arrowheads on them this once: by convention the field runs from north to south outside the magnet (and from south back to north inside it, to close the loop). We tend not to draw the arrows every time, because they crowd the picture and, oddly, lead to more confusion than they cure; from here on, remember north to south. And there are no free ends. A line that leaves the north face comes back into the south face, always, without exception. That second fact is going to matter four rungs down.

1 · PullWhy does iron get pulled in, whichever end you offer it?

Bring a piece of iron toward the magnet (scroll, and it approaches). The magnet's field magnetizes the iron: the iron becomes a magnet itself, pointing the same way as the field it sits in. Now you have two magnets, and the induced one is always oriented to attract. Offer the north end, the iron's near face becomes a south. Offer the south, it becomes a north. Iron never repels a magnet, because it never gets a vote on its own polarity.

The force on a small magnetized object is the gradient of its energy in the field:

F = ∇(m · B)

and for soft iron the moment is itself proportional to the field, m ∝ B, so the force goes as ∇(B²). That is the whole reason a magnet feels the way it does: the pull is the SLOPE of the field strength, and the slope is steepest near the pole faces. A perfectly uniform field, however strong, pulls iron nowhere. (It does twist it. Torque is a different story and not this page's.)

In practiceI have been around some of the strongest magnets in the world, and the thing nobody tells you is how QUIET the strength is until it is not. Two meters away there is nothing. One meter, a tug on a watch. Then a steel tool leaves your hand and you learn ∇(B²) in your wrist.

1 · PullWhy do two magnets push apart?

Now the second object is a magnet with its own fixed polarity, north face toward the first magnet's north. Scroll, and watch what the field does as they approach: the lines that would have run straight between the two faces cannot, because they would be running head-on into each other, so they splay sideways and get squeezed into the gap.

A field stores energy, and it stores it everywhere it exists, at a density of

u = B² / 2μ₀

Crowding lines into the gap raises B there, which raises the stored energy, which is a hill the system does not want to climb. The force is the slope of that hill. The energy meter in the figure is the change in the total field energy as the magnets approach, computed exactly from the two magnets' poles (strictly, the energy of H, which for a permanent magnet is the one that sets the force; it is shown as a fraction of one magnet's own field energy): it rises, and the force pushing them apart is its derivative. Nothing is touching. What you feel between two like poles is the field's own reluctance to be compressed.

1 · PullAnd why do they pull together the other way round?

Flip one magnet. Now the lines that leave the first magnet's north have a south face right in front of them to enter, and they do. As the gap closes the field outside the pair collapses: the lines that used to make the long loop around each magnet now take the short cut through the other one. Total stored energy FALLS as they approach, and the force is that slope, pulling them together. By the time they touch the meter has given up almost a whole magnet's worth of field energy, which is another way of saying what the next sentence says. Let them touch and the two are, for every purpose outside them, one magnet twice as long: the same ten lines leave the far north face and come home to the far south face, and the joint in the middle carries flux straight across without a line leaving it.

There is a way of saying this that sounds like a metaphor and is a theorem. Maxwell showed the forces of a magnetic field can be accounted for exactly by treating each line as under a tension of B²/2μ₀ along its length and a pressure of the same size sideways. Lines pull along themselves and shove their neighbors apart. That is a correct statement of the Maxwell stress tensor, not a picture of it, and it is the one intuition on this page you are allowed to keep without a footnote. Every other "field lines are like…" you have heard is worse than the equation.

Short versionIron is fully magnetized all the way through, in patches. The patches point in different directions so that no field leaks out, because a leaking field costs energy. A magnet is iron (or something like it) whose patches have been made to agree and cannot disagree again.

2 · HideBut why does the magnet have a field and the iron not?

Before the physics answer, the answer I was trained to give. I majored in materials science, having come to it as a chemistry student, with physics and electrical engineering as minors, and a materials scientist looks at a piece of iron and sees the figure: grains, from a few micrometers to a few millimeters across, each one a single crystal with its own orientation, separated by boundaries and salted with inclusions. Polish it, etch it, and all of that is there in a microscope. Dust the polished face with a fine magnetic powder and one more thing appears: a pattern of lines INSIDE each grain, running along that grain's own crystal axes and changing direction at every boundary. Those are the domain walls, and Francis Bitter first made them visible that way in the 1930s. Now apply a field (keep scrolling) and watch the powder pattern move: in every grain the domains pointing nearest the field widen and their neighbors shrink, the walls sliding sideways, until each grain is a single domain and the block as a whole has a field. Take the field away and, in soft iron, most of it slides back.

In that framework the answer to the child is: iron has no field because its domains are arranged to cancel, and a magnet has one because its microstructure locks the domains in place. That answer is TRUE, and it is the one that predicts what a magnet product will do. Rungs 2 and 3 are that framework, and it is where the money is. What it does not tell you is why the domains exist at all, what a wall is made of, or why the walls follow the crystal axes. For that we go inside one grain.

2 · HideSo what is inside one grain?

Here is the fact that surprises people who think they know this. At room temperature, EVERY grain of iron is magnetized to saturation, everywhere, all the time. It is not waiting for a magnet to magnetize it. What a lump of iron lacks is not magnetization but agreement.

Zoom in (the figure is now a single grain, a few tenths of a millimeter across) and the magnetization is arranged in regions called domains. In each one the moments point the same way. Between them the direction changes. The pattern drawn here is the Landau closure pattern: two long domains pointing up and down, capped by triangles pointing sideways, so that every line of flux that would have left the top of the grain is instead carried around inside it. The external field is zero. Not small. Zero, to the accuracy of the drawing.

Why arrange it that way? Because, as the last rung said, a field outside the grain stores energy at B²/2μ₀ per unit volume. A single-domain grain of iron would be a magnet, with a large field outside and a large energy bill. Splitting into closure domains costs some energy at the boundaries (the next rung) and saves far more outside. Iron chooses the cheaper arrangement, and the cheaper arrangement has no field.

2 · HideSo what does an external field do to it?

Apply a field, upward (scroll: the field ramps up and then back down). The domain already pointing up is now the cheap one, because a moment aligned with a field has energy −m·B, and it grows at the expense of its neighbors. The boundary between up and down slides right. The closure triangles shrink. Flux starts to leave the top of the grain, which is the iron's induced field from the previous rung, seen from the inside.

Then take the field away. In iron the boundaries slide almost all the way back. Not quite: they catch on things, and the small offset that remains is the remanence of soft iron, a few percent of saturation, the reason a screwdriver that has been near a magnet will pick up a paper clip for a while. The loop traced in the corner of the figure is the magnetization against the applied field, and for iron it is a thin sliver. That thinness IS softness. It is the whole design goal of a transformer core.

2 · HideThen why does a magnet stay magnetized?

Same experiment, different material: a sintered neodymium magnet, Nd₂Fe₁₄B. The figure is now a patch of its microstructure, grains a few micrometers across, each with a preferred axis (the crystal's c-axis) that the manufacturing process has lined up nearly parallel.1 Before magnetizing, the grains point up or down along that axis at random, and the block has no field: the same closure logic as iron, done with whole grains instead of domains.

Start in the virgin state: half the grains up, half down, no field outside. Ramp the field up and grain by grain, each at its own threshold, they flip to up. Ramp it down, and nothing moves. The loop in the corner is now nearly a square: the magnetization stays at saturation until the reverse field reaches a large value, the coercivity, and only then collapses. Note what stayed magnetized: the grains, individually, because each one is at a scale where it holds a single domain and would have to rotate its whole moment against the crystal to reverse. Note also what makes that hard, because it is two different things and people conflate them. The crystal supplies the preference for the axis (rung 3 says why). The microstructure, the thin non-magnetic phase between grains, supplies the isolation: a grain that flips must not be able to talk its neighbors into flipping too.2

In practiceI got my start in magnetics working out how to erase hard drives and floppy disks, which is this rung run backward: the job is to take a material built to keep its domains where you put them and scramble every one of them, on purpose, in a second, with nothing left that a lab could read. Rung 3 is why that is harder than it sounds.

Short versionA domain boundary is a few nanometers to a few tens of nanometers of moments turning gradually from one direction to the other. It moves not by anything moving, but by each moment in it rotating a little, so the turning region shifts. It moves easily in iron and barely at all in a magnet, and the difference is how strongly the crystal holds the moments to an axis.

3 · MoveBut why do domains move?

Go back to the iron grain of rung 2, part-way through magnetizing, when the up domain has grown and there is a long wall between it and the down domain, and put a box on that wall. Zoom in (scroll): every arrow divides into four each time the scale doubles, until the arrows are atoms, and every row of them across the wall looks the same, so keep one row. The boundary is not a sheet. The moments turn through 180° gradually, over a wall whose width is set by a tug of war: the exchange interaction (rung 4) wants neighboring moments parallel, so it wants the turn spread over as many atoms as possible; the crystal anisotropy (next card) wants every moment on the easy axis, so it wants the turn done in as few atoms as possible. The compromise is

δ = π √(A / K)

with A the exchange stiffness and K the anisotropy constant. For iron that is about 60 nm, a couple of hundred atomic spacings. For Nd₂Fe₁₄B it is about 4 nm, a dozen or so.3 The profile drawn in the figure is the exact one for this energy balance, θ(x) = 2 arctan(e^{x/δ}): a smooth twist, nearly all of it inside one wall width.

3 · MoveSo how does the wall move?

Apply a field in the upward direction. Every moment in the wall feels a torque toward up, and rotates a little that way. The moments on the up side of the wall were already up and do nothing; the moments on the down side, just past the wall, are now the ones part-way through the turn. The wall has moved one step into the down domain without a single atom moving. Scroll and watch: the twist slides along the chain, a rotation propagating, and the up domain grows by exactly the distance the wall traveled.

The analogy that holds up is a zipper. The wall is the slider; the atomic moments are the teeth. As the slider passes, each tooth flips in turn, in rapid succession, and the zipped region grows while no tooth goes anywhere along the zipper. What travels is the flip, not the teeth. The one place the analogy is too crude is the flip itself: a zipper tooth snaps, and a moment in a wall turns through its 180 degrees smoothly over the wall width from the previous card. Everything else about it is right, including the fact that a zipper snags.

Nothing in a perfect crystal stops it. In a real one, plenty does: an inclusion, a grain boundary, a patch of strain, anywhere the wall's own energy (about 4√(AK) per unit area) is locally lower, and the wall sticks there until the field is strong enough to tear it free, at which point it jumps to the next snag. The figure has one such defect. The jump is the Barkhausen effect, first heard as a crackle from an amplified coil around a bar of iron being magnetized, and it is the reason magnetization curves are not smooth if you look closely enough.

3 · MoveThen why do a hard magnet's domains resist moving?

Because in a hard magnet the moments are tied to the crystal, and in iron they barely are. Two crystals, side by side. Iron is body-centered cubic: an atom at each corner of a cube and one in the middle, all of them iron, all carrying about 2.2 Bohr magnetons, all tied to their neighbors by exchange. What ties the moments to the LATTICE is another matter. The moment is mostly spin, and spin does not know which way the crystal axes point; it learns that only through spin-orbit coupling, which in iron is weak, because the orbital motion that would carry the message is quenched by the crystal field (rung 4). Cubic symmetry then leaves a preference for the cube edges so slight it shows up only at fourth order: K₁ ≈ 48 kJ/m³. Iron's moments are strongly linked to each other and barely linked to the crystal. Push them off the axis and almost nothing objects.

Spin-orbit coupling deserves a plain description, because it is the hinge of this rung. An electron in an atom has two motions: it moves through the electron cloud it belongs to (its orbit, which is really the SHAPE of that cloud), and it spins. From the electron's own point of view the charged nucleus is circling it, and a circling charge is a current, and a current makes a magnetic field (rung 5 does this properly). The electron's spin, being a magnet, has a preferred orientation in that field. So the direction the electron prefers to spin is tied to the shape and orientation of the cloud it lives in. If the cloud is a sphere, there is nothing to tie it to. If the cloud is flattened or stretched, and the crystal holds that shape in a fixed orientation, then the spin inherits a preferred axis from the lattice. The effect grows steeply with the charge of the nucleus, which is why it is a footnote for iron's 3d electrons and the main event for a rare earth's 4f electrons.

Nd₂Fe₁₄B is a tetragonal cell of 68 atoms, 56 of them iron, with one special axis, c.1 The iron still carries most of the magnetization, exchange-coupled to itself as before. But it is also exchange-coupled to the neodymium, and the neodymium is a different kind of atom. Its moment comes from 4f electrons whose charge cloud is not a sphere but a flattened, oblate shape, and the crystal's own electric field locks the orientation of that cloud to the lattice. By the paragraph above, the neodymium's spin then has a preferred axis, c, and the push needed to turn it off that axis is the push needed to turn the whole flattened cloud against the crystal. That is a MUCH harder push than anything iron can offer. So the chain runs: iron moment, exchange, neodymium spin, spin-orbit, 4f cloud, crystal field, lattice, and there is no weak link in it. Tilt the iron moments off c and you are dragging the neodymium clouds against the crystal field. Scroll, and the figure tilts everything by the same angle; the two bars between the sketches are the cost, on one scale, and iron's is three pixels tall.3

This is also why swapping the rare earth changes everything. Samarium's 4f cloud is stretched rather than flattened, so in the same lattice it prefers the basal plane, and Sm₂Fe₁₄B is useless as a magnet for exactly the reason Nd₂Fe₁₄B is good.2

3 · MoveDraw that cost as a hill.

The two bars come along, now as the barrier each material puts up, and the field starts from zero and pushes against both. In a uniaxial crystal the energy of the magnetization as a function of its angle θ from the easy axis is, to first order,

E(θ) = K₁ sin²θ − μ₀ Mₛ H cos θ

The first term is the crystal's preference: two valleys, at θ = 0 and θ = π, with a hill of height K₁ between. The second is the applied field tilting the landscape. The figure draws that landscape for iron and for Nd₂Fe₁₄B and rolls a moment across each as the field ramps from zero; watch the dashed push line clear iron's bar almost immediately and take most of the chapter to clear the other. Iron's K₁ is about 48 kJ/m³; the neodymium compound's is about a hundred times larger, roughly 4.5 MJ/m³.3 For a single grain that must reverse by rotating its whole moment, the field that finally tips it over the hill is the anisotropy field, HA = 2K₁/μ₀Mₛ, about 7 tesla for Nd₂Fe₁₄B.4

And here is the footnote that undercuts the page. Real sintered magnets reverse at a quarter to a third of that. The difference is Brown's paradox: reversal does not happen by the whole grain rotating; it nucleates at a corner, a defect, a patch of grain boundary where the anisotropy is locally weak, and a reverse domain spreads from there. So the coercivity you buy is set by the microstructure, and that is why two magnets of the same composition can differ by a factor of two in the field they withstand, and why grain-boundary engineering is where the money went in the last decade.4

Short versionThe atoms' moments do not line each other up magnetically; that force is thousands of times too weak. They line up because the Pauli principle makes the electrons' electric energy depend on whether their spins are parallel. Nothing magnetic is involved; it is quantum mechanics acting on plain electric charge, and it has no classical counterpart. In a metal that shows up as the spin-up and spin-down bands splitting, and iron, cobalt and nickel are the elements where the split pays for itself.

4 · AlignBut why do the atoms line up in the first place?

The obvious answer is the wrong one, and I want to kill it with arithmetic before going on. The obvious answer is that each atom is a tiny magnet and tiny magnets line each other up. Two iron atoms, moments of 2.2 Bohr magnetons each, sit 0.248 nm apart. The magnetic energy of one dipole in the field of the other is, at most,

E ≈ (μ₀ / 4π) · μ² / r³ = 10⁻⁷ · (2.2 × 9.27×10⁻²⁴)² / (2.48×10⁻¹⁰)³ ≈ 2.7 × 10⁻²⁴ J = 0.2 K, as a temperature

That is the whole strength of the magnetic interaction between neighbors: a fifth of a kelvin. Thermal vibration at virtually any temperature obliterates it. Iron stays ferromagnetic up to 1043 K. Whatever holds the moments parallel is more than three orders of magnitude stronger than magnetism, which means it is not magnetism.5 The thermometer in the figure is drawn on a log scale because it has to be.

4 · AlignThen what does hold them parallel?

Quantum mechanics: the Pauli exclusion principle, acting on the ordinary electric repulsion between electrons. The principle needs stating before it can be used. In its box-diagram form, which is how every chemistry student meets it: an orbital holds at most two electrons, and only if their spins are opposite. Two electrons with the same spin cannot share an orbital. In its general form: no two electrons can be in the same quantum state, and, deeper, the wavefunction of a set of electrons must change sign when any two of them are swapped. The figure shows the box version first, allowed and forbidden, and then the rule in words.

Now the consequence that matters here, and it is about distance, not magnetism. Two electrons with PARALLEL spins are forced into two different orbitals. Two orbitals occupy different regions of space, so on average the pair sits farther apart. Two electrons with ANTIPARALLEL spins are allowed to share one orbital, one region of space, piled on top of each other. Same charges either way; the parallel pair is farther apart on average, so it pays less Coulomb repulsion. Nothing magnetic has happened. The spins have not felt each other at all. What has happened is that the rule about spins has changed the electrons' average spacing, and spacing is what electrostatics charges for. That is the textbook picture, and for two electrons on neighboring atoms it is the right one. Inside a single atom the bookkeeping turns out to be different (two cards on), but the conclusion survives: the spins never feel each other, and the energy that moves is electric.

4 · AlignSo put a number on it.

The wavefunction version of the last card is what the figure draws now, with the last card's boxes beside each curve so the two pictures stay tied together. Parallel spins: the spatial part of the wavefunction is antisymmetric, so it passes through zero where the two electrons coincide, and the pile-up is forbidden mathematically rather than by fiat. Antiparallel spins: the spatial part is symmetric, and the pile-up is allowed. The energy difference between the two arrangements is called the exchange energy. Every joule of it is electric; what decides how many joules is quantum mechanics, and there is no classical version of the term at all. It is of the order of a tenth of an electronvolt per pair, which is a thousand kelvin, against the fifth of a kelvin of two cards ago.

Write the spin part of it down and you get the Heisenberg form, E = −2J S₁·S₂, with J positive for a ferromagnet. Nothing in that equation is magnetic. J is set by how much the two electrons' orbitals overlap and how much they repel when they do, which is why the sign depends on the spacing of the atoms and the size of the 3d shell. The curve in the figure, the Bethe-Slater curve, is the traditional sketch of that: iron, cobalt and nickel on the parallel side; manganese and chromium, atoms a little closer for their shell size, on the antiparallel side, which is why they order antiferromagnetically and make no field at all. Treat the curve as a mnemonic, not a calculation; the modern account is done band by band, which is the next card.

4 · AlignHold on. Chemistry says unpaired electrons. Is that not the answer?

It is the answer I first learned, and I want to give it its due, because it is more right than the physics crowd usually allows. In the chemistry framework you write iron's configuration, [Ar] 3d⁶ 4s², fill the five 3d boxes by Hund's rule (one electron per box before any box gets two) and count four unpaired electrons. Cobalt gets three, nickel two; copper's 3d is full and its one unpaired electron sits in the 4s. Unpaired electrons have spin, spin has a moment, iron has the most of them: iron is the magnet. I was fine with that until I got deeper into the physics as part of graduate work in electromagnetism, and even then the framework did not so much fail as stop one step early.

Credit first. Hund's first rule, maximum multiplicity, IS the exchange interaction, working inside one atom, and the chemist has been using it since the first year without calling it that. The reason I was taught (parallel spins keep apart, so they repel less) turns out to be wrong in the details. Careful calculations show the parallel electrons screen each other from the nucleus less, so both sit a little closer in and the nucleus pulls harder; that extra attraction is where the energy is saved, and the electron-electron repulsion actually goes UP.6 Different bookkeeping, same lesson: the Pauli principle moves electric energy around, and magnetism doesn't enter into it. And the chemist already knows that pairing is a matter of energetics rather than a law: put Fe²⁺ in a strong octahedral ligand field and its six d electrons pair up into the lower three orbitals; high spin becomes low spin, four unpaired becomes none. That is the Stoner criterion in miniature. Electrons pair when the cost of pairing is less than the cost of the next level up, and not otherwise.

Where it stops: the count, and the alignment. The framework predicts four Bohr magnetons for iron, three for cobalt, two for nickel. The metals show 2.2, 1.7 and 0.6, which are not integers and not the atomic values, because in a metal the 3d electrons are shared and the right object is a band, not a box.5 And nothing in a box diagram says why the moment on this atom should point the same way as the moment on the next one; that is exchange BETWEEN atoms, the previous card, and it is what makes a ferromagnet instead of a jar of paramagnetic atoms. Copper is the cautionary case: one unpaired electron per atom, delocalized, and magnetically useless.

4 · AlignWhy iron, then, and not copper or aluminum?

An isolated iron atom has six 3d electrons and, by Hund's rule (the same exchange, inside one atom), four of them unpaired. Put the atoms in a metal and the 3d orbitals overlap into a band, and the four-unpaired story stops being literally true: iron metal carries 2.2 Bohr magnetons per atom, not four, and a non-integer moment is the fingerprint of electrons that belong to the crystal rather than to an atom.

What the band picture says instead: draw the density of states for spin-up electrons and spin-down electrons as two mirror-image halves. Exchange lowers the energy of whichever spin is in the majority, so the two halves slide apart by an exchange splitting (scroll: watch them separate). Electrons pour from the high half into the low one until the two Fermi levels agree, and the excess in the majority half is the moment. Whether sliding pays at all is the Stoner criterion, I · N(EF) > 1: the exchange integral times the density of states at the Fermi level has to beat one. Iron, cobalt and nickel have a narrow, tall 3d band straddling the Fermi level, so they clear it. Copper, drawn beside iron on equal terms, has a 3d band that is full and sits below the Fermi level: slide it and nothing can move, so there is nothing to gain. Aluminum has no d band at all and a low, wide density of states, and fails by a mile. That is the entire periodic-table answer, and the reason the ferromagnetic elements you can name at room temperature are three.

Short versionAn electron has a magnetic moment from two sources. One is its orbit, which is a current loop, and a current loop has a field. The other is its spin, which is not a current loop, however much the name suggests one. Iron's moment is more than nine tenths spin.

5 · MomentBut why does an electron have a magnetic moment at all?

First the experimental fact that started everything, because the order matters. In 1820 Hans Christian Ørsted put a compass under a wire, closed the circuit, and the needle swung sideways and STAYED swung for as long as the current flowed. A steady current makes a steady magnetic field, circling the wire. As you scroll, see the switch close, the needle turn and hold. That is the effect; the reason for it is the sixth rung on the ladder as we make our way down.

A decade later Michael Faraday wound two coils on an iron ring, and found the converse, and people mix the two up, so: with a battery on the first coil and a galvanometer on the second, the galvanometer kicked ONLY at the instant the battery was connected, and kicked the other way at the instant it was disconnected. A changing field makes a current; a steady one does not. That is induction, and it is the reason a generator has to turn, but it is not the rung we are on. The rung we are on is Ørsted's: charge in motion makes a field.

5 · MomentShow me Faraday's, then, so I can tell them apart.

A brief sidebar into something that often gets confused here. The figure is Faraday's ring. As you scroll, you will see the switch on the primary close: the needle kicks and settles back to zero while the current is still flowing. Scroll further and you will see the switch open: the needle kicks the other way and settles again. What the second coil responds to is the RATE OF CHANGE of the flux through it, ε = −dΦ/dt. Steady flux, no current.

Hold the pair side by side. Ørsted: current, therefore field. Faraday: changing field, therefore current. They are two faces of one set of equations, and the magnet in your hand needs only the first face. Its field is not changing and it is not inducing anything in you. What it has inside it, at the atomic scale, is charge in motion, or so the next card claims, and the card after that takes the claim back by half. Sorry, magnets are weird.

5 · MomentSo the electron is a little Ørsted loop?

Part of it is, and this is the electrical engineer's electron I learned about in grad school when I started my EE minor: Ampère's loop. Start with the atom the way the 1950s drew it, three orbits and electrons racing around them (the figure does), then keep one orbit. An electron in orbit is a charge going round, which is a current, which by Ørsted has a field, and far away that field is the field of a dipole, the same shape as the magnet in rung 1. Do the classical calculation for a charge e going round a loop of area A with angular momentum L: the current is e/T, the moment is current times area, and the two combine to

μ = (e / 2mₑ) · L

Put in one quantum of angular momentum, L = ħ, and you get the Bohr magneton, μB = eħ/2mₑ = 9.274 × 10⁻²⁴ J/T, the unit every moment on this page has been quoted in.7 The classical loop gets the orbital moment exactly right, ratio and all, which is a fair reason to trust the picture.

So far the ladder holds: magnet → domains → aligned moments → orbiting electrons → Ørsted. Now for the half that does not.

5 · MomentWhat about the other half?

This is the rung where quantum physics tore up the floor, so it gets two cards. In 1922 Otto Stern and Walther Gerlach built the apparatus in the figure: an oven that boils off silver atoms, a slit that makes them a beam, a magnet whose north pole is a knife edge and whose south pole is flat, and a plate. The point of the knife edge is a field that is NOT uniform: strong just under the edge, weak down at the flat pole. By rung 1, a moment in a non-uniform field feels a force along the gradient, proportional to its component along the field: a moment pointing up is pulled up, a moment pointing down is pushed down, a moment pointing sideways feels nothing.

They used silver on purpose, and the figure shows why in the box diagram from rung 4. Silver's configuration ends in a full 4d shell, which cancels itself, and ONE electron alone in the 5s orbital. An s orbital is a sphere, so that electron has no orbital angular momentum and the atom has no built-in direction: whatever deflects it is the lone electron's own moment, pointing wherever the hot oven left it. Now what classical physics expected, and why. A hot oven hands those moments out pointing every which way. So the first atom through, pointing a little up, gets a small push up and lands a little high. The second, pointing mostly down, gets a big push down and lands low. The third, nearly sideways, is barely deflected. As you scroll, watch three atoms go through one at a time, each with its force arrow, each landing somewhere else; then let the crowd through. Every orientation, every deflection, and the plate should fill with a continuous smear from top to bottom. That was the prediction, and it is not a silly one.

5 · MomentSo what did happen?

Two spots. Not a smear, not a blob in the middle, two sharp spots, one high and one low, and nothing between. As you scroll, the same apparatus runs again with what the atoms actually did: every atom got the SAME size of push, either straight up or straight down, and the crowd split into two beams that landed as two dots. The only explanation that survived is that the atoms went through in one of two states, and only two, with no orientation in between on offer. Silver's outer electron has no orbital angular momentum, so this was not an orbit. It was something intrinsic to the electron, with two allowed orientations and an angular momentum of ħ/2. It was called spin.

The term SPIN is the problem. If we imagine it literally and give an electron the classical electron radius and ħ/2 of angular momentum, its equator moves at more than a hundred times the speed of light. Worse, a spinning ball of charge, whatever its size, gives a ratio of moment to angular momentum of e/2mₑ, the same g = 1 as the orbit. But the measured spin ratio is actually twice that, g = 2.002 319 304 36, and that number is known to a tenth of a part per trillion.8 No arrangement of moving charge produces g = 2. What we are calling spin is a magnetic moment that is not made of anything going round.

And spin is the part that matters. Of iron's 2.2 Bohr magnetons per atom, the orbital contribution is about a tenth; the crystal field quenches most of the orbit.5 So the honest chain is: the magnet in your hand is mostly a property of the electron that has no classical picture at all. The child, being a graduate student, is not going to accept that as the bottom, so two rungs remain: one for each half.

Short versionA magnetic field is what an electric field looks like from a frame in which its sources are moving. Coulomb's law plus special relativity gives you the magnetic force on a moving charge, with the right size, from a length contraction of one part in 10²⁵ multiplied by ten thousand coulombs per meter of wire.

6 · FrameBut why does a moving charge make a field?

This is the rung with the pure math on it, and it is Edward Purcell's argument, which I met in a graduate electromagnetism course: the reason I stopped being satisfied with the chemistry answer, and the moment I realized I did not want to study physics any more. But, since we are here now, I will run it with real numbers, because the numbers are the point.9 Take a copper wire, 1 mm², carrying 1 A. The conduction electrons drift along it at

λ = n e A = (8.5×10²⁸)(1.6×10⁻¹⁹)(10⁻⁶) ≈ 1.4×10⁴ C/m v = Iλ ≈ 7×10⁻⁵ m/s

just under a tenth of a millimeter per second. However, there is more in the wire than electrons moving, and I do not want to take it for granted. Any conductor has two kinds of charge to keep track of. The negative carriers are of course the electrons, and in a metal they are the ones that drift. The positive charges are the ions of the lattice, the copper atoms that gave up those electrons, and in the lab frame they sit still (in a semiconductor the positive carriers, called holes, do move, but copper is not a semiconductor). Both kinds matter here, because the argument is about what each kind of charge looks like from a moving frame, and the ions are about to move. The figure runs on its own: the electrons drift along the wire, and once you scroll a little, a test charge q appears below it, moving along the wire at the same speed v as the electrons, and keeps running (when it leaves the frame, a fresh one starts). The wire is neutral in the lab: equal and opposite line densities of ions and electrons. In the lab frame the standard account is: current, therefore field B = μ₀I/2πr circling the wire, therefore force qvB on the moving charge. Fine. The child asks why B.

Let's shift our frame of reference to the test charge instead of the lab. The electrons in the wire appear at rest, since we are moving the test charge at the same speed. The positive ions, which were sitting still in the lab, now move the opposite way at v. Einstein's theory of special relativity teaches us that lengths along the direction of motion contract by a factor

γ = 11 − v²/c²

As you scroll, the figure shows the contraction, and the spacing of the two kinds of charge comes apart. In the figure the test charge now sits still and the wire runs past it from right to left: the electrons appear at rest, and the ions appear to move.

6 · FrameRun the numbers.

In the lab the electrons were moving, so the relativistic effects were already baked in to what we observed. So when we shift the frame, they spread out to λ/γ. Meanwhile the ions, which were at rest, now appear to be moving in this new frame, so they bunch up to γλ. The wire, neutral a moment ago, now carries a net line charge

λ′ = γλ − λγ = γλ (1 − 1γ²) = γλ v²c²

which is a tiny relativistic correction, v²/c² ≈ 6×10⁻²⁶, but applied to the ENORMOUS λ. The result is a plain electric field at the test charge and a plain Coulomb force on it. Put in the numbers at r = 1 cm:

λ′ ≈ (1.4×10⁴)(6×10⁻²⁶) ≈ 8×10⁻²² C/m E′ = λ′2π ε₀ r ≈ 1.5×10⁻⁹ V/m lab frame, for comparison: B = μ₀ I2π r = 2×10⁻⁵ T, vB ≈ 1.5×10⁻⁹ V/m

The force in the lab's frame and the charge's frame are the same, down to the last digit rounding allows. But the kicker is this: if you replace μ₀ with 1ε₀ c², the expressions are identical. The algebra, with each substitution marked so you can follow it:

lab frame F = q v B B = μ₀ I2π r, I = λ v F = q v · μ₀ λ v2π r μ₀ = 1ε₀ c² F = q λ v²2π ε₀ c² r the test charge's frame F′ = q E′ E′ = λ′2π ε₀ r F′ = q λ′2π ε₀ r λ′ = γλ v²c² ≈ λ v²c² (γ ≈ 1) F′ = q λ v²2π ε₀ c² r ← the same expression ← from the other frame green arrows: where each symbol is replaced by what it stands for. μ₀ = 1/ε₀c² is the step that makes the two frames agree.

What this suggests is radical: the magnetic field we experience IS the electric field the test charge experiences. There is no separate magnetic thing; there is one field, and what you call its electric and magnetic parts depends on how you are moving. Under a change of frame they mix:

E′⊥ = γ (E + v × B)⊥ B′⊥ = γ (B − v × Ec²)⊥

with the components along v untouched. As we transform the figure to account for this relativistic distortion, it draws the exact field of a single charge as its speed rises: the electric lines flatten into a pancake and a magnetic field appears circling its path, B = v × E / c², out of nothing but Coulomb's law and the geometry of spacetime.10

And thus we arrive at the most "quantum physics" answer ever: the moving charge has a magnetic field because it doesn't. It is an electric field that you experience as a magnetic field from your point of view.

Short versionThe orbital half of the moment bottoms out in relativity. The spin half bottoms out in the Dirac equation, which was written to make quantum mechanics obey relativity and produced spin ½, g = 2 and antimatter without being asked. Below that, physics measures and does not explain, and says so.

7 · FloorAnd the spin? Why g = 2?

In 1928 Paul Dirac wrote down the wave equation an electron would have to obey for quantum mechanics and special relativity to agree with each other: first order in time, first order in space, the same in every frame. We owe you the equation itself, so it is in the figure, with its pieces named. The γ are four matrices, one for each direction of spacetime. The m is the electron's mass, and it is the only thing put in. And ψ, the wave function, refused to be a single number: the equation only works if ψ has FOUR components. Two of them are the electron, spin up and spin down, the ħ/2 of rung 5 arriving uninvited. The other two describe a particle with the electron's mass and the opposite charge, which nobody had asked for and which was found in a cloud chamber four years later: the positron, antimatter.11

Couple the equation to a magnetic field and the moment that falls out is (e/2mₑ) times the spin, times exactly 2. Nobody put the 2 in. The remaining 0.002 319 304 36 is the electron interacting with its own field, and quantum electrodynamics computes it, order by order, to a precision that agrees with the measurement to the twelfth digit.8

I am not going to work the math. I could not claim to understand it with a straight face; I gave up going deeper after my first course in tensor calculus in grad school, and I have made my peace with that. But it is worth saying plainly why this equation can carry the weight of the whole ladder. Dirac derived it from first principles. There are no fudge factors in it, no constants tuned to fit what had been seen. He wrote the equation, and then over the following decades the things it predicted that nobody knew about were found, one by one. A theory that pays out like that is as close to bedrock as physics gets, and that is why we can treat it as the floor the ladder rests on.

7 · FloorSo: how do they work?

Bring the ladder back, and read it from the top. A magnet pulls because a magnetized thing moves toward stronger field, and the pull is the slope of B². Iron hides its field in closure domains, and a magnet is a material whose domains have been made to agree and cannot disagree again. Domains move by a wall sliding, a zipper of flips, and a hard magnet resists because its moments are tied to the crystal through neodymium's locked 4f cloud. The atoms line up because of exchange, the Pauli principle acting on electric charge, thousands of times stronger than any magnetic force between them. The atoms have moments because electrons have orbits, which are current loops, and spin, which is not. A current has a field because magnetism is what electricity looks like from a moving frame. And spin, with its g of 2, comes out of the Dirac equation, which was derived rather than fitted.

Below the last rung are three tiles in the figure: charge is the same in every frame, the speed of light is the same in every frame, and the electron carries spin ½. Those are measured. Every attempt to derive them from something deeper is, today, either an assumption in different clothes or a theory without a confirming experiment. So here the honest answer to "why" is "because that is the universe we measure." The song was right that there is a floor. It was wrong about who could tell you where it is.

In practiceI have spent a career reducing oxides to metal, casting it into alloy, pulverizing, pressing, sintering, grinding, gluing, and testing the result, and at NO point has the Dirac equation come up in a meeting. It never needs to. The two rungs that decide whether a magnet product works are 2 and 3: closure and coercivity, which is to say microstructure. If you are diligencing a magnet company, that is where your questions go. The rest of this page is for our relentlessly questioning young Juggalo with a stunning command of doctorate-level mathematics.

One magnet, its field 1 / 26

How far down the ladder do readers get?

Every Got it button on this page adds one, anonymously, to a counter for that step. Nothing else is recorded: no address, no cookie, no identifier, no time. The chart shows, for each step, the share of readers who pressed Got it there, taking everyone who pressed it on the first step as the whole (the assumption being that anyone who reads at all presses that one), so it measures persistence and self-reported understanding together, and it cannot tell those two apart. The same number appears beside each button when you press it. The point of it is editorial: the rung where the bars drop fastest is the rung that needs rewriting, and that is where the next draft of this page goes. Your own path is in amber.

Got it counts by step
StepReaders

Loading the counts…

References

The physics on this page needs no citation and gets none. The numbers do, where they are not in every textbook, and the historical dates are given to the year because these particular experiments are unusually well documented; attribution for most industrial history is contested, and on other pages dates stay at decade level for that reason.

  1. J. F. Herbst, "R₂Fe₁₄B materials: intrinsic properties and technological aspects", Reviews of Modern Physics 63, 819 (1991). The tetragonal structure, the c-axis as the easy direction, and the room-temperature intrinsic properties of Nd₂Fe₁₄B. Paywalled at the publisher; the abstract and the data tables are widely reproduced.
  2. J. M. D. Coey, Magnetism and Magnetic Materials (Cambridge University Press, 2010), chapters 7 and 13. Domain theory, the closure pattern, the single-domain limit, and the role of the grain boundary phase in sintered NdFeB. A book; no link.
  3. Coey (reference 2), tables of A, K₁ and Mₛ. Iron: A ≈ 2×10⁻¹¹ J/m, K₁ ≈ 4.8×10⁴ J/m³. Nd₂Fe₁₄B: A ≈ 8×10⁻¹² J/m, K₁ ≈ 4.5×10⁶ J/m³ at room temperature. The wall widths in rung 3 are my arithmetic from those values, π√(A/K), and different tabulations of A move them by a factor of about 1.5 either way. Treat "60 nm" and "4 nm" as the scale, not the value.
  4. Herbst (reference 1) for the anisotropy field of Nd₂Fe₁₄B, about 7 T at room temperature; Coey (reference 2) for Brown's paradox and the nucleation picture. The "quarter to a third" is my ratio of the best commercial coercivities to that anisotropy field, and it is generous to the magnets: a standard grade with no heavy rare earth sits lower. The point of the rung is the gap, and the gap is larger than stated, not smaller.
  5. C. Kittel, Introduction to Solid State Physics, 8th edition (Wiley, 2005), chapter 12. The 2.2 μB per atom for iron, the Curie temperature of 1043 K, the dipole-dipole estimate, and the orbital contribution being about a tenth of the total. The estimate in rung 4 treats the two nearest neighbors as point dipoles at a single spacing; summing over the whole lattice changes it by a factor of order one in either direction, which does not touch the three-and-a-half orders of magnitude the argument needs. A book; no link.
  6. K. Hongo, R. Maezono, Y. Kawazoe, H. Yasuhara, M. D. Towler and R. J. Needs, "Interpretation of Hund's multiplicity rule for the carbon atom", Journal of Chemical Physics 121, 7144 (2004). Quantum Monte Carlo on carbon: the high-spin state wins on electron-nucleus attraction, not on reduced electron-electron repulsion. The screening explanation goes back to calculations in the 1970s; I. N. Levine, Quantum Chemistry, gives the textbook account. Free to read at arXiv.
  7. NIST, "CODATA value: Bohr magneton". μB = 9.274 010 0657(29) × 10⁻²⁴ J/T. Rounded to four figures on the page.
  8. X. Fan, T. G. Myers, B. A. D. Sukra and G. Gabrielse, "Measurement of the electron magnetic moment", Physical Review Letters 130, 071801 (2023). g/2 = 1.001 159 652 180 59 (13), a precision of 0.13 parts per trillion. The value on the page is the CODATA-recommended g rounded to eleven figures; the "twelfth digit" agreement with quantum electrodynamics depends on the independent value of the fine-structure constant, and the two best measurements of that constant disagree with each other at a level the paper discusses. So "agrees to the twelfth digit" is the headline, and the fine print is that the twelfth digit is currently limited by α, not by g.
  9. E. M. Purcell and D. J. Morin, Electricity and Magnetism, 3rd edition (Cambridge University Press, 2013), section 5.9. The moving-frame argument for the force on a charge near a current-carrying wire. The copper numbers in rung 6 are mine: 8.5×10²⁸ conduction electrons per cubic meter, 1 mm², 1 A. Change any of them and both sides of the comparison change together, which is the point.
  10. Purcell and Morin (reference 9), sections 5.6 and 6.7. The field of a uniformly moving charge, E = (q/4πε₀) (1 − β²) / (r² (1 − β² sin²θ)^{3/2}), and B = v × E/c². The figure draws exactly that expression with β on the scroll.
  11. P. A. M. Dirac, "The quantum theory of the electron", Proceedings of the Royal Society A 117, 610 (1928). The equation, its four components, and the magnetic moment with g = 2 in section 6 of the paper. Free to read at the Royal Society. The positron's discovery (Anderson, 1932) is a standard history and is given to the year without a separate citation.

Work with Peculiar Materials

Technical and financial diligence on magnetics, magnet manufacturing, and the rare‑earth supply chain — from oxide to finished magnet.

Get in touch