| HowItWorksLab · Physics
English

How an Electromagnet Works

An electromagnet is a magnet you can switch on and off. Current from a battery flows through a coil of wire wrapped around a soft-iron core. The current turns the iron into a magnet, drawing in nearby iron, and the moment the switch opens the magnetism vanishes.

How an electromagnet works · schematic Close the switch → current flows through the coil → the core is magnetized → it lifts the nail Field lines (magnetic field) leave N, travel through space back to S Iron core (soft iron) magnetized, becomes a magnet Magnetic domains (aligned) after current, they turn to line up Coil (winding) current makes the field N N pole (north) field lines emerge here S S pole (south) field lines re-enter here Iron nail (ferromagnetic) pulled toward the pole Current flow along the wire into the coil − + Battery (DC supply) supplies steady current Switch closing it completes the circuit A current-carrying wire has a magnetic field around it — wound on the iron core the fields add up, and the core is magnetized into a magnet
What happens, in order Current flows → Field forms → Core magnetised → Iron attracted → Switch off → magnet off
Display mode

Detailed Explanation

What is an electromagnet?

An electromagnet is a magnet that only exists while electricity is flowing through it. Its two essential parts are a coil of insulated wire and a core of soft iron. Pass a current through the coil and the assembly becomes magnetic; stop the current and the magnetism fades away within moments. That on-and-off behaviour is what separates an electromagnet from a permanent magnet.

Why it is useful

Because it can be switched, an electromagnet can grab and release, sort scrap metal, open a valve or ring a doorbell. Its strength can also be tuned simply by changing the current, or by adding more turns of wire — something a permanent magnet can never do. It is the same idea, scaled up, that drives motors, generators, relays and loudspeakers.

Reading the diagram

The soft-iron bar runs across the middle with the coil wound around it. The dashed blue lines inside the bar are the magnetic domains lining up; the curved blue lines outside are the field lines, running from the north pole round to the south pole. Below, the battery and switch show where the current comes from, and the small dashed arrows trace the current as it flows through the wire and the coil.

Components & their role

1. Close the switch, and current starts to flow

The battery drives a current around the circuit. It leaves one terminal, travels along the wire, through the coil and back to the other terminal. Until the switch is closed the circuit is broken, so no current flows and nothing happens.

2. Every turn of the coil makes its own field

A single current-carrying wire already makes a magnetic field around itself. Winding the wire into a coil stacks many such fields on top of one another, all pointing the same way, so the combined field around the coil is much stronger than any one turn.

3. The iron core concentrates the field

Inside the soft-iron core are countless tiny regions called domains, each acting like a small magnet. Usually they point in random directions and cancel out. The coil's field lines them up, and once aligned, they all add their strength together — which is why the core multiplies the magnetism.

4. The core becomes a magnet with two poles

With the domains aligned, the bar behaves as a magnet: one end becomes the north pole, the other the south pole. Field lines emerge from the north pole, curve through the space around the magnet, and return to the south pole, forming closed loops.

5. The magnet attracts iron, then switches off

A magnetic north or south pole pulls nearby iron toward it, so the core lifts an iron nail. Break the circuit and the current stops; the domains relax back to random directions and the field collapses. The iron loses its magnetism, and the nail falls.

What is an electromagnet?

It is a magnet that only works while electric current flows. A coil of wire wrapped around a soft-iron core produces a magnetic field when current passes through it, and the magnetism disappears the moment the current is switched off.

Why wrap the wire into a coil instead of using a straight wire?

Every current-carrying wire makes a small magnetic field. Coiling the wire stacks the field of every turn in the same direction, so the fields add up around the core and the effect becomes strong enough to be useful.

What does the iron core actually do?

The soft-iron core concentrates and strengthens the field, because its internal magnetic domains line up with the coil's field. Soft iron is used rather than steel because it magnetises easily and loses its magnetism just as easily when the current stops.

Does reversing the current change the magnet?

Yes. Reversing the direction of the current reverses the magnetic field, so the north and south poles swap ends. The strength stays the same; only the direction of the field flips.

Why do electromagnets get warm?

The coil has resistance, so current through it produces heat. More current gives a stronger field but also more heat, and that heating is the main practical limit on how hard an electromagnet can be driven.

Common Misconceptions

An electromagnet stays magnetic after the power is cut. It is easy to picture it behaving like an ordinary bar magnet once it has been switched on.
The field exists only while current flows. Open the switch and the soft-iron core quickly loses its magnetism, which is exactly what makes it so useful.
The iron core is the source of the magnetism. Because the core is what visibly pulls the nail, it looks like the origin of the field.
The coil makes the field; the core amplifies it. Current in the wire creates the field, and the iron core simply lines its domains up with it to make the field much stronger.
More turns of wire always means a bigger current. Adding turns is assumed to push more electricity through the coil.
Turns and current are separate. Extra turns strengthen the field for the same current, but they also add resistance — the current itself is set by the supply and the circuit.
Disclaimer: Diagrams are heavily simplified for educational demonstration only. Real-world systems contain far more variables and complexity. Not for engineering production use. Not financial, political or professional advice.