From electron spin to fridge doors

How Magnets Work

A magnet works because the tiny magnetic fields of its electrons point mostly the same way, so they add up into one large field that reaches outside the material. Each electron behaves like a miniature magnet thanks to its spin. In iron, nickel and cobalt, neighboring atoms line these up in groups called domains, and a permanent magnet is a material whose domains stay aligned.

Silver disc magnets and a horseshoe magnet pulling steel paperclips and ball bearings toward them on a gray surface
Magnets pull on steel because their aligned electron spins create a field that reaches beyond the magnet.

At a Glance

Magnets work because the spins of electrons in materials such as iron line up in the same direction, and their small magnetic fields add into one strong field with a north and a south pole. Opposite poles attract, like poles repel, and the field inside a current loop is B = μ0 N I / (2R), showing that all magnetism comes from moving charge.

What makes it magnetic
Aligned electron spins grouped into magnetic domains
Poles
Always a north and a south; no single pole has ever been found
Rule of poles
Opposites attract, like poles repel
Field unit
tesla (T)
Current-loop formula
B = μ0NI / (2R)
Main magnetic metals
Iron, nickel, cobalt and some rare-earth alloys
On this page
  1. How Does a Magnet Work?
  2. Magnets Explained Simply
  3. What Causes a Magnet to Be Magnetic?
  4. What Are Magnetic Domains?
  5. Why Do Magnets Attract and Repel?
  6. Why Does a Magnet Have Two Poles?
  7. Why Does a Magnet Stick to Some Metals but Not Others?
  8. What Is the Difference Between Permanent and Temporary Magnets?
  9. How Is a Magnet Like a Loop of Current?
  10. How Do Electromagnets Work?
  11. Where Are Magnets Used in Everyday Life?
  12. Common Misconceptions
  13. Key Facts
  14. Quiz
  15. FAQ

How Does a Magnet Work?

A magnet is a piece of material whose atoms all add their small magnetic effects in the same direction. The result is a magnetic field that spreads out into the space around the magnet, strongest near its ends and weaker farther away. Anything magnetic that enters that field gets pulled, pushed or turned.

The ends where the field is concentrated are called poles. One is the north pole and the other is the south pole, named after the way a freely hanging magnet turns to point along Earth's field. Field lines leave the north pole, loop around outside the magnet and return to the south pole.

The deeper question is where the field comes from in the first place. The answer lies inside atoms, with the electrons themselves.

Field lines around a bar magnet leaving the north pole and entering the south pole, closely spaced near both poles
A bar magnet's field leaves the north pole and returns to the south pole, strongest where the lines crowd together.

Magnets Explained Simply

Imagine a huge crowd where every person holds a tiny flashlight. If everyone points their light in a random direction, the room stays dim and patchy. If everyone turns to face the same wall, that wall lights up brightly.

A magnet is like the crowd that faces the same way. Every electron carries a tiny bit of magnetism. In most materials those bits point every which way and cancel out. In a magnet, a huge number of them line up, so their little effects join into one big, useful pull.

When you break a magnet in half, you do not get a separate north piece and south piece. You get two smaller magnets, each with both poles, because the lined-up crowd is still facing the same way in each half.

What Causes a Magnet to Be Magnetic?

Every magnetic field comes from electric charge in motion. In a magnet, that motion happens inside atoms. Electrons have a built-in property called spin that makes each one act like an extremely small bar magnet. Their motion around the nucleus adds a smaller magnetic effect too.

In most atoms the electrons pair up with opposite spins, so their magnetism cancels. Iron, nickel and cobalt are different. Their atoms keep several unpaired electrons, and a quantum effect called exchange interaction makes the spins of neighboring atoms prefer to point the same way. That cooperative lining up is called ferromagnetism.

So the honest answer to "why is a magnet magnetic" is a stack of reasons: electrons are tiny magnets, some atoms leave them unpaired, and in a few metals the neighbors agree to point together.

What Are Magnetic Domains?

Even in iron, the spins do not all line up across a whole object. Instead the metal splits into small regions called magnetic domains, often a fraction of a millimeter across. Inside one domain, the atoms point the same way. Neighboring domains point in different directions.

In an ordinary iron nail the domains face every which way, so their fields cancel and the nail does not act as a magnet. Bring a strong magnet near and the domains that already point along its field grow while the others shrink. The nail becomes magnetized for as long as the magnet is close.

A permanent magnet is a material in which the domains stay aligned after the outside field is taken away. Manufacturers make one by exposing a suitable alloy to a very strong field, often combined with heat treatment, so the alignment locks in.

Why Do Magnets Attract and Repel?

Bring the north pole of one magnet near the south pole of another and they pull together. Bring two north poles or two south poles together and they push apart. This is the rule of poles: opposites attract and like poles repel.

Field lines give a good picture of why. Between opposite poles, the lines run straight from one magnet into the other, and like stretched rubber bands they tend to pull the magnets together. Between like poles, the lines from each magnet bend away from each other and squeeze into the gap, which pushes the magnets apart.

The force also drops off very quickly with distance. Two small magnets that snap together from a centimeter away may barely notice each other at ten centimeters. That steep falloff is why magnets seem to jump the last little distance.

Why Does a Magnet Have Two Poles?

Because its magnetism is built from loops. Every electron spin, and every loop of current, produces a field that comes out of one side and goes back into the other. Stack billions of them in the same direction and the whole magnet has the same two-sided pattern, a north face and a south face.

This is why no one has ever isolated a single magnetic pole, called a monopole. Cut a bar magnet into ever smaller pieces and every piece, down to a single atom, still has both a north and a south. Some theories predict monopoles might exist, but careful searches have never found one.

Why Does a Magnet Stick to Some Metals but Not Others?

A magnet sticks to steel because it first turns the steel into a temporary magnet. Its field lines up the domains in the nearby steel so that a south pole forms right next to the magnet's north pole. Opposite poles attract, and the magnet clings. Pull the magnet away and most of that alignment fades.

Aluminum, copper, gold, brass and most stainless steels used for kitchen sinks have no domains to line up, so a magnet barely reacts to them. Their magnetic response, called paramagnetism or diamagnetism, is thousands of times weaker. Water is weakly repelled by a magnet, an effect strong enough to float a living frog in an extremely powerful laboratory field.

Chain of steel paperclips hanging from a bar magnet, each clip temporarily magnetized and holding the next one
Each paperclip becomes a temporary magnet and holds up the next one, until the chain gets too far from the magnet.

What Is the Difference Between Permanent and Temporary Magnets?

A permanent magnet keeps its magnetism without help because its domains are locked in place. Fridge magnets, compass needles and the magnets in speakers are all permanent. A temporary magnet, such as a paperclip near a magnet, is magnetized only while it sits in an outside field. Our page on permanent and induced magnets looks at this more closely.

Permanent magnets can still lose their strength. Heating a magnet above a certain temperature, called the Curie temperature after Pierre Curie, shakes the spins out of line and the magnetism vanishes. Hard knocks and strong opposing fields can also scramble the domains. The tables list common magnet materials and the Curie temperatures of the magnetic elements.

Example 3 Matching a fridge magnet with a coil

You want a flat 200-turn coil of radius 4.0 cm (0.040 m) to produce 5.0 mT (0.0050 T) at its center, about the field at the face of a fridge magnet. What current does it need?

  1. Given:
    • magnetic field at the center: B=0.005 T
    • loop radius: R=0.04 m
    • permeability of free space: μ0=1.257×10−6 T·m/A
    • number of turns: N=200
  2. Formula: I=2RBμ0N
  3. Substitute: B=0.005 T,R=0.04 m,μ0=1.257×10−6 T·m/A,N=200
  4. Answer: I=1.592 A

A modest current does the job, but the coil only works while the current flows, whereas the fridge magnet needs no power at all.

Common permanent magnet materials compared
MaterialRelative strengthHandles heatTypical uses
Neodymium (NdFeB)StrongestPoor to fairEarbuds, phone vibrators, electric car motors, hard drives
Samarium-cobaltVery strongVery goodAerospace sensors, high-temperature motors
Alnico (aluminum, nickel, cobalt)ModerateExcellentGuitar pickups, classic meters, sensors
Ferrite (ceramic)Moderate to weakGoodFridge magnets, loudspeakers, toys
Flexible bonded magnetWeakPoorMagnetic sheets, fridge door seals
Source: Typical qualitative properties of commercial magnet materials · Retrieved October 2026
Curie temperatures of the ferromagnetic elements (above this, magnetism disappears)
ElementCurie temperature (°C)Curie temperature (K)
CobaltAbout 1,115About 1,388
IronAbout 770About 1,043
NickelAbout 358About 631
GadoliniumAbout 20About 293
Source: Typical published values, rounded; kelvin = °C + 273.15 (computed) · Retrieved October 2026

How Is a Magnet Like a Loop of Current?

A circular loop of wire carrying current produces a field that looks just like the field of a short bar magnet: lines go in through one face and out through the other. That is a strong hint about what an atomic magnet really is, a tiny circulating charge.

At the center of a flat coil of N turns and radius R carrying current I, the field strength is B=μ0NI2R. More turns or more current make the field stronger, and a smaller coil concentrates it. The constant μ0, the permeability of free space, is about 1.2566×10−6 T·m/A. For a deeper look at this result, visit the magnetic field of a current loop, or check numbers with the magnetic field calculator.

A loop of current is the simplest magnet you can calculate. Here is the field at its center with each symbol and its SI unit.

B=μ0NI2R
What each symbol means
SymbolQuantitySI unit
Bmagnetic field at the centertesla (T)
μ0permeability of free space (4π × 10⁻⁷ T·m/A (approximately; 1.2566 × 10⁻⁶ T·m/A))tesla meter per ampere (T·m/A)
Nnumber of turnsdimensionless (1)
Icurrentampere (A)
Rloop radiusmeter (m)

Rearranged to find another variable:

I=2RBμ0NR=μ0NI2B

Valid for: flat circular coil; at the center only.

Example 1 Field at the center of a homemade coil

A student winds 100 turns of wire into a flat circular coil of radius 5.0 cm (0.050 m) and passes 2.0 A through it. What is the magnetic field at the center of the coil? Use μ0 = 1.25663706127 × 10⁻⁶ T·m/A.

  1. Given:
    • permeability of free space: μ0=1.257×10−6 T·m/A
    • number of turns: N=100
    • current: I=2 A
    • loop radius: R=0.05 m
  2. Formula: B=μ0NI2R
  3. Substitute: μ0=1.257×10−6 T·m/A,N=100,I=2 A,R=0.05 m
  4. Answer: B=0.002513 T

That is about fifty times Earth's field, made with nothing more than a battery and a reel of wire.

Wire with current into the page surrounded by circular clockwise magnetic field lines, showing current makes a magnetic field
Moving charge makes every magnetic field, from a wire carrying current to the spinning electrons inside a magnet.

How Do Electromagnets Work?

An electromagnet is a coil of wire, usually wrapped around an iron core, that becomes a magnet only while current flows. The coil produces a field on its own, and the iron core multiplies it by lining up its domains in the same direction. Switch off the current and the soft iron loses almost all of its magnetism.

That on-off control makes electromagnets useful in scrapyard cranes, door locks, relays, MRI scanners and every electric motor. You can make one with a nail, wire and a battery in our build an electromagnet experiment, and see how the two kinds stack up in electromagnet vs permanent magnet.

Example 2 Inside a long air-core coil

A long coil 10 cm (0.10 m) in length has 500 turns and carries 1.5 A. What is the magnetic field inside it, far from the ends, with no iron core?

  1. Given:
    • permeability of free space: μ0=1.257×10−6 T·m/A
    • total number of turns: N=500
    • current: I=1.5 A
    • length of the solenoid: ℓ=0.1 m
  2. Formula: B=μ0nI=μ0NIℓ
  3. Substitute: μ0=1.257×10−6 T·m/A,N=500,I=1.5 A,ℓ=0.1 m
  4. Answer: B=0.009425 T

Sliding an iron rod into the coil can multiply this field hundreds of times, which is the whole trick of an electromagnet.

Where Are Magnets Used in Everyday Life?

  • Fridge doors seal shut with a flexible magnetic strip in the rubber gasket.
  • Speakers and earbuds use a permanent magnet and a coil to turn electrical signals into sound.
  • Electric motors and generators in cars, fans, wind turbines and power plants rely on magnets and coils working together.
  • Compasses are small magnets free to turn in Earth's magnetic field; see how a compass works.
  • Maglev trains float above their track using strong magnetic forces, explained on the magnetic levitation page.
  • Recycling plants pull steel cans out of mixed waste with large magnets.

For younger learners, our magnets for kids page covers the same ideas with simple activities, and the magnetism worksheets offer printable practice.

Common Misconceptions

Myth: Magnets attract all metals.

Physics: Only a few metals, mainly iron, nickel, cobalt and their alloys, are strongly attracted. Aluminum, copper, gold, silver and brass are not.

Myth: Cutting a magnet in half separates its north and south poles.

Physics: Each half becomes a complete magnet with its own north and south pole. A single isolated pole has never been found.

Myth: Bigger magnets are always stronger.

Physics: Material matters more than size. A small neodymium magnet can hold far more weight than a much larger ferrite magnet.

Myth: A permanent magnet lasts forever no matter what.

Physics: Heat, strong opposing fields and repeated hard knocks can scramble its domains and weaken or erase its magnetism.

Key Facts

  • A magnet works because the magnetic fields of its electrons point mostly in the same direction and add up.
  • Electron spin makes each electron act like a tiny magnet; unpaired spins in iron, nickel and cobalt can line up together.
  • Inside magnetic metals, aligned atoms form regions called magnetic domains.
  • Opposite poles attract and like poles repel, and every magnet has both a north and a south pole.
  • A magnet sticks to steel by briefly magnetizing it, but it barely affects aluminum, copper or gold.
  • Heating a magnet above its Curie temperature destroys its magnetism.
  • A loop of current acts like a magnet, with a center field of B = μ0NI/(2R).
Did you know? Gadolinium loses its magnetism at about room temperature, so a piece of it can be strongly attracted to a magnet on a cool morning and barely react on a warm afternoon.

Quick Quiz: How Well Do You Know How Magnets Work?

6 questions. Tap an answer to check it.

  1. What is the main source of magnetism in a permanent magnet?

  2. Two magnets are placed with their north poles facing. What happens?

  3. A bar magnet is cut in half. What do you get?

  4. Which of these is strongly attracted to a magnet?

  5. What happens to a magnet heated above its Curie temperature?

  6. What are magnetic domains?

Frequently Asked Questions

How does a magnet work in simple terms?

Every electron behaves like a very tiny magnet. In most materials these tiny magnets point in random directions and cancel out. In a magnet, huge numbers of them point the same way, so their small effects add into one strong magnetic field. That field reaches out from the magnet's poles and pulls on iron, steel and other magnets nearby.

Why is a magnet magnetic?

A magnet is magnetic because the electron spins inside it are lined up. Iron, nickel and cobalt atoms have unpaired electrons, and a quantum effect makes neighboring atoms prefer to point their spins together. When a suitable material is magnetized in a strong field, large regions stay aligned. The combined field of all those aligned spins is what we call the magnet's magnetism.

Why do magnets attract?

Opposite poles attract. When a north pole faces a south pole, the field lines run directly from one magnet into the other and the magnets are pulled together, much like stretched elastic bands. A magnet also attracts plain iron or steel by turning it into a temporary magnet, with an opposite pole forming right next to it, so the two always attract.

Why do magnets repel?

Like poles repel. When two north poles or two south poles face each other, the field lines from both magnets crowd into the gap and bend away from each other, which pushes the magnets apart. Repulsion only happens between two magnets. A magnet never repels a plain piece of iron, because the iron always magnetizes itself the way that produces attraction.

Why does a magnet have two poles?

A magnet's field is made from countless tiny loops of moving charge and electron spins, and each one has a field that exits one side and enters the other. Lined up together, they give the whole magnet a north side and a south side. Breaking the magnet only creates smaller magnets that each still have two poles.

Why does a magnet stick to a fridge?

Most fridge doors are made of steel, which contains iron. The magnet's field lines up the magnetic domains in the steel just under it, creating an opposite pole right beside the magnet. Opposite poles attract, so the magnet clings. Fridge magnets are usually weak ferrite or flexible magnets, strong enough to hold paper but easy to pull off.

Can a magnet lose its magnetism?

Yes. Heating a magnet above its Curie temperature scrambles its aligned spins and wipes out its magnetism. Strong fields in the opposite direction, hard and repeated impacts, and in some materials slow aging can also weaken it. Storing magnets in pairs with opposite poles together, or with a steel keeper across the poles, helps them keep their strength.

What is the strongest type of magnet?

The strongest permanent magnets are neodymium magnets, made from an alloy of neodymium, iron and boron. A small one can hold many times its own weight. Electromagnets can go much further: superconducting coils in research labs and MRI scanners produce steady fields of several teslas, far stronger than any permanent magnet, as long as current keeps flowing.

Physics Tribune Editorial Team
Written by our editors and checked against NIST and BIPM reference data. Every worked example is recomputed in code. Read our editorial policy. Last updated October 2026.