The Basics of Making Your Own Magnet
You don't need much to magnetize a piece of steel. A strong permanent magnet, a ferromagnetic material like a nail or a blade of spring steel, and a way to apply a steady magnetic field. The process is straightforward in theory. In practice, you will run into a few issues that make it less clean than the YouTube tutorials suggest. This is the simplest approach and works fine for small-scale projects. Take your ferromagnetic material—a high-carbon steel nail, for example—and a strong neodymium magnet. Rub the magnet along the length of the nail in one direction only. Lift it well away from the nail on the return stroke so you are not dragging it back across. Repeat consistently for about 30 to 60 strokes. Direction matters. If you go back and forth, you will demagnetize whatever field you are building rather than reinforce it. The nail you are using has to be steel with enough carbon content. A common hardware-store nail often has very low carbon. It might pick up some magnetism, but it will lose it quickly. Spring steel or an old file works far better because the higher carbon content helps retain the magnetic domain alignment after the external field is removed. I learned this the hard way on a project where I needed a small holding magnet for a jig. I used a standard box nail and spent an hour wondering why it lost its grip within minutes. Switched to a broken piece of leaf spring from an old lawnmower, and it held for weeks.
Electromagnet Method for Stronger Results
If you need something noticeably stronger, an electromagnet setup gives you more control over the field strength. Wrap insulated copper wire tightly around a ferromagnetic core—again, high-carbon steel or soft iron works best. Connect the ends of the wire to a DC power source. A 12-volt battery or a regulated power supply set to around 5 to 12 amps will do the trick for a decent-sized coil. The number of turns in the coil directly affects the magnetic field strength. More turns means a stronger field, but also more electrical resistance and heat buildup. I once wound 500 turns around a bolt and powered it with a 12-volt supply drawing about 3 amps. The coil got warm within five minutes and the magnetism was solid. Run it for 20 minutes straight and the insulation on the wire starts to degrade. Add a heat sink or intermittent duty cycle if you need sustained operation. To transfer that magnetism permanently to your core material, you can leave the core inside the energized coil for a few minutes before disconnecting power. This allows the magnetic domains in the steel to align and settle. The resulting magnet will be stronger than what you get from the stroke method, especially if you use a proper alloy steel core instead of just any random bolt.
Hardening and Retaining Magnetism
One thing most people miss is that the material itself determines how well your magnet holds. Soft iron magnetizes easily but also loses magnetism just as fast. Hard steel or specialized alloys like alnico, neodymium-iron-boron, or samarium-cobalt are designed to retain domain alignment. If you are making a permanent magnet at home, you are limited by whatever material you have on hand. A practical tip: after magnetizing your steel piece, tapping it lightly with a hammer while it sits in the magnetic field can help the domains lock into place. This is not something you see in basic guides, but it is a known technique in workshop settings. I used it on a batch of custom magnetic holders for a fixture plate I was machining. The difference in retention force between tapped and untapped pieces was measurable with a simple pull gauge.
Get the Full Details

Common Pitfalls and What Actually Fails
Using the wrong wire gauge for your electromagnet coil is a frequent mistake. Thin wire with too many turns will overheat and fail before you get a useful field. A good rule of thumb is 18 to 22 gauge enameled copper wire depending on your power source and desired current. Thicker wire handles more current without overheating but requires more turns to achieve the same field strength. Another issue is the air gap. If you are trying to make a magnet that needs to pick up or hold objects, the gap between the magnet surface and the target material dramatically reduces effective force. A magnet that lifts one pound at zero gap might only handle a few ounces at a quarter-inch gap. This is true regardless of how you make it. Neodymium magnets lose significant holding power over distance compared to ceramic magnets, which maintain their field shape better but are weaker overall. The biggest limitation of home magnet-making is that you cannot create a magnet stronger than the original source material. If you are stroke-magnetizing a low-carbon nail, you are capped at a fraction of what a neodymium magnet of the same size can produce. The stroke method and basic electromagnet approach are useful for learning, for light-duty applications, or for situations where you need a temporary magnet you can later demagnetize. They are not going to replace commercial rare-earth magnets for anything demanding.
If you need something reliable and strong, buying a pre-made neodymium magnet is cheaper and faster than building one yourself. But if you need a specific shape, size, or orientation that standard magnets do not come in, making your own is a viable option. Just manage your expectations about what the process can actually deliver.