How GPS Finds You Using a Bad Clock
Why a one-microsecond error in your phone's clock puts you 300 meters off, how satellite geometry stretches your error ellipse, and how one extra satellite cancels the drift out.
Jump to section 3 sections
GPS satellites don’t track your phone. They just broadcast a steady radio signal that says, “I am Satellite 14, here is my exact orbit, and the time right now is 12:00:00.000000000.”
Your phone reads that timestamp, compares it against its own clock, multiplies the travel time by the speed of light, and gets its distance from the satellite.
That sounds simple until you check the units. Light travels roughly 300 meters in one microsecond. Satellites carry rubidium and cesium atomic clocks accurate to a few nanoseconds, while your phone carries a cheap quartz oscillator that drifts by milliseconds. If your phone’s clock is off by a single microsecond, every distance measurement is wrong by 300 meters.
The way GPS turns a terrible receiver clock into meter-level accuracy is one of the cleanest geometry tricks in engineering.
Trilateration and why sky geometry matters (GDOP)
Start on a flat 2D map and pretend your phone’s clock is synced to the satellites. Knowing your distance from one satellite puts you on a circle around it. Add a second satellite and the two circles intersect at two spots: your real location and a mirror twin. A third satellite breaks the tie and pins down (x, y).
Even with three satellites, where they sit in the sky matters almost as much as your timing accuracy. Real radio measurements always carry a small band of atmospheric noise (drawn as the faint thick band around each circle below). When satellites surround you evenly, those bands cross at nearly right angles, keeping your uncertainty tight and nearly circular. When all three cluster on one side of the sky, the circles graze each other at shallow angles and range error trades off against clock bias, stretching your true error ellipse sharply along the line of sight. Navigation engineers call this GDOP (Geometric Dilution of Precision).
Tap Cluster satellites (or drag all three teal satellites toward the top edge yourself) and watch GDOP jump from ~1.9 into double digits while the uncertainty ellipse stretches wide across the map. That is why GPS drifts inside urban canyons between skyscrapers.
Now break the phone’s clock
In reality, your phone’s clock has some unknown offset b. Because your receiver compares every satellite’s timestamp against the same faulty local clock, every measured distance (called a pseudorange) is shifted by the exact same radius b * c.
If your clock runs 0.32 microseconds fast, all three circles grow by 96 meters at once. They no longer meet at a point; they pull apart and leave an empty error zone in the middle where no location satisfies all three rings.
Here is the trick. Because all three circles are wrong by the exact same unknown offset b, you don’t have two unknowns (x, y) anymore; you have three (x, y, b). And three circles give you three nonlinear equations.
Hit Solve clock offset (or step through one iteration at a time) below to run a real 3x3 Gauss-Newton solver in your browser. It nudges (x, y) and shrinks or expands all three rings together until the mismatch drops to zero, recovering both your exact position and your phone’s hidden clock bias.
Scrub the clock error slider into negative territory (like -0.36 us, where your phone clock runs slow and the rings shrink too small to meet), then click Step repeatedly to watch the solver walk in and lock down in 4 iterations.
3D space and Einstein’s +38 microseconds per day
Real GPS moves this exact geometry up one dimension. In 3D space you have four unknowns (x, y, z, and your phone’s clock bias b), which is why your phone needs a lock on at least four satellites to get a fix. As a free bonus, solving for your position turns your phone’s cheap quartz chip into a nanosecond-synced clock.
One last clock detail makes the whole system possible: relativity. GPS satellites orbit 20,200 km above Earth at 14,000 km/h. Special relativity slows their onboard atomic clocks by about 7 microseconds per day because of their speed, while general relativity speeds them up by about 45 microseconds per day because Earth’s gravity is weaker up there. Left uncorrected, the net +38 microseconds per day would add 11.4 kilometers of position drift every single day. Engineers literally tune satellite atomic clocks slightly slow on the ground before launch so they tick at the right rate once they reach orbit.