A compass is an instrument containing a freely suspended magnetic element which displays the direction of the horizontal component of the Earth's magnetic field at the point of observation.
The magnetic compass is an old Chinese invention , probably first made in China during the Qin dynasty (221-206 B.C.). Chinese fortune tellers used lodestones (a mineral composed of an iron oxide which aligns itself in a north-south direction) to construct their fortune telling boards.
Eventually someone noticed that the lodestones were better at pointing out real directions, leading to the first compasses. They designed the compass on a square slab which had markings for the cardinal points and the constellations. The pointing needle was a lodestone spoon-shaped device, with a handle that would always point south.
Magnetized needles used as direction pointers instead of the spoon-shaped lodestones appeared in the 8th century AD, again in China, and between 850 and 1050 they seem to have become common as navigational devices on ships.
The first person recorded to have used the compass as a navigational aid was Zheng He (1371-1435), from the Yunnan province in China, who made seven ocean voyages between 1405 and 1433.