An electromagnet is a magnet produced by electric current flowing through a coil.
The magnetic field of a current-carrying wire becomes much stronger when the wire is wound into many turns. Placing an iron core inside the coil can increase the field further because the material becomes magnetized. Unlike a permanent magnet, an electromagnet can usually be switched on and off by controlling its current.
William Sturgeon demonstrated an early practical electromagnet in 1825 by winding insulated wire around an iron core. His device could lift considerably more iron than an uncoiled current-carrying wire. Joseph Henry later developed powerful electromagnets and improved their construction.
Electromagnets are used in relays, loudspeakers, electric bells, cranes, motors, MRI scanners, and magnetic locks. They should not be confused with permanent magnets, which retain magnetization without a continuously supplied electric current.