A compass is an instrument used for navigation and orientation that shows direction relative to the geographic cardinal directions. The simplest compass is the magnetic compass, where a magnetized metal needle is mounted in such a way that it can spin freely.
The magnetic compass is the most familiar compass type. It functions as a pointer to “magnetic north”, the local magnetic meridian, because the magnetized needle at its heart aligns itself with the horizontal component of the Earth’s magnetic field.
The magnetic field exerts a torque on the needle, pulling the North end or pole of the needle approximately toward the Earth’s North magnetic pole, and pulling the other toward the Earth’s South magnetic pole.
In navigation, directions on maps are usually expressed with reference to geographical (or true) north, the direction toward the Geographical North Pole, the rotation axis of the Earth. Depending on where the compass is located on the surface of the Earth the angle between true north and magnetic north, called magnetic declination can vary widely with geographic location.
What is the difference between true and magnetic poles?
Earth spins about an axis running through the North Pole (the true North Pole) and the South Pole (the true South Pole). But Earth’s magnetic field doesn’t quite line up with its axis of rotation. So the magnetic north pole which is the place your compass points toward doesn’t precisely match with the real North Pole. Also, the locations of the Earth’s magnetic poles slowly change with time.