Compass is a simple instrument that has a magnetic needle that can rotate freely in one plane and it points North-South when compass is in horizontal position. It is used for navigation and orientation.
We don’t know when precisely a compass is invented but we know that it was invented in China between the 2nd century BC and 1st century AD, during the Han Dynasty. In about that period, Chinese people found that lodestones, suspended so it could turn freely, would always point in the same direction. Loadstones, suspended in that way, were first used in geomancy, a type of earth magic, as a method of finding gems and selecting of sites for houses by the rules of geomantic principles of feng shui. First manmade compasses were so-called “south pointing spoons”, compasses where a lodestone needle was made in a form of spoon so it could turn on the smooth surface and whose “handle” pointed south. In the 12th century, China navy uses compasses for navigation but there is evidence that compasses were used by the Chinese military for navigational orienteering by 1040 during the Song Dynasty. There is some evidence that in 4th century, Chinese found that if iron is held and rubbed with a lodestone, it can receive properties of magnet and compasses were made from iron needles but first sure proofs appear in 11th century. Those compasses were intended for navigation and consisted of an iron needle that floated in the bowl of water which enabled needle to be in horizontal position.
How compass spread across the world is a matter for debate. Written evidence tells that compass appeared in Europe in 1190 and in the Muslim world later, in 1232 which is weird but there are no written proofs that would tell otherwise, at least for now.
Today there are many versions of compass which are used for navigation and orientation but in different conditions.
The First dry mariner's compass was invented in Europe around 1300. It has three major elements. The first one is freely pivoting needle which stands on a pin and is enclosed in a box that has a glass cover and a windrose that has cardinal directions - North, East, South and West. That box is placed inside a gimbal so it can rotate freely and that system in another gimbal. That way box that holds magnetic needle can always stay horizontal if weighted on the bottom.
A bearing compass is a magnetic compass that is used to measure bearing: the angle between its forward direction (the most commonly North), and the direction from it to some other object. It was used in map making and the first one appeared in 18th century. Its variants are surveyor's compass and prismatic compass.
The liquid compass is a type of a compass for navigation in which the magnetized needle or card is immersed in the fluid which gives more stable reading. It is a direct descendant of the first Chinese navigational compasses but they were improved in time and today’s variants are enclosed in transparent globes and used everywhere from boats to cars.