An electromagnet is made by wrapping insulated wire into a coil around a core, usually iron, and running electric current through the wire. The flowing current generates a magnetic field around the coil, and the iron core concentrates and strengthens that field dramatically. Unlike a permanent magnet stuck to your refrigerator, an electromagnet can be switched on and off, and its strength can be dialed up or down simply by changing the current. This on-demand controllability is what makes electromagnets indispensable across modern technology, from junkyards and hospitals to high-speed trains.
The Three Essential Parts
Every electromagnet, whether it fits on a tabletop or fills a room, is built from the same three components: a conductor, a core, and a power source. The conductor is wire, almost always copper, wrapped into a tight coil. Copper is the go-to choice because it carries electricity efficiently without wasting too much energy as heat. The wire needs to be insulated, typically with a thin enamel or plastic coating, so that each loop in the coil remains electrically separate from its neighbors. Without insulation, current would short-circuit between adjacent loops and the coil would not build a proper magnetic field.
The core sits inside the coil. In most electromagnets this is a rod or cylinder of soft iron, though steel, ferrite, and other ferromagnetic materials work too. The core is not strictly required to create a magnetic field; a coil with nothing inside it, sometimes called an air-core solenoid, still produces one. But the core amplifies the field by a factor that can range from hundreds to thousands, depending on the material. That amplification is why virtually all practical electromagnets include a core.
The power source is whatever delivers current to the wire: a battery for a simple science-fair project, a regulated power supply in a laboratory, or a massive industrial electrical system for a scrapyard crane. Direct current (DC) produces a steady magnetic field. Alternating current (AC) produces a field that flips direction many times per second, which is useful for certain applications but not for others.
How Current Creates a Magnetic Field
When electric current flows through a straight wire, it produces a weak circular magnetic field around the wire. You can picture these field lines as invisible rings looping around the conductor. A single straight wire’s field is too feeble to pick up a paperclip, let alone a car. The trick that turns this weak effect into something powerful is coiling the wire.
When you wind the wire into a coil, every loop’s individual magnetic field overlaps with its neighbor’s. Inside the coil, all those overlapping fields point in the same direction and add together. The result is a combined field running straight through the center of the coil, emerging from one end (the north pole) and curving around to re-enter the other end (the south pole), just like the field of a bar magnet. A linear solenoid electromagnetic actuator, for instance, uses exactly this arrangement to convert electrical energy into a pushing or pulling force along a straight line.1Acta Mechatronica. LINEAR SOLENOID ELECTROMAGNETIC ACTUATOR WITH DIFFERENTIAL SERIES WINDINGS
Adding the ferromagnetic core inside the coil supercharges the effect. The atoms in iron and similar materials behave like tiny magnets themselves. Normally they point in random directions and cancel each other out, which is why a plain iron rod is not magnetic. But when the coil’s field passes through the core, those atomic magnets snap into alignment with the external field, reinforcing it enormously. This is why an iron-core electromagnet can be thousands of times stronger than the same coil with air inside.
What Controls the Strength
Three variables determine how strong an electromagnet’s field will be, and understanding them is the key to designing one for any purpose:
- Current: More current flowing through the wire means a stronger field. Double the current and, all else being equal, you roughly double the magnetic field strength. This is the easiest dial to turn in real time, which is why most electromagnet systems control their output by adjusting current.
- Number of turns: More loops of wire in the coil means more individual field contributions stacking up inside. A coil with 500 turns generates a much stronger field than one with 50, given the same current. However, more turns also means more wire, more electrical resistance, and more heat.
- Core material: Different ferromagnetic materials amplify the field by different amounts. Soft iron is popular because it magnetizes and demagnetizes easily. Certain specialized alloys can amplify the field even further, but they tend to be more expensive and may retain some magnetism after the current stops.
There is, however, a ceiling. You cannot keep pumping more current into the same core and expect the field to keep climbing forever. At a certain point the core’s atomic magnets are all fully aligned, and pushing more current through the wire yields almost no additional field strength. Engineers call this magnetic saturation. Past that point, extra current mainly produces extra heat without making the magnet much stronger. Designing around this limit is a practical challenge in high-power electromagnets.
Heat as the Practical Enemy
Every wire has some electrical resistance, and resistance turns some of the current’s energy into heat. In a coil carrying large currents, this heating effect is substantial and can become the single biggest design constraint.2Jurnal Teknologi. JOULE HEATING EFFECT REDUCTION OF AN ELECTROMAGNET SYSTEM UTILIZING ON-CHIP MAGNETIC CORE If the wire gets too hot, insulation can melt, the coil can short-circuit, and the electromagnet fails. In smaller devices this might just mean a burnt-out hobby project; in industrial or medical settings, overheating can be dangerous.
Engineers manage heat in several ways. Thicker wire has lower resistance for a given length, so it generates less heat at the same current. Active cooling with water, oil, or forced air carries waste heat away before it accumulates. Some advanced electromagnets use superconducting wire, which has zero electrical resistance when cooled to extremely low temperatures, eliminating resistive heating entirely. MRI machines in hospitals rely on superconducting electromagnets for exactly this reason, since the magnets need to run continuously at very high field strengths without overheating.
Why Soft Iron and Why “Soft”
The word “soft” here does not mean the iron is physically squishy. It refers to the material’s magnetic behavior. Soft iron magnetizes quickly when exposed to an external field and loses its magnetism almost immediately when the field disappears. This is ideal for an electromagnet because the whole point is to have a magnet you can switch off. If the core stayed magnetized after the current stopped, you would have a magnet that never fully releases whatever it was holding.
Hard magnetic materials, like hardened steel or certain alloys, are the opposite. They retain magnetism after the external field is removed, which is exactly what you want in a permanent magnet but not in an electromagnet. Some residual magnetism, called remanence, does linger in most soft iron cores after power-down, but it is usually very small compared to the full-power field.
For specialized uses, engineers choose core materials based on the specific demands of the application. Ferrite cores work well at high frequencies because they resist a type of internal energy loss called eddy currents. Laminated iron cores, built from thin sheets of iron separated by insulating layers, also reduce eddy current losses and are the standard in transformers and electric motors. The choice of core material is often as important as the coil design itself.
The On-Off Advantage Over Permanent Magnets
A permanent magnet is always on. It cannot be weakened, strengthened, or switched off without physically moving it or heating it past a critical temperature. An electromagnet, by contrast, gives you full control. Turn the current on, and you have a powerful magnet. Turn it off, and the field collapses. Adjust the current, and you tune the field strength precisely.
This controllability is what makes electromagnets far more versatile than their permanent cousins. A scrapyard crane can grab a car body, swing it across the yard, and release it on command. A hospital MRI scanner can maintain a precise, uniform field over a large volume for hours. A maglev train can adjust its levitation forces in real time to handle curves, wind, and changes in passenger load. None of these would be practical with a permanent magnet that cannot be adjusted.
There is a trade-off, of course. Electromagnets require a continuous supply of electricity to maintain their field. Cut the power and the magnetism vanishes, which in some contexts is a safety feature and in others is a vulnerability. Backup power systems are standard in applications where a sudden loss of the magnetic field would be dangerous or costly.
Industrial Lifting and Material Handling
One of the oldest and most visible uses of electromagnets is the magnetic crane. In steel mills, scrapyards, and manufacturing plants, electromagnets mounted on cranes lift and move heavy ferromagnetic objects: steel plates, scrap iron, structural beams. The electromagnet creates the gripping force, and when the operator cuts the current, the load drops. This is far faster and more flexible than mechanical clamps or hooks for handling irregularly shaped loads.
Designing these lifting electromagnets is more complex than it might seem. The magnetic field has to reach across the air gap between the magnet face and the load, and some of the field inevitably leaks out the sides rather than passing through the load. These leakage fluxes and fringing effects reduce the effective gripping force, and engineers must account for them carefully. Modern design methods using magnetic circuit models and computer simulations can predict the actual lifting force with high accuracy, to within a couple of percent of what is measured on the real device.3Advanced Electromagnetics. A Novel Method for Field Analysis and Design of Electromagnet Used in Lifting Applications
Inside an MRI Machine
If you have ever had an MRI scan, you were lying inside one of the most powerful electromagnets most people will ever encounter. Clinical MRI machines typically produce a field strength of 1.5 or 3 tesla, thousands of times stronger than the Earth’s natural magnetic field. That field needs to be extraordinarily uniform across the imaging volume so that the resulting images are clear and undistorted.
Achieving that uniformity is a serious engineering challenge. The magnet is not a single coil but a carefully arranged set of coils, each carrying a specific current, positioned so their combined fields cancel out imperfections. Optimization methods are used to minimize the amount of expensive superconducting wire while meeting strict uniformity targets inside the patient bore and keeping stray fields contained outside the machine.4Physica C: Superconductivity and its Applications. Electromagnetic design of MRI superconducting magnet based on novel hybrid optimization methods The coils are cooled with liquid helium to superconducting temperatures, so the magnet can run indefinitely without resistive heating and without consuming any power once the current is established. In a superconductor, once current starts flowing, it keeps flowing with no energy input, a property that is borderline magical from a practical standpoint.
Maglev Trains and Electromagnetic Suspension
Magnetic levitation trains use electromagnets to float the train above the track, eliminating the friction of wheels on rails. The concept is straightforward: electromagnets on the underside of the train are attracted upward toward a ferromagnetic rail on the track structure, pulling the train up into a hovering position. A control system constantly adjusts the current to keep the gap steady despite the train’s weight, speed, and vibrations.
Electromagnetic suspension is one of the most widely used approaches to maglev and has been successfully deployed commercially, including in China’s Changsha Maglev Express.5Journal of Vibration and Control. Structure and control design of levitation electromagnet for electromagnetic suspension medium-speed maglev train The engineering challenge is that the levitation is inherently unstable: the electromagnet’s attractive force increases as it gets closer to the rail and decreases as it moves away. Without active feedback control adjusting the current many times per second, the train would either slam into the rail or fall away from it. The electromagnets in these systems are paired with precision sensors and fast-acting controllers that keep the air gap within a fraction of a millimeter of its target.
Propulsion in most electromagnetic maglev systems also relies on electromagnets, using a linear motor built into the track. Alternating magnetic fields push and pull the train forward without any mechanical contact, so the only drag the train experiences at high speed comes from air resistance.
Recycling and Sorting Waste
Electromagnets play a surprisingly important role in recycling. Separating ferrous metals like steel and iron from a mixed waste stream is simple: run the material past a strong electromagnet and the ferrous pieces stick while everything else falls through. This basic technique has been used in recycling plants for decades.
Sorting nonferrous metals like copper and aluminum is trickier, since these materials are not attracted to magnets. The solution uses a different electromagnetic principle: eddy currents. A rapidly rotating drum of alternating magnetic poles, powered by electromagnets or strong permanent magnets, induces swirling electric currents inside any conductive metal passing over it. Those eddy currents create their own magnetic field, which repels the metal piece away from the drum and off a different trajectory than non-metallic waste. This eddy-current separation method is effective for recovering valuable nonferrous metals from solid waste streams.6Advanced Materials Research. Eddy-Current Induced Magnetic Separation of Nonferrous Metals from Solid Wastes
Electromagnets in Medicine Beyond Imaging
MRI gets most of the attention, but electromagnets have a second medical life that is less well known. Pulsed electromagnetic field therapy, or PEMF, uses coils to deliver short bursts of electromagnetic energy to the body. The U.S. Food and Drug Administration has approved PEMF devices as a safe and effective treatment for bone fractures that fail to heal on their own, known as nonunions.7PubMed Central. Pulsed Electromagnetic Field Stimulation of Bone Healing and Joint Preservation: Cellular Mechanisms of Skeletal Response
Research into how PEMF works at the cellular level has identified specific receptors on cell membranes that respond to the electromagnetic signals. Through these receptors, the pulsed fields appear to promote the production of structural proteins in bone and cartilage and to shift the chemical balance in joints toward reduced inflammation. The therapy is noninvasive and has few apparent side effects, which has driven growing interest in applying it to a broader range of musculoskeletal problems including osteoarthritis and tendon injuries.8PubMed. Promising application of Pulsed Electromagnetic Fields (PEMFs) in musculoskeletal disorders The electromagnets used in PEMF devices are far weaker than those in an MRI scanner, typically producing fields measured in millitesla rather than tesla, but the pulsing pattern and frequency are carefully tuned to interact with biological tissue.
Building One at Home
Making a basic electromagnet is one of the classic beginner science projects, and it genuinely does teach the core principles. You need a large iron nail, a length of insulated copper wire, and a battery. Wind the wire around the nail in neat, tight turns, going in the same direction the whole way. Leave a few inches of wire free at each end. Strip the insulation off the wire ends and connect them to the battery terminals. The nail becomes magnetic and can pick up small steel objects like paperclips or staples.
A few things that often surprise first-time builders:
- Winding direction matters: All the loops need to go the same way. If you reverse direction partway through, the field from those reversed turns works against the rest, weakening the magnet.
- Neatness helps: Layers of wire wound randomly create a less uniform and weaker field than a tightly wound single layer. If you want to add more turns, wind a second layer on top of the first, going back the other direction.
- The battery drains fast: A short length of copper wire has very low resistance, so the battery is essentially short-circuited through the coil. This is why the wire and battery both get warm quickly. Do not leave the circuit connected for long, or you will drain the battery and risk overheating the wire.
- Bigger is not always better: Using a much longer nail does not automatically produce a stronger magnet if your coil only covers part of it. The field is strongest where the coil is, so a longer core with the same number of turns just spreads the field thinner.
For a stronger homemade version, you can use a regulated DC power supply instead of a battery, thicker wire to handle higher current, and a machined soft-iron core rather than a hardware-store nail. But the physics is identical to the nail-and-battery version; you are just scaling up.
Common Misconceptions
One persistent myth is that electromagnets work by “storing” magnetism in the core and releasing it. They do not store anything. The magnetic field exists only while current flows. The core amplifies the field produced by the current, but once the current stops, the field collapses. Any residual magnetism in the core is a minor leftover, not stored energy being released.
Another misconception is that electromagnets attract all metals. They attract ferromagnetic materials: iron, nickel, cobalt, and alloys containing these elements. Aluminum, copper, brass, gold, and silver are not attracted to electromagnets. You can, as described in the recycling section, use rapidly changing magnetic fields to repel conductive nonferrous metals through eddy currents, but that is a fundamentally different interaction from magnetic attraction.
People also sometimes assume that making an electromagnet stronger is just a matter of adding more batteries. While increasing voltage does push more current through the coil, it also increases heat generation proportionally. Past a certain point, the wire’s insulation cannot handle the temperature, and the core saturates magnetically anyway. Serious electromagnet design is really thermal management and materials engineering as much as it is about magnetics. The interplay between those factors is what separates a science-fair nail magnet from an industrial lifting crane or a superconducting MRI coil.