Every magnet has a north and a south pole. If you hold two bar magnets close to each other, they will either snap together or push apart, depending on the alignment of the poles. Like poles repel and unlike poles attract (see References 1). The poles on a magnet may seem fixed, but under certain circumstances, they can change. According to the British Geological Survey, even the magnetic poles of planet Earth are thought to swap every million years or so (see References 2). Depending on its type, you can switch the polarity of a magnet, using simple equipment and techniques.
Flip the switch to turn off the power to the electromagnet. With this type of magnet, the magnetic field only operates when an electric current flows through it (see References 3).
Find the two wires that are attached to the electromagnet.
Free the wires from the terminals on the electromagnet, using either pliers or a screwdriver.
Reattach each wire to the terminal opposite its original position, using either pliers or a screwdriver (see References 3).
Flip the switch to turn on the electromagnet. The poles will now be reversed.
Mark the poles of the bar magnets with chalk, if they are not already marked, so that you can identify them easily. To do this, hold the magnets close together and chalk the letter "A" on the ends of the magnets that are attracted to each other and "R" on the ends that repel each other.
Use pliers to wind copper wire tightly around a cardboard tube to create a coil. Leave enough wire free at each end of the coil for the trailing ends to be connected to a battery. Remove the cardboard tube to leave a cylindrical coil of wire, sometimes called a "solenoid." (See References 4)
Place the magnet you wish to change inside the coil. The coil should be exactly the length of the bar magnet. Place the coil on a heat-proof surface, such as a stone slab. Attach the free end of each wire to either the positive or the negative terminal of the battery. An electrical current will flow through the coil, generating a magnetic field. This magnetic field can influence the alignment of particles inside the bar magnet (see References 4). Only allow a short pulse of energy to flow through the coil before disconnecting it from the battery or the resulting heat may melt your coil (see References 5).
Hold the second bar magnet close to the poles of the magnet in the coil. If the poles have switched, the opposite ends of the magnet in the coil will now attract and repel. If this does not happen, take the magnet out of the coil, turn it and replace it, so it now faces in the opposite direction inside the coil. Reconnect the coil to the battery and allow a pulse of energy to flow through it. Disconnect the battery. Test the magnet in the coil with the second bar magnet again. You should find that the poles of the magnet in the coil have switched position (see References 4, References 5).
Depending on the original strength of the magnet, it may take a number of pulses for its poles to be permanently reversed. Be prepared to experiment with the amount and duration of the pulses, until you achieve a satisfactory result (see References 4, References 5).
A very simple way to "switch" the poles of a bar magnet is to physically rotate it through 180 degrees, so that its two ends point in the opposite direction to its starting position.
Never leave a solenoid or cylinder of wire unattended when it is connected to a power supply. The coil may get very hot and could become a fire hazard.