An electromagnet works by running electric current through a coil of wire, which generates a magnetic field around it. Place a core of iron or another magnetic material inside that coil, and the field concentrates and strengthens dramatically. Cut the current, and the magnetism disappears. That on-off controllability is what separates an electromagnet from a permanent magnet and makes it useful in everything from junkyard cranes to MRI machines.
Current Through a Wire Creates a Magnetic Field
The physics behind every electromagnet traces back to a relationship between electricity and magnetism that was first demonstrated in 1820. The Danish scientist Hans Christian Ørsted noticed that when he switched on a battery-powered current through a wire, a nearby compass needle swung away from magnetic north. When the current stopped, the needle returned. He had found that a flowing electric current produces a magnetic effect in the space around it.1The Royal Society. The birth of the electric machines: a commentary on Faraday (1832) ‘Experimental researches in electricity’ That relationship is the entire foundation of electromagnets: wherever current flows, magnetism follows.
A single straight wire produces only a weak, circular magnetic field around itself. The field wraps around the wire like invisible rings. By itself, that is not very useful. But if you wind the wire into a coil of many loops, something powerful happens. Each loop’s field overlaps with the next, and the fields all add together inside the coil. The result is a concentrated magnetic field running through the center of the coil, much like the field through a bar magnet. More loops mean more overlap and a stronger field. This coil arrangement is called a solenoid, and it is the heart of every electromagnet.
The Key Parts
Every electromagnet, from a simple science-fair project to an industrial lifting magnet, has three essential components working together.
- The coil: A length of wire, usually copper, wound into many turns. Copper is the standard choice because it conducts electricity well without wasting too much energy as heat. The number of turns and the tightness of the winding directly affect how strong the magnetic field will be.
- The core: A piece of magnetic material, most often soft iron or a similar alloy, placed inside the coil. The core does not generate the field on its own. Instead, it channels and amplifies the field the coil produces. Without a core, you still get a magnetic field, but it is far weaker. A good core can multiply the field strength by hundreds or even thousands of times.
- The power source: A battery, power supply, or electrical circuit that drives current through the coil. The amount of current and the voltage determine how much energy goes into creating the magnetic field. Increase the current, and the field gets stronger. Shut off the power, and the field collapses.
Some designs add extra components like a housing, pole pieces to shape the field at the ends of the core, or cooling systems. But the coil, core, and power source are the three parts that define the device.
Why the Core Material Matters So Much
The core is arguably the most important design choice in an electromagnet. Not all metals behave the same way when exposed to a magnetic field, and the wrong material can ruin the whole point of the device.
Magnetic materials are broadly classified as “soft” or “hard,” and the distinction is about what happens after you remove the external field. Soft magnetic materials magnetize easily when current flows through the coil and give up that magnetism almost completely when the current stops. Hard magnetic materials hold on to their magnetism stubbornly, which is exactly what you want in a permanent magnet but exactly what you do not want in an electromagnet. Iron and most iron-based alloys have very low resistance to demagnetization, which makes them natural choices for soft magnetic applications.2ScienceDirect. Hard and semi-hard Fe-based magnetic materials
If you used a hard magnetic material as your core, the electromagnet would not fully “turn off” when you cut the current. The core would retain residual magnetism, and your crane would still be weakly gripping whatever it was supposed to drop. Soft iron cores avoid this problem. They amplify the field while the current is on and let go when it stops. Silicon steel, a common alloy used in transformer cores, takes this a step further by reducing energy losses during rapid cycling of the field.
Air-core electromagnets also exist. These skip the metal core entirely and rely only on the coil. The trade-off is obvious: far less field strength for the same current. Air-core designs show up in situations where you need an extremely precise, linear relationship between current and field, or where a metal core would introduce unwanted distortions.
What Controls the Strength
Three factors determine how strong an electromagnet’s field will be, and all three are under the designer’s control.
The first is current. More electric current flowing through the coil means a stronger magnetic field. This is a direct, proportional relationship at low field strengths: double the current, and you roughly double the field. At very high currents, things get more complicated because the core can become magnetically saturated, meaning its atomic magnetic domains are all aligned and it physically cannot contribute any more to the field. Past that saturation point, pumping in more current produces diminishing returns.
The second factor is the number of turns in the coil. Each additional loop adds its field contribution to the total. A coil with 500 turns produces roughly ten times the field of a coil with 50 turns, assuming the same current. In practice, adding turns also adds electrical resistance, which can limit the current you can push through without overheating the wire.
The third factor is the core material’s ability to amplify the field. This property, called permeability, varies widely among materials. Soft iron might amplify the coil’s field by several hundred times. Specialized alloys can do even better. The choice of core sets a ceiling on how much the device can amplify a given coil-and-current combination.
Designers balance all three factors against practical constraints like power consumption, heat, size, and weight. A small, lightweight electromagnet in a door lock might use many turns of fine wire and modest current. A massive lifting magnet at a scrapyard might use thick cable, high current, and a heavy iron core.
The Heat Problem
Every electromagnet generates heat, and managing that heat is one of the biggest engineering challenges in high-field designs. The current flowing through the coil encounters electrical resistance in the wire, and that resistance converts some of the electrical energy into heat. The higher the current, the more heat is produced, and it scales up quickly because heat generation depends on the square of the current. Double the current, and you produce four times the heat.
For small electromagnets running at low currents, this is not a serious concern. Air cooling or even no cooling at all works fine. But for high-field laboratory or industrial electromagnets, heat can melt insulation, warp the core, or simply waste enormous amounts of energy. A classic approach to high-field continuous-duty electromagnets is the Bitter magnet design, named after physicist Francis Bitter. These use a stack of alternating copper conducting layers and insulating spacers, with water channels running between the copper layers to carry away heat. The key to making this work is keeping the distance between the water and the hottest part of the copper very short, roughly a millimeter, so heat does not have time to build up.3PubMed. Efficient continuous-duty Bitter-type electromagnets for cold atom experiments The geometry maximizes the ratio of cooled surface area to copper volume, letting the magnet sustain high fields continuously without burning itself out.
Superconducting electromagnets bypass the heat problem almost entirely. Certain materials, when cooled to extremely low temperatures (often using liquid helium), lose all electrical resistance. Current flows through them with zero energy wasted as heat, which means you can sustain enormous magnetic fields indefinitely without needing a continuous power supply. MRI machines in hospitals rely on superconducting coils for exactly this reason. The trade-off is the cost and complexity of the cryogenic cooling system needed to keep the coil cold enough.
Electromagnets Versus Permanent Magnets
Permanent magnets and electromagnets both produce magnetic fields, but the comparison mostly ends there. A permanent magnet’s field is always on. Its strength is fixed by the material it is made from, and you cannot change it without physically altering or heating the magnet. An electromagnet’s field exists only while current flows, and you can tune the strength by adjusting the current.
Permanent magnets are made from hard magnetic materials with high resistance to demagnetization. Common examples include neodymium-iron-boron alloys and ferrite ceramics. Their energy product, a measure of how much magnetic energy the material stores, depends on both how strongly the material magnetizes and how stubbornly it holds on to that magnetization.2ScienceDirect. Hard and semi-hard Fe-based magnetic materials Electromagnets, by contrast, deliberately use soft materials that let go of magnetism easily. The two classes of magnets are built from fundamentally different material strategies because they have opposite goals.
There are situations where each type wins. Permanent magnets are compact, need no power, and work well for constant-field applications like refrigerator magnets, speakers, and small motors. Electromagnets dominate whenever you need to switch the field on and off, vary the field strength, or reach field strengths far beyond what permanent magnets can achieve. The strongest continuous magnetic fields in the world, produced at national laboratory facilities, come from electromagnets consuming megawatts of electrical power.
Common Applications
Electromagnets are everywhere in modern life, though you rarely see them exposed. Here are some of the places they do their work:
- Electric motors: Nearly every motor, from the one spinning your washing machine drum to the one driving an electric car, uses electromagnets. Switching the current in carefully timed patterns creates rotating magnetic fields that push a rotor around.
- Relays and contactors: An electromagnet pulling a metal armature can open or close an electrical switch. This lets a small control current safely switch a much larger power circuit on and off, which is fundamental to industrial control systems.
- Solenoid actuators: Electromagnets can pull or push a plunger in a straight line. This linear motion runs everything from fuel injectors in car engines to the locking pins in electronic door locks. An electromagnetic solenoid can even serve as the basis for a reciprocating engine concept, where copper-wound solenoids convert electrical energy into plunger motion that a crankshaft and flywheel assembly turns into continuous rotation.4International Journal for Research in Applied Science and Engineering Technology. Design, Electromechanical Dynamics, and Metrological Evaluation of an Electromagnetic Solenoid Engine
- MRI scanners: Hospital MRI machines use powerful superconducting electromagnets to create the strong, uniform magnetic field needed to image the inside of the human body.
- Scrap handling: The stereotypical junkyard electromagnet, a large round magnet on a crane, picks up ferrous scrap metal by turning on and drops it by turning off. This is the simplest, most visible demonstration of why controllability matters.
- Particle accelerators: Research facilities use arrays of precision electromagnets to bend and focus beams of charged particles traveling near the speed of light.
What all these applications share is a need to control the magnetic field actively, something no permanent magnet can offer.
AC Versus DC Electromagnets
Most explanations of electromagnets assume direct current (DC), where the current flows steadily in one direction. But many real-world electromagnets run on alternating current (AC), where the current reverses direction many times per second. The distinction matters because it changes how the electromagnet behaves and what engineering problems arise.
A DC electromagnet produces a steady magnetic field as long as the current is steady. This is ideal for applications like lifting magnets or MRI systems where you want a constant field. An AC electromagnet’s field reverses direction in sync with the current, typically 50 or 60 times per second depending on the local power grid frequency. This oscillating field is useful in applications like transformers, which transfer electrical energy between circuits, and in AC solenoid valves.
The catch with AC electromagnets is energy loss. Every time the magnetic field in the core reverses direction, the core’s internal magnetic domains must flip, and that process wastes a small amount of energy as heat on each cycle. This is called hysteresis loss. On top of that, the changing magnetic field induces small circulating currents inside the core itself, which waste additional energy. To reduce these losses, AC electromagnet cores are almost always built from thin, insulated sheets (laminations) of steel stacked together, rather than a single solid block. The laminations interrupt the circulating currents and cut losses dramatically. If you have ever seen a transformer core and noticed it looks like a stack of thin plates rather than a solid chunk of metal, that is why.
Shielding and Managing Stray Fields
An electromagnet’s field does not stay neatly confined inside the device. Magnetic field lines form closed loops, emerging from one pole of the magnet, arcing through the surrounding space, and returning to the other pole. This stray field can interfere with nearby electronics, magnetize tools or instruments you want to keep nonmagnetic, or create safety hazards around very strong magnets.
Shielding works by giving the stray field an easier path through a high-permeability material rather than through open air. A sheet or enclosure of a suitable material placed around the electromagnet (or around the object you want to protect) redirects the field lines into itself, dramatically reducing the field in the shielded region. For fields up to about one tesla, specialized nickel-iron alloys known as mu-metal are a common choice because of their very high permeability. When fields get stronger, in the range of one to several tesla, mu-metal saturates and stops working well. At those intensities, shielding with ferromagnetic or diamagnetic materials in different configurations becomes necessary.5International Journal of Advancements in Technology. Strong Magnetic Shielding by Common Available Material
In practice, shielding design is always a compromise. Thicker shields and cage-like enclosures provide better protection but add weight, cost, and bulk. The geometry matters too: a complete enclosure performs far better than a flat plate placed on one side. Engineers working with high-field magnets in research settings often build dedicated shielded rooms, while consumer electronics manufacturers integrate thin shielding layers into device housings to keep small magnets from affecting nearby components.
Why the Air Gap Matters in Electromagnet Design
One design detail that surprises people is how much the air gap, the empty space between the poles of an electromagnet or between the magnet and the object it is acting on, affects performance. Magnetic field lines travel much more easily through iron or steel than through air. An air gap in the magnetic circuit acts like a bottleneck, forcing the field to spread out and weaken as it crosses the gap.
This is why an electromagnet gripping a steel plate directly against its face is dramatically stronger than the same magnet holding the plate at even a small distance. It is also why the pole pieces at the ends of laboratory electromagnets are carefully machined to be flat and parallel, minimizing the gap and keeping the field as uniform and strong as possible in the working region between them.
In some applications, the air gap is an intentional part of the design. Electric motors and generators have a small, precisely controlled gap between the rotor and stator electromagnets. Making that gap smaller increases efficiency, but it cannot be eliminated entirely because the rotor needs room to spin. Transformer cores, by contrast, are designed with the tightest possible magnetic circuit and ideally no air gap at all, because any gap wastes energy.
The sensitivity to air gaps also explains why electromagnet-based lifting systems have weight ratings that assume direct contact with the load. Try to pick up the same load with a layer of paint, rust, or non-magnetic material between the magnet face and the steel, and the effective lifting force drops significantly. Industrial operators learn quickly that surface preparation on the load matters almost as much as the magnet’s rated strength.