When a current flows in a wire, it creates a circular magnetic field around the wire.
This magnetic field can deflect the needle of a magnetic compass.
The strength of the magnetic field is greater:
A coil of wire, or solenoid, consists of a wire coiled up into a spiral shape.
When an electric current flows, the shape of the magnetic field is very similar to the field of a bar magnet.
The field inside a solenoid is strong and uniform.
The small magnetic field caused by the current in each coil add together to make a stronger overall magnetic field.
The north pole of the electromagnet can also be found by using your right hand.
Point the fingers of your right hand in the same direction as the current is flowing in the coil.
Your thumb points to the north pole of the electromagnet.
The magnetic field produced by the current in a coil of wire: