A magnetic compass is a type of compass that uses the Earth's magnetic field to determine direction. The first magnetic compasses were invented in China during the Han Dynasty, and later spread to Europe and the Muslim world.
There are two main types of magnetic compasses: the dry compass and the liquid compass. The dry compass is a more traditional design, consisting of a metal needle that is free to rotate on a pivot point. The needle is magnetized, and aligns itself with the Earth's magnetic field. The Liquid Compass is a more modern design, which uses a liquid-filled capsule instead of a needle. The capsule contains a magnet, which aligns itself with the Earth's magnetic field.
Both types of compasses work in essentially the same way, but the liquid compass is less affected by changes in temperature and altitude, making it more accurate overall.