Free chapter

How does GPS know where you are?

Chapter 1 of a Doomlearning course, free to read. It’s 10 cards and takes about 5 minutes. The rest of the course is in the app.

Illustration of a GPS satellite with long solar panels in orbit above the Earth
US Air Force illustration of a Navstar GPS satellite.

Your phone finds itself on the planet to within a few metres, in a couple of seconds, while you hold it in one hand. It does that without ever transmitting anything to a satellite, and it cannot do it at all without correcting for the fact that time runs at different speeds at different altitudes.

1. The satellites have never heard of you

The first thing to unlearn: GPS is not a conversation. Your phone does not contact a satellite and get told where it is.

The satellites broadcast, constantly, to nobody in particular. Your phone listens. Everything after that happens inside the handset in your pocket. This is why GPS works for an unlimited number of receivers at once, and why it keeps working when the mobile network is down.

2. Each satellite is shouting the time

What a satellite broadcasts is close to the simplest useful message imaginable: who it is, where it is, and what time it is right now.

Your phone receives that message a fraction of a second after it was sent, because radio waves travel at the speed of light and the satellite is roughly 20,000 kilometres up. Compare the timestamp in the message against your own clock, and the difference tells you how far away the satellite is. Distance is what you are really measuring, and time is how you measure it.

3. One distance is a sphere, and you need three

Knowing you are 20,100 kilometres from one satellite puts you somewhere on a sphere of that radius. Useless on its own.

A second satellite gives a second sphere, and two spheres intersect in a circle. A third narrows it to two points, one of which is out in space or moving at an implausible speed, so it can be discarded. Three satellites, in principle, is a fix. This is trilateration, and it is the same idea as working out where you are from three known landmarks.

4. Except your phone’s clock is nowhere near good enough

Here is where it should fall apart. Light travels about 30 centimetres in a nanosecond. To place yourself within ten metres you need to know the travel time to within about 33 nanoseconds.

The quartz oscillator in a phone drifts by more than that in well under a second. A cheap clock that wrong should make the whole scheme impossible — and putting an atomic clock in every handset was never going to happen.

30cmlight travelsin one nanosecond
33nstiming neededfor a 10m fix
~1msphone clock driftper second, uncorrected
The gap between what the method needs and what a phone has is roughly a factor of a million.

5. The fix: stop trying to know the time

This is the clever part, and it is the reason the system works at all. Your phone does not need an accurate clock. It treats its own clock error as a fourth unknown and solves for it.

You have three unknowns for position — latitude, longitude, altitude — plus one for how wrong your clock is. Four unknowns need four equations, so you listen to four satellites instead of three. The receiver finds the single combination of position and clock offset that makes all four signals agree.

So your phone is not looking up its location. It is solving four simultaneous equations, several times a second, and getting the exact time as a free by-product. That is why GPS is the backbone of timing for power grids, stock exchanges and mobile networks, none of which care where they are.

6. Relativity is not a footnote here

Two effects from Einstein pull the satellite clocks in opposite directions, and both are large enough to matter.

Special relativity

The satellites orbit at about 14,000 km/h.

Moving clocks run slow.

Loses about 7 microseconds a day.

General relativity

They sit 20,000 km up, in weaker gravity.

Clocks higher in a gravity well run fast.

Gains about 45 microseconds a day.

Net: the satellite clocks gain roughly 38 microseconds a day relative to the ground.

Thirty-eight microseconds sounds like nothing. At 30 centimetres per nanosecond it is about 11 kilometres of positioning error, accumulating every day. So the satellite clocks are deliberately built to tick slightly slow, and are corrected in orbit. Relativity is not a curiosity in this system. It is a calibration step, and without it satnav would be useless by lunchtime on day one.

7. Why the first fix takes so long

To use a satellite’s message you need to know precisely where that satellite was when it sent it. That orbital data is in the broadcast, and the broadcast is slow.

  1. 50 bps

    The navigation message transmits at fifty bits a second. Slower than a 1980s modem.

  2. ~30s

    A full set of orbital data for one satellite takes about half a minute to receive.

  3. Cold start

    No stored data: the receiver must collect it from scratch. Up to a few minutes.

  4. A-GPS

    Your phone downloads the same data over the internet in a fraction of a second. This is why it feels instant.

Which is why a phone that has been off for a fortnight, or has flown to another continent, takes noticeably longer to find itself.

8. What actually ruins the accuracy

The clock problem is solved. What remains is mostly the atmosphere and the buildings.

  • The ionosphereCharged particles slow the signal by a variable amount. The largest single error source, and the reason dual-frequency receivers are more accurate.
  • MultipathThe signal bounces off a building and arrives late, so the receiver thinks the satellite is further away. This is why cities are bad.
  • GeometrySatellites bunched in one part of the sky give a worse fix than satellites spread out, even with identical signal quality.
Ranked roughly by how much error each contributes in normal use.

9. And it is not only GPS any more

GPS is the American system. There are now three other full constellations: Russia’s GLONASS, the EU’s Galileo and China’s BeiDou.

Your phone almost certainly uses several at once, which is why urban positioning has quietly improved — more satellites overhead means a better chance of four with a clean line of sight. “GPS” has become the generic name for something more accurately called GNSS, in the way people say Hoover.

10. Knowledge check

Knowledge check

Why does a GPS receiver need four satellites rather than three?

Pick one to see the answer.

What the rest of the course covers

Chapter one is the core idea. The remaining four chapters are about how it is made to work in practice.

  1. The signal itself. Spread spectrum, why the broadcast is weaker than the background noise, and how a receiver pulls it out anyway.
  2. Getting to centimetres. Differential GPS and RTK, and how surveyors and tractors do far better than your phone.
  3. Jamming and spoofing. Why the signal is easy to overpower, what has happened near conflict zones, and what is being done about it.
  4. Everything else that finds you. Wi-Fi positioning, cell towers, the accelerometer, and how your phone blends them into one blue dot.

Roughly forty more cards. Doomlearning pitches them at your level, and will build a course on something else entirely if you ask.

Written by AI and checked by us before publishing.

Ask your own question

The first chapter of every course is free.

Free to try. No card needed.