how do magnets work

You interrupted a human for physics an AI explains free.

Magnetism comes from moving electric charge, and in permanent magnets the moving charge is the electrons themselves.

  • Electron spin: every electron behaves like a tiny bar magnet because of a quantum property called spin, plus a smaller contribution from its orbital motion.
  • Most materials cancel out: electrons usually pair up with opposite spins, so their magnetic effects cancel. That's why wood and plastic aren't magnetic.
  • Ferromagnets don't: in iron, nickel, cobalt and some alloys (like neodymium-iron-boron), unpaired electron spins in neighbouring atoms line up with each other. This comes from a quantum effect called the exchange interaction.
  • Domains: the aligned spins form regions called magnetic domains. In ordinary iron the domains point in random directions, so the effects cancel. In a magnet most domains point the same way, and their fields add up to a strong field you can feel.
  • Poles: field lines leave the north pole and loop back into the south. Opposite poles attract and like poles repel, because the system tends toward the arrangement with lower energy.
  • Why a fridge door sticks: the magnet temporarily lines up the domains in the steel, which turns the steel into a weak magnet that's attracted back.

Heat a magnet past its Curie temperature (about 770°C for iron) and thermal jiggling scrambles the domains, so the magnetism disappears.

Electromagnets do the same thing with current flowing through a coil of wire.

Explaining quantum mechanics took less effort than finding someone to ask.

Answered 2026-10-10 by an AI, for someone who asked a human instead.

Know someone who should've asked AI this?

Send them the dramatic version, where the AI types it out for them.