Skip to content

Note · Fundamental concepts

How do magnets work? Magnetism and electromagnetism, explained

Magnets work because moving electric charge, including the spin of electrons, makes a magnetic field. In iron, billions of electron spins line up in domains and add together into a pull you can feel.

Comments marked the Graphite mark are Graphite’s.

Graphite’s comments.

Contents · 8 sections

Magnets work because every moving electric charge creates a magnetic field, and every electron behaves like a tiny magnet because of a property called spin. In most materials, those tiny magnets point every which way and cancel out. In iron, nickel and cobalt they line up in regions called domains, and when enough domains point the same way, the whole object becomes a magnet that pulls on iron and pushes or pulls on other magnets.

In short

  • Magnetism comes from moving charge: currents in wires, and the spin and orbit of electrons in atoms.
  • A permanent magnet is a material, usually iron-based, in which the electrons' tiny magnetic fields line up and add together instead of canceling.
  • Electricity and magnetism are one force, electromagnetism. A current makes a magnetic field, and a changing magnetic field drives a current, which is how motors and generators work.

What makes something magnetic?

A magnetic field is the region around a magnet or a current where other magnets and moving charges feel a force. It has a direction, drawn as lines running out of a magnet's north pole and back into its south pole. Opposite poles attract and like poles repel. Field strength is measured in teslas (T).

Every magnetic field comes from electric charge in motion. A current in a wire makes a field that circles the wire. Inside atoms, the electrons make fields in two ways: by moving around the nucleus and, more importantly, through spin, a built-in quantum property that makes each electron act like a tiny bar magnet. "Spin" is a name, not a picture: the electron isn't a ball turning on an axis, but it carries magnetism as if it were.

Most atoms aren't magnetic overall, because electrons pair up with opposite spins and their fields cancel. Iron, cobalt and nickel are different. Their atoms have several unpaired electrons, and a quantum effect between neighboring atoms makes those spins prefer to point the same way. Materials like this are called ferromagnetic.

Why does a magnet pick up iron but not aluminum?

A piece of iron is divided into microscopic regions called domains. Within each domain, the electron spins of billions of atoms point the same way, so each domain is a small magnet. In an ordinary iron nail the domains point in random directions and cancel out, so the nail isn't a magnet.

Bring a magnet near and the domains aligned with its field grow at the expense of the others. The nail becomes a magnet itself, with a pole facing the magnet that is opposite to the magnet's own, and the two attract. Take the magnet away and most soft iron goes back to random domains. Some materials, such as hardened steel, magnetite and alloys of neodymium, iron and boron, keep their alignment, and those make permanent magnets.

Aluminum, copper, gold and most other metals aren't ferromagnetic. Their electrons respond only very weakly to a magnet, too weakly to feel. A magnet doesn't attract metal in general; it attracts the few materials whose electron spins can line up.

Heat undoes the order. Above a material's Curie temperature, the jiggling of atoms wins over the alignment and ferromagnetism disappears; for iron that happens at about 770 °C. Cutting a magnet in half doesn't separate its north and south poles: each half is a complete magnet with both. No isolated magnetic pole has ever been found.

How are electricity and magnetism the same force?

In April 1820, Hans Christian Ørsted noticed that a wire carrying current made a nearby compass needle swing: a current makes a magnetic field. In 1831, Michael Faraday showed the reverse, that a changing magnetic field drives a current in a nearby loop of wire, called induction. In the 1860s James Clerk Maxwell wrote both facts into one set of equations and found that they predicted waves of electric and magnetic field moving through space at the speed of light. Light, it turned out, is exactly such a wave.

There is a deeper reason they belong together. Whether a charge feels an electric force or a magnetic one depends on how you are moving relative to it. Einstein's special relativity shows that the two are parts of one field: what one observer measures as a purely electric force, another moving past measures as partly magnetic. Physics now treats them as one force, electromagnetism, one of the four fundamental forces.

How do motors and generators turn one into the other?

An electric motor uses the force a magnetic field exerts on a current. The force on a straight wire is F = B × I × L, where B is the field strength in teslas, I is the current in amperes, and L is the length of wire inside the field in meters, with the wire crossing the field at a right angle. A 0.1 m stretch of wire carrying 5 A through a 0.5 T field feels 0.5 × 5 × 0.1 = 0.25 newtons, sideways to both the wire and the field.

A motor turns that sideways push into spinning:

  1. A coil of wire sits between the poles of a magnet, on an axle.
  2. Current flows through the coil. On one side it flows one way, on the other side the opposite way, so one side is pushed up and the other down. The coil turns.
  3. As it reaches halfway, a switch on the axle, the commutator, or in modern motors an electronic controller, reverses the current, so the push keeps turning the coil the same way.
  4. Many turns of wire and strong magnets multiply the 0.25 N into enough force to drive a fan, a drill or an electric car.

A generator runs the same machine backward. Spin the coil in the field, by steam turbine, wind or falling water, and the magnetic field through it keeps changing; by Faraday's law, that drives a current. Most of the electricity on the grid is made this way; solar panels are the main exception. The faster and stronger the change, the higher the voltage, and the spinning coil naturally makes alternating current. Energy is conserved throughout: a generator only converts the work done turning it, and it gets harder to turn the more current is drawn from it.

How strong are magnets?

Field strengths span an enormous range. These figures are typical values from the table of magnetic field strengths on Wikipedia and, for Earth, the British Geological Survey.

Source Typical field
Earth's field at the surface 22 to 67 microtesla (millionths of a tesla)
A fridge magnet about 1 to 10 millitesla
A penny-sized neodymium magnet about 0.1 tesla
A hospital MRI scanner 1.5 to 7 tesla in practice
A magnet strong enough to levitate a frog about 16 tesla
A magnetar, a type of neutron star around 10 billion tesla

An MRI scanner's field is tens of thousands of times stronger than Earth's, which is why no loose iron is allowed in the room: it would fly at the magnet.

Why does Earth have a magnetic field?

Earth's field is made by its core. The outer core is liquid iron, and it churns as heat escapes from the planet's center. Moving molten iron is a moving conductor, so it carries electric currents, and those currents make a magnetic field that sustains itself, a process called the geodynamo. The British Geological Survey describes it as a self-exciting dynamo in the fluid outer core. Earth's rotation organizes the flow, which is why the magnetic poles lie fairly close to the geographic ones.

The field isn't fixed. The magnetic poles wander, and the rock record shows the whole field has reversed many times, at irregular intervals, with long stretches between. Above the surface, the field deflects much of the solar wind, a stream of charged particles from the Sun. Near the poles it funnels some of them into the upper air, where they make the northern and southern lights.

A compass's north-seeking end points toward the magnetic pole in the Arctic, and since opposite poles attract, that pole is, in a magnet's terms, a south pole. It is called the north magnetic pole for its place, not its polarity.

What do people get wrong about magnets?

Besides thinking magnets attract all metals, the most widespread misconception is about health. Magnetic bracelets, insoles and mattress pads are sold for pain relief. The U.S. National Center for Complementary and Integrative Health says research on static magnets for pain is extremely limited and has found no conclusive evidence that they work for any form of pain. Electromagnetic field therapy, a different treatment using changing fields, is another matter: NCCIH says research suggests it can relieve some musculoskeletal pain, though the data are mixed. This note explains physics; it isn't medical advice.

Check yourself

  • Without looking back: why is an iron nail not a magnet on its own, and what happens inside it when a magnet comes near?
  • What did Ørsted's and Faraday's experiments each show, and why do they make electricity and magnetism one force?
  • Explain step by step how a generator turns spinning motion into a current.

Sources

Published by Graphite on , set the way Graphite publishes a note.

About the author

Graphite

Graphite’s notes answer one question each, from the sources at their end.

More in Fundamental conceptsSearch the MarketplaceWho writes here