To create an electromagnet, you need three things: a coil of insulated wire, a ferromagnetic core (typically iron), and a source of electric current. When current flows through the wire coil, it generates a magnetic field, and the iron core concentrates that field into something strong enough to attract metal objects. Unlike a permanent magnet, an electromagnet can be switched on and off simply by controlling the flow of electricity.
The Three Essential Components
Every electromagnet, from a science-fair project to an industrial crane, relies on the same basic setup. A length of wire is wound into a coil (sometimes called a solenoid), that coil is wrapped around a core made of iron or a similar metal, and both are connected to a power source like a battery. Remove any one of these three pieces and you no longer have a functioning electromagnet.
The wire must be insulated so that electricity travels through the full length of the coil rather than short-circuiting between adjacent loops. Magnet wire, the type used in motors and transformers, has an extremely thin enamel coating for this reason. Standard household wire with thick plastic insulation works for a basic project but limits how tightly you can wind the coil, which affects strength.
Why the Core Matters
You can generate a magnetic field with a coil of wire and nothing inside it, but the field will be weak. Inserting a core made of a ferromagnetic material, most commonly soft iron, dramatically amplifies the field. The core works because iron is highly “permeable,” meaning magnetic field lines pass through it far more easily than through air. Iron powder cores have an initial permeability ranging from about 4 to 100, while silicon-iron alloys (the kind used in power transformers) reach permeabilities around 1,500. The higher that number, the more the core multiplies the magnetic effect of your coil.
Soft iron is the classic choice for a simple electromagnet because it magnetizes quickly when current flows and loses its magnetism almost immediately when the current stops. Steel works too, but it tends to retain some magnetism after you turn the power off, which is useful for permanent magnets but not ideal when you want precise on/off control.
How Current and Coil Turns Control Strength
The strength of an electromagnet’s field depends on two variables you can directly control: the amount of current flowing through the wire (measured in amps) and the number of wire loops per unit of length. The relationship is straightforward multiplication. If you triple the current and double the number of loops per length, you get a magnetic field six times stronger than your starting point.
This means there are two practical ways to build a stronger electromagnet. You can increase the current by using a more powerful battery or power supply. Or you can wind more turns of wire around the core, packing them more tightly. In practice, most hobbyists do both. A simple nail wrapped with 50 turns of wire and connected to a single AA battery will pick up a few paperclips. The same nail with 200 tightly wound turns and a stronger battery can lift considerably more.
DC vs. AC Power
For a stable, predictable magnetic field, you need direct current (DC), the kind that flows from a battery in one direction. DC creates a steady field that is either on with a fixed pull or completely off. This is why batteries are the go-to power source for simple electromagnets and why DC electromagnets are standard in relays, magnetic locks, and solenoids.
If you feed alternating current (AC) into the same coil, the magnetic field flips its polarity back and forth many times per second, matching the frequency of your power supply. At 60 Hz (standard household current in the U.S.), the north and south poles swap 120 times every second. This creates a buzzing, fluctuating pull rather than a steady grip. AC electromagnets have specialized uses, but for a basic electromagnet project, stick with a battery or DC power supply.
Heat and Run Time Limits
An electromagnet coil has electrical resistance, and resistance generates heat. The thinner the wire and the more current you push through it, the hotter things get. This is the main reason you cannot run a simple electromagnet indefinitely at full power.
Standard enamel insulation on magnet wire begins to break down at temperatures around 200 to 250°C, and copper itself starts to oxidize above 200°C, which degrades its ability to conduct electricity. For a classroom electromagnet running on a few AA batteries, overheating is unlikely. But if you scale up to higher currents, you need to think about duty cycle: the fraction of time the electromagnet stays powered before you let it cool down. Industrial electromagnets often run at a 50% or 75% duty cycle, meaning they are energized for a set period and then switched off to dissipate heat before the next cycle.
Core Shape and Magnetic Efficiency
A straight cylindrical core, like a nail or iron bolt, is the simplest option and works fine for basic projects. But shape affects performance. A U-shaped or horseshoe-shaped core brings both magnetic poles close together, creating a stronger field in the gap between them. This is why horseshoe electromagnets are common in applications where you need maximum grip on a flat metal surface.
In more advanced designs, engineers optimize core geometry to transmit as much magnetic flux as possible while minimizing wasted material. Recent research published in Scientific Reports found that a configuration of thin iron sheets connected by a central bridge, forming a structure resembling a double-sided comb, performed marginally better than other designs at channeling magnetic flux. For a home project, though, a simple iron rod or bolt does the job well.
Putting It All Together
If you want to build a basic electromagnet, here is what you need:
- A ferromagnetic core: an iron nail, bolt, or rod. Larger diameter cores collect more magnetic flux.
- Insulated copper wire: magnet wire with thin enamel coating is ideal. Thinner wire lets you fit more turns in a smaller space, but it heats up faster at higher currents.
- A DC power source: one or more batteries for a small project, or a DC power supply for something larger.
Wind the wire tightly around the core in neat, closely spaced loops, all going in the same direction. Leave enough wire at each end to connect to your battery terminals. The moment current flows, the nail becomes a magnet. Disconnect the battery and the magnetism disappears almost instantly, assuming you used soft iron rather than steel.
To make it stronger, add more turns, use a thicker core, or increase the current. Just keep an eye on heat: if the wire feels hot to the touch, disconnect and let it cool before continuing.

