How a Compass Works: From Magnetism to Magnetic North

A compass works because its needle is a lightweight magnet suspended so it can rotate freely, and Earth itself generates a massive magnetic field that tugs on that needle until one end settles pointing roughly northward. The field originates hundreds of miles beneath your feet, in a churning ocean of liquid iron, and the spot it points to (magnetic north) is not quite the same as the geographic North Pole. That gap shifts year to year, which means the story of how a compass finds north is more dynamic than it first appears.

The Needle Is a Magnet

Every magnet has two poles, north and south, created by the alignment of atoms within the material. In a compass, the needle is typically a thin strip of magnetized steel or an iron alloy balanced on a nearly frictionless pivot. Because opposite poles attract, the north-seeking end of the needle is drawn toward Earth’s magnetic south pole, which confusingly sits near the geographic North Pole. That is how the naming convention stuck centuries ago: the end of the needle that seeks the north was simply called the “north” pole.

Before steel needles existed, people noticed this effect in lodestone, a naturally occurring iron ore that behaves as a permanent magnet. Lodestone gets its magnetic hardness from oxidation and precipitation processes that alter its internal microstructure, giving it the ability to hold a strong, stable magnetization even without an external field applied to it.1Physics of the Earth and Planetary Interiors. Magnetic and microstructural properties of some lodestones Ancient navigators discovered that a sliver of lodestone, floated on water or hung from a thread, would consistently swing toward the same direction. That discovery was the birth of the magnetic compass.

Where Earth’s Magnetic Field Comes From

Earth’s magnetic field is not produced by a giant bar magnet buried at the center of the planet. The core is far too hot for any permanent magnet to hold its magnetization; above a certain temperature, magnetic materials lose their alignment entirely. Instead, the field is generated by what geophysicists call the geodynamo: a self-sustaining process in the liquid outer core, which is made mostly of iron with lighter elements mixed in.

The outer core is a fluid roughly 2,200 kilometers thick, sitting between the solid inner core and the rocky mantle. Heat escaping from the inner core and the gravitational energy released as the inner core slowly crystallizes drive vigorous convection currents in this liquid metal. Light elements dissolved in the iron play a key role in driving that convection, which in turn feeds the geodynamo.2PubMed Central. Thermal conductivity of Fe-Si alloys and thermal stratification in Earth’s core As electrically conducting liquid iron rises, sinks, and swirls, it generates electric currents. Those currents, shaped by Earth’s rotation through the Coriolis effect, produce the large-scale magnetic field that reaches all the way to the surface and far out into space. The field then reinforces the very currents that created it, sustaining itself over billions of years.

The result is a field that, to a first approximation, looks like the field of a simple bar magnet tilted about 11 degrees from Earth’s spin axis. But the real field is messier than that, with regional lumps and dips created by the complex flow patterns deep below.

Why the Needle Does Not Point to True North

Because the magnetic poles and the geographic poles are not in the same place, a compass needle rarely points to true north. The angular difference between where the needle points (magnetic north) and true north (the direction along a line of longitude toward the geographic pole) is called magnetic declination. Depending on where you are on Earth, declination can range from negligible to more than 20 degrees east or west.

If you are standing in a location where declination is, say, 10 degrees west, your compass needle is pointing 10 degrees to the left of true north. On a short hike that might not matter much. Over a long ocean crossing or a wilderness trek without landmarks, ignoring declination can send you miles off course. Topographic maps typically note the local declination, and serious navigators adjust for it by either adding or subtracting the angle from their compass bearing. Many modern baseplate compasses have an adjustable ring that lets you dial in the correction mechanically.

Declination also varies over time, because the magnetic poles wander. A declination value printed on a map from 1990 may be several degrees off today. Governments publish updated magnetic declination models, and many GPS-equipped devices calculate it automatically for your location and the current year.

Magnetic North Is a Moving Target

The north magnetic pole has never stayed in one place. It drifts because the convection patterns in Earth’s outer core are not fixed; they evolve on timescales ranging from years to millions of years. Through the 20th century, the magnetic north pole crept across the Canadian Arctic at a leisurely pace, but starting in the 1990s it accelerated dramatically, racing toward Siberia at roughly 50 to 55 kilometers per year. That acceleration forced an early update to the World Magnetic Model, the mathematical representation of the field that underpins everything from smartphone compasses to airport runway designations.

This wandering is normal in geological terms. Paleomagnetic records preserved in ancient lava flows and ocean-floor sediments show that the magnetic poles have drifted, wobbled, and even flipped polarity hundreds of times over Earth’s history. The current speed is faster than the long-term average, but it is not unprecedented in the geological record.

When North Becomes South

The most dramatic thing Earth’s magnetic field does is reverse itself entirely: the north magnetic pole and the south magnetic pole swap places. These geomagnetic reversals have happened at irregular intervals averaging a few hundred thousand years, though the gaps between reversals can range from tens of thousands of years to tens of millions of years. The last full reversal, known as the Brunhes-Matuyama reversal, occurred about 780,000 years ago.

During a reversal, the overall field weakens substantially before reorganizing with the opposite polarity. Research using geodynamo models shows that during these events, the dipole, quadrupole, and octupole components of the field all reach their minimum strengths at roughly the same time, suggesting the entire large-scale structure of the field collapses together rather than one component failing independently.3Russian Journal of Earth Sciences. Reversals and Large-Scale Variations of the Geomagnetic Field: Similarities and Differences A similar pattern shows up even in the smaller-amplitude oscillations of the field over the past hundred thousand years, hinting that reversals and the routine wobble of the field share a common underlying mechanism.

A reversal would not flip overnight. The transition takes a few thousand years at minimum, and during that window the field would be weaker and patchier, likely with multiple magnetic poles scattered across the globe. A compass in that era would be far less reliable, though “that era” is not something any individual human would need to plan for.

Dip, Inclination, and the Limits of a Flat Compass

Earth’s magnetic field lines do not run parallel to the surface everywhere. Near the equator they are roughly horizontal, but as you move toward the poles, the field lines plunge steeply into the ground. This vertical component is called magnetic inclination or dip. A compass needle that is perfectly free to move in three dimensions will tilt downward in the Northern Hemisphere and upward in the Southern Hemisphere, with the steepest angles near the poles.

This is why compass manufacturers balance their needles differently for different regions of the world. A compass designed for use in North America has a tiny counterweight on the north-seeking end to keep it level despite the downward pull of the local field. Take that compass to Australia and the needle may drag or stick because the dip now pulls the wrong end down. High-end expedition compasses use a “global needle” system that compensates across a wider range of inclinations, but the physics remains the same: the three-dimensional nature of Earth’s field means a flat needle on a horizontal pivot always loses some information.

Inclination is not just a nuisance. Historically, some navigators measured it deliberately as a rough indicator of latitude, since the dip angle increases predictably from equator to pole. And for certain animals, inclination appears to be part of how they read the magnetic field for navigation, providing positional information the way a compass heading provides directional information.

Electronic Compasses and Fluxgate Sensors

The compass in your phone does not use a magnetized needle at all. Instead, it relies on tiny electronic sensors, usually magnetometers, that detect the strength and direction of the surrounding magnetic field. One common type is the fluxgate sensor, which works by driving a soft magnetic core into and out of saturation with an alternating current. The Earth’s ambient field biases the core slightly, producing a measurable signal proportional to the field’s strength along the sensor’s axis. Stack two or three of these at right angles and you can resolve the full three-dimensional field vector.

Fluxgate sensors can be made remarkably small. Researchers have demonstrated flexible fluxgate sensors with pad-printed solenoid coils that achieve a linear measuring range of plus or minus 40 microtesla, comfortably covering Earth’s surface field strength of roughly 25 to 65 microtesla depending on location.4PubMed Central. Fabrication and Characterization of a Flexible Fluxgate Sensor with Pad-Printed Solenoid Coils Smartphones more commonly use even smaller magnetoresistive or Hall-effect sensors, which trade some sensitivity for cheaper manufacturing and lower power consumption. Either way, the principle is the same as a traditional compass: detect Earth’s field, figure out which way it points, and call that direction “north.”

The trade-off with electronic compasses is interference. A magnetized needle is unbothered by software bugs but very bothered by nearby iron objects. An electronic magnetometer has the same problem with ferromagnetic interference and adds a new one: electromagnetic noise from the device’s own circuits, speakers, and battery. That is why your phone’s compass sometimes asks you to wave the phone in a figure-eight pattern. The gesture lets the software sample the field from multiple orientations and mathematically subtract out local interference, a process called calibration.

Finding North Without Magnetism at All

Not every compass relies on Earth’s magnetic field. Gyrocompasses, used on ships and aircraft since the early 20th century, find true north by exploiting the physics of a spinning mass and Earth’s rotation. A rapidly spinning gyroscope resists being tilted, and because the planet is rotating, a properly mounted gyroscope will gradually precess until its spin axis aligns with the rotational axis, pointing to geographic north rather than magnetic north. This makes gyrocompasses immune to magnetic declination, local field anomalies, and the proximity of steel hulls.

Traditional gyrocompasses are bulky mechanical devices, which limits where they can be used. Recent work on miniaturized versions using microelectromechanical systems (MEMS) has produced a gyrocompass small enough to fit on a circuit board, roughly 50 by 42.5 by 24.5 millimeters, that can determine north to within about 0.2 degrees in two minutes.5PubMed Central. A MEMS traveling-wave micromotor-based miniature gyrocompass That is half the volume and twice the performance of the smallest comparable devices that preceded it. If MEMS gyrocompasses continue to shrink and improve, they could eventually be embedded in drones, autonomous vehicles, and personal electronics as a backup or replacement for magnetic sensing.

Animals That Carry Built-In Compasses

Humans needed to invent the compass. Many animals did not. Birds, sea turtles, salmon, lobsters, and even some bacteria can sense Earth’s magnetic field and use it for navigation. How they do it is one of the more fascinating open questions in biology, and the answer appears to be: in more than one way.

Researchers have found neurons in the pigeon brainstem that encode the direction, intensity, and polarity of magnetic fields, the three qualities you would need to build an internal model of both heading and location on the planet’s surface.6PubMed. Neural correlates of a magnetic sense The existence of these neurons demonstrates that pigeons have a dedicated neural substrate for processing magnetic information, though the identity of the actual receptor cells feeding those neurons remains debated.

Sea turtles appear to use two distinct magnetic senses simultaneously. Experiments showed that turtles use one mechanism as a magnetic compass for orientation, sensing the direction of field lines much like a needle compass does. They use a separate mechanism as a magnetic map, reading field intensity and inclination to determine their geographic position along a coastline. When researchers applied radiofrequency fields expected to disrupt a chemical-based sensing process, the compass behavior was impaired but the map sense was not, suggesting the two systems rely on fundamentally different biophysics.7PubMed. Learned magnetic map cues and two mechanisms of magnetoreception in sea turtles The compass may depend on quantum-level reactions involving light-sensitive molecules in the eye, while the map sense could involve tiny crystals of magnetite, a mineral closely related to lodestone, embedded in tissues.

This biological magnetoreception is, in a way, the oldest form of compass on the planet, predating human navigation by hundreds of millions of years. And the fact that evolution arrived at multiple independent mechanisms for reading the same planetary field underscores just how useful that field is for getting around.

Quantum Sensors and the Future of Magnetic Navigation

Magnetic compasses, whether mechanical needles or electronic sensors, share a limitation: they measure the field at a single point and need to be calibrated against interference. A new generation of quantum magnetometers aims to push past those constraints. One approach uses nitrogen-vacancy (NV) centers in synthetic diamond, atomic-scale defects in the diamond crystal that respond to magnetic fields with extraordinary sensitivity and can measure the full three-dimensional field vector.

Researchers recently demonstrated the first deep-sea quantum vector magnetometer based on NV centers, deploying it aboard a manned submersible in the South China Sea. The device performed as a magnetic compass under the extreme conditions of a deep ocean dive, validated through a series of field tests including experimental underwater navigation.8PubMed Central. Experimental demonstration of a diamond quantum vector magnetometer for deep-sea applications Diamond-based sensors tolerate high pressures, wide temperature swings, and corrosive environments that would damage conventional instruments. They also offer the potential for very precise vector measurement, meaning they can resolve not just which direction north is but the exact strength and angle of the local field, which is valuable for detecting submarines, mapping geological structures, and navigating in GPS-denied environments such as deep underwater or inside buildings.

Quantum magnetometry is still in early stages as a navigation tool. The hardware is more complex and expensive than a fluxgate chip, and significant engineering work remains before it shrinks enough for everyday devices. But the trajectory is clear: the same planetary field that wiggled a lodestone sliver on a medieval Chinese bowl of water is now being read by diamond crystals engineered atom by atom, and the information it yields keeps getting richer.

Common Sources of Compass Error

Even a perfectly built compass can mislead you if you do not account for the environment. The most common source of error is nearby ferromagnetic material: a steel belt buckle, a car hood, a pocket knife, or the rebar in a concrete structure. These objects create local magnetic fields that pull the needle away from north. Sailors call this deviation, and ships have traditionally compensated for it by placing small corrector magnets near the compass to cancel out the hull’s magnetic signature.

Electric currents also generate magnetic fields. Power lines, vehicle wiring, and electronic devices can all interfere. If you are using a handheld compass, holding it away from your body and any electronics you are carrying improves accuracy. If you are using your phone’s compass, the calibration routine mentioned earlier helps, but in a car full of electrical systems it will never be as reliable as a well-placed standalone instrument.

Geological anomalies matter too. Large deposits of magnetite or other iron-rich minerals can create local field distortions strong enough to swing a compass needle several degrees. Certain volcanic regions and areas with heavy mining activity are notorious for this. Aviators and mariners consult charts of known magnetic anomalies before relying on compass bearings in unfamiliar territory.

Finally, there is the human factor: simply misreading the dial, confusing magnetic north with true north, or forgetting to account for declination. The physics of a compass is straightforward, but using one well in the field takes practice and awareness of all the things that can push the needle away from where it should be.