Magnetism has been known to mankind for many thousands of years. Lodestone, a magnetized form of the iron oxide mineral magnetite which has the property of attracting iron objects, is referred to in old European and Asian historical records, around 800 BC in Europe and earlier in the East, around 2600 BC. The root of the English word magnet is the Greek word magnes, thought to be derived from Magnesia in Asia Minor, once an important source of lodestone.

Lodestone was used as a navigational compass as it was found to orient itself in a north-south direction if left free to rotate by suspension on a string or on a float in water.

A compass is a navigational instrument for finding directions. It consists of a magnetised pointer free to align itself accurately with Earth's magnetic field. A compass provides a known reference direction which is of great assistance in navigation. The cardinal points are north, south, east and west. A compass can be used in conjunction with a clock and a sextant to provide a very accurate navigation capability. This device greatly improved maritime trade by making travel safer and more efficient. A compass can be any magnetic device using a needle to indicate the direction of the magnetic north of a planet's magnetosphere. Any instrument with a magnetized bar or needle turning freely upon a pivot and pointing in a northerly and southerly direction can be considered a compass.

In 1269, Frenchmen Peter Peregrinus and Pierre de Maricourt, using a compass and a lodestone, found the magnetic force of the lodestone at its opposite ends, which they defined to be the poles of the magnet. They found that like poles repel one another whilst unlike poles attract. It was also discovered that poles always occur in pairs, so, it is impossible to isolate a single pole, or monopole. Breaking a piece of lodestone in half would result in two pieces, each with its own pair of poles.

In 1600 the English physician William Gilbert concluded that the Earth itself is a magnet and that the Earth's magnetic poles are approximately aligned along the Earth's axis of rotation.

The British scientist, John Michell, discovered in 1750 that the magnitude of forces between the poles of magnets follows an inverse square law i.e. it varies inversely as the square of the distance of separation.

Magnetic forces are a result of magnetic fields. The magnetic field is an entity produced by moving electric charges that exerts a force on other moving charges. In permanent ferromagnets the magnetic field is produced by the spin of electrons within the material being in the same direction.

By placing a magnet underneath a piece of paper and sprinkling iron filings on top one can map the magnetic field. The filings align themselves parallel to the field. Magnetic fields can be represented by magnetic field lines which are parallel to the magnetic field and whose spacing represents the relative strength of the magnetic field. The strength of the magnetic field is referred to as the magnetic flux. Magnetic field lines form closed loops. In a bar magnet magnetic field lines emerge at one pole and then curve around to the other pole with the rest of the loop being inside the magnet.

Opposite poles of a magnet attract each other and bringing them together results in their magnetic field lines converging.

Like poles of a magnet repel each other and bringing them together results in their magnetic field lines diverging.

Ferromagnetism is a phenomenon exhibited by materials like iron, nickel or cobalt. They become magnetized in an external magnetic field by aligning their electron spins with the external field. Ferromagnetic materials retain their magnetism even when the field is removed as the electron spins retain their orientation. At high enough temperatures ferromagnets lose their orientation as the heat causes the orientations of electron orbits within iron to become randomized.

Iron always magnetizes so as to be attracted to a magnet, regardless of which magnetic pole is brought toward the unmagnetized iron:

The ability of a ferromagnetic material tends to retain its magnetization after an external field is removed is called it's retentivity.

Paramagnetic materials are materials like aluminum or platinum which become magnetized in an external magnetic field in a similar way to ferromagnetic materials but lose their magnetism when the external magnetic field is removed.

Diamagnetism is exhibited by materials like copper or bismuth which become magnetized in a magnetic field with a polarity opposite to the external magnetic field. Unlike iron, they are slightly repelled by a magnet

The cause of Earth's magnetic field is not known for certain, but is possibly explained by the dynamo theory. The magnetic field extends several tens of thousands of kilometers into space. The field is approximately a magnetic dipole, with one pole near the geographic north pole and the other near the geographic south pole. An imaginary line joining the magnetic poles would be inclined by approximately 11.3 from the planet's axis of rotation. The location of the magnetic poles is not static but wanders as much as several kilometers a year. The two poles wander independently of each other and are not at exact opposite positions on the globe. Currently the south magnetic pole is further from the geographic south pole than than north magnetic pole is from the north geographic pole.

The strength of the field at the Earth's surface at this time ranges from less than 30 microteslas (0.3 gauss) in an area including most of South America and South Africa to over 60 microteslas (0.6 gauss) around the magnetic poles in northern Canada and south of Australia, and in part of Siberia. The field is similar to that of a bar magnet, but this similarity is superficial. The magnetic field of a bar magnet, or any other type of permanent magnet, is created by the coordinated motions of electrons (negatively charged particles) within iron atoms. The Earth's core, however, is hotter than 1043 K, the temperature at which the orientations of electron orbits within iron become randomized. Therefore the Earth's magnetic field is not caused by magnetised iron deposits, but mostly by electric currents (known as telluric currents). Another feature that distinguishes the Earth magnetically from a bar magnet is its magnetosphere.

A magnetosphere is the region around an astronomical object, in which phenomena are dominated by its magnetic field. Earth is surrounded by a magnetosphere, as are the magnetized planets Jupiter, Saturn, Uranus and Neptune. Mercury is magnetized, but too weakly to trap plasma. Mars has patchy surface magnetization.

The distant field of Earth is greatly modified by the solar wind, a hot outflow from the sun, consisting of solar ions (mainly hydrogen) moving at about 400 km/s . Earth's magnetic field forms an obstacle to the solar wind.

The Earth's magnetic field reverses at intervals, ranging from tens of thousands to many millions of years, with an average interval ofnbsp; 250,000 years. It is believed that this last occurred some 780,000 years ago. The mechanism responsible for geomagnetic reversals is not well understood. When the North reappears in the opposite direction, we would interpret this as a reversal, whereas turning off and returning in the same direction is called a geomagnetic excursion. At present, the overall geomagnetic field is becoming weaker at a rate which would, if it continues, cause the field to disappear, albeit temporarily, by about around 3000-4000 AD. The deterioration began roughly 150 years ago and has accelerated in the past several years. So far the strength of the Earth's field has decreased by 10 to 15 percent.