There are different kinds of compasses that are differently built and have different purposes. We will mention some of them here:
Two main types of the compass are magnetic compass and gyro compass. First one has a magnetic element (needle or a card) that aligns itself with magnetic lines of Earth's magnetic field to point to the magnetic poles of the Earth. Gyro compass has a rapidly spinning wheel whose rotation interacts with the rotation of the earth until its axis of rotation is parallel with the Earth's and points to the Earth's rotational poles. This compass points to the true poles of the Earth.
Subtypes of a magnetic compass are:
Liquid compass - has a magnetized needle or card immersed in fluid. This method lessens excessive swing and wobble and improves readability while reducing wear.
Marine compass or a card compass - This type of compass has a needle that is fixed and a compass card that is mounted in fluid and rotates according to orientation. It is used on boats because the moving card absorbs much of the motion of a boat which makes it easier to read than a needle compass.
Prismatic compass or lensatic compass - has a glass prism or a lens and a lid that has a hairline. These are used for lining up with an object whose bearing is sought. It also has compass card which rotates in the base. When the compass card stops, the required bearing is read off through the prisms or lens. Some of them have liquid as a damping mechanism while other use electromagnetic induction for the same purpose. Some also have tritium and a combination of phosphors which help to read of the compass in the dark.
Base plate compass or Orienteering compass - is a liquid filled compass placed on the rectangular base made of transparent plastic so a map can be read through it. It often has a magnifying lens for map reading, some sort of light for low light conditions and a ruler. It is often used for plotting.
Thumb compass - is a variant of base plate compass but smaller. It is fixed on the thumb (as its name says) which leaves one hand free.
Solid state compasses - are found in electric devices. They often have two or three magnetic field sensors from which microprocessor reads data about the orientation of the device. They can often be found in clocks, mobile phones and tablets.
Qibla compass - is used by Muslims to show the direction to Mecca so they would know where to turn while praying.
GPS compass - uses satellites in a geo synchronous orbit over the Earth to show exact location and direction of movement of bearer.
Astrocompass - uses positions of various astronomical bodies to find true north. It is used in polar regions where magnetic compasses and gyrocompasses are unreliable. It uses current time and geographical position in the form of latitude and longitude. According to this information, it is sighted on to any astronomical object with a known position to give an extremely accurate reading.