How GPS Computes Your Position
The Global Positioning System is one of the most extraordinary pieces of engineering most people use every day without noticing. A pocket-sized device with no special hardware listens to signals weaker than thermal noise, decodes them by correlating each one against a known pseudorandom pattern, measures how long each signal took to arrive with nanosecond precision, accounts for special- and general-relativistic time dilation on satellite clocks running 38 microseconds per day faster than Earth’s, solves a four-dimensional geometry problem in real time, and tells you where you are within a few meters. It does this anywhere on the planet, with no infrastructure on the ground required, in tens of milliseconds. The fact that GPS works at all is a vindication of relativity that engineers had to actually build into the system or watch it fail within minutes. The fact that it works on a five-dollar receiver is a smaller miracle that happens to be entirely the product of clever signal processing. This post walks the physics of how a fix is computed from four satellites you cannot see, why three would not be enough, the relativistic clock corrections that would otherwise destroy the accuracy, how a phone hears the signal at all, and the difference between a cold fix that takes thirty seconds and a warm one that takes one.
The Geometry: Spheres, Not Triangles
The intuition for GPS starts with trilateration, which is the geometric trick of using known distances from known points to find an unknown location. Imagine three lighthouses at known positions. If you know your distance to the first lighthouse — say, 4 km — you are somewhere on a sphere of 4 km radius around it. If you also know your distance to a second lighthouse — 6 km — you are on a sphere around that one too, which means you are on the intersection of the two spheres, which is a circle. Add a third lighthouse and a third sphere, and the three spheres intersect at two points. Usually one of those points is on or near the Earth’s surface and the other is in deep space, so picking the right one is easy.
GPS works exactly this way, with one substitution: instead of three lighthouses on the ground, you have a constellation of 24 to 32 satellites orbiting at roughly 20,200 km altitude in medium-Earth orbit, each transmitting a signal that identifies itself and broadcasts a precise timestamp. The receiver measures how long that signal took to reach it, multiplies by the speed of light, and the result is the distance to the satellite. Three such measurements would, in principle, give you a 3D position fix.
The reason GPS needs four satellites and not three is the same reason your wristwatch is not a measurement instrument. The geometric trick depends on knowing the travel time of each signal accurately, which means the clock in the receiver has to be synchronized with the clocks on the satellites. The satellites carry cesium and rubidium atomic clocks accurate to nanoseconds. Your phone carries a quartz oscillator drifting by microseconds per second. If you tried to measure satellite distances with a phone clock that is off by even one microsecond, your distance estimates would be wrong by 300 meters each, and the three spheres would not intersect cleanly at any point. The fix would be garbage.
The fourth satellite solves this elegantly. With four unknowns to solve for — the three spatial coordinates of your position plus the unknown offset of your receiver’s clock from GPS time — you need four equations, one from each satellite. The receiver computes whatever clock offset is required to make all four spheres consistently intersect at a single point, and that simultaneously gives you your 3D position and a corrected version of GPS time accurate to nanoseconds. The fourth satellite turns a clock you cannot trust into one you can.
This is the central insight of GPS: it is not really a navigation system, it is a time-distribution system that you can extract position from as a side effect. Every GPS receiver is also one of the most accurate clocks in your house.
Three satellites, perfect clock: Four satellites, real clock:
S1 S2 S1 S2 S3
\ / \ | /
\ / \ | /
\ / \ | /
\/ \ | /
/\ (you are here) \ | /
/ \ \ | /
/ \ \|/
/ \ (you are here)
S3 |
S4
3 spheres -> 2 candidate points, 4 spheres -> unique intersection
ASSUMING the receiver clock is AND a solved-for clock correction.
already synchronized to satellites.
The Satellites: Atomic Clocks in Orbit
A GPS satellite is fundamentally a flying atomic clock with a radio transmitter. Each satellite carries multiple atomic clocks (typically a mix of rubidium and cesium oscillators, plus newer hydrogen masers on the latest blocks) that maintain time to roughly one nanosecond — one part in a billion per second. From these clocks, the satellite generates a 1.57542 GHz radio signal (the L1 frequency for civilian use; military and modernized signals use additional frequencies including L2 and L5) modulated with a continuous timestamp and a code identifying which satellite is transmitting.
The constellation is engineered for global coverage. The official GPS plan calls for 24 satellites in six orbital planes inclined at 55 degrees, four satellites per plane, in 12-hour orbits at 20,200 km altitude. In practice, more than 30 satellites are typically operational at any moment for redundancy and improved geometry. From anywhere on Earth, with a clear sky, at least four and typically eight or more satellites are above the horizon at all times. Their orbits are precisely tracked by ground stations and small corrections are uploaded constantly so that each satellite knows where it is and broadcasts that information.
The ground segment is a small network of monitor stations around the world that listen to all satellites continuously, compute exactly where each one is in its orbit (the ephemeris, accurate to the centimeter for that exact moment) and how much its clock has drifted, and upload corrections to each satellite. The Master Control Station at Schriever Space Force Base in Colorado runs the whole thing. The system is one of the few critical pieces of global infrastructure that anyone can use for free without permission, and it has been continuously operational since 1995.
The Relativity That Would Have Broken It
This is the part that turns GPS from clever engineering into something that should give Einstein a footnote in every receiver datasheet. The atomic clocks on GPS satellites do not tick at the same rate as identical clocks on the ground, and the discrepancy is large enough to destroy the system in minutes if uncorrected.
Two relativistic effects work in opposite directions. Special relativity says that a clock moving relative to an observer ticks slower (time dilation due to velocity). GPS satellites move at about 14,000 km/h in their orbits, which makes their clocks run slower than ground clocks by approximately 7 microseconds per day. General relativity says that a clock in a weaker gravitational potential ticks faster than one in a stronger potential. At 20,200 km altitude, gravity is much weaker than at the Earth’s surface, so the satellite clocks run faster than ground clocks by approximately 45 microseconds per day.
The net effect is that satellite clocks gain roughly 38 microseconds per day relative to clocks on the ground. Multiplied by the speed of light, 38 microseconds per day is about 11 kilometers per day. A GPS receiver that did not account for this would accumulate position errors growing at roughly 11 km per day — and that error would compound until the system was useless within hours.
The solution is built into the satellite hardware. Before launch, the atomic clocks on each satellite are deliberately slowed relative to their nominal frequency by the net relativistic factor, so that once they reach orbit and the relativistic effects speed them up by 38 microseconds per day, they appear to tick at the correct rate from the ground’s perspective. Smaller, position-dependent corrections (for the slight eccentricity of the orbit, the gravitational well of the Earth varying with altitude over the orbit, and signal propagation through the atmosphere) are applied in software on the receiver. The end result: a system that requires the engineers who built it to take general relativity seriously as an engineering tool, not a curiosity. GPS is one of a handful of consumer technologies that would have failed if relativity were wrong.
The other relativistic correction worth knowing about is Sagnac: because the Earth is rotating during the half-second or so it takes a signal to travel from satellite to receiver, the receiver has moved during the trip, and the calculation has to be done in a non-rotating reference frame and then transformed. This is a small (nanosecond-class) effect, but it adds up to meters of error if ignored.
The Signal: How a Phone Hears Something Weaker Than Noise
A GPS satellite transmits at about 27 watts. By the time that signal has traveled 20,000+ kilometers and spread out over the entire Earth-facing hemisphere, the power arriving at your phone’s antenna is in the neighborhood of -160 dBW (10^-16 watts) — below the thermal noise floor of the receiver. You cannot hear it the way you hear an FM radio station, where the signal is louder than the noise. So how does a phone receive it at all?
The answer is the C/A (Coarse/Acquisition) code, a pseudorandom binary sequence that each satellite transmits at 1.023 megachips per second. Each satellite has its own unique 1023-bit code that repeats every millisecond. The code looks random but is actually deterministic, generated by a known shift-register algorithm; every receiver in the world knows the code each satellite uses.
The trick is correlation. The receiver generates a local copy of the C/A code for each satellite it might be hearing and slides it back and forth in time, multiplying the local code against the incoming signal and summing the result. When the local code is misaligned with the satellite’s actual signal, the sum is approximately zero — the pseudorandom code is uncorrelated with itself at any offset. When the local code lines up exactly with the satellite’s signal, the sum spikes dramatically — this is the correlation peak. The position of that peak in time tells you when the satellite’s code “arrived” at your receiver.
Mathematically, correlation acts as a very narrow filter that pulls a signal up out of the noise. The C/A code’s 1023-bit length and 1 ms repetition give a processing gain of about 30 dB, lifting the buried signal far above the noise floor in the receiver’s mind. The same trick is the foundation of CDMA-based cellular systems and modern radar, and it is why a phone’s tiny GPS antenna can pick up a signal that is, by any normal measurement, drowned. The math is doing what the antenna cannot.
Layered on top of the C/A code, at a much slower 50 bits per second, is the navigation message: the data the receiver actually needs to compute its position. This includes the timestamp, the satellite’s precise ephemeris (where it is), the almanac (coarse orbit data for the entire constellation), clock-correction parameters, and atmospheric-delay models. The navigation message takes 12.5 minutes to transmit a full almanac, which is part of why a cold start is slow.
Putting It Together: Computing a Fix
A working receiver continuously does five things, each of them subtly interesting:
-
Acquisition. Scan for visible satellites by correlating against each known C/A code until peaks are found. This is the slowest step on a cold start because the receiver does not know which satellites are above the horizon or what Doppler shift their signals carry due to satellite motion. It must search a 2D space of (satellite, frequency offset, code phase).
-
Tracking. Lock the correlation peak as it drifts due to satellite motion and receiver clock drift. Once acquired, a satellite stays tracked through narrow phase-locked and delay-locked loops in hardware.
-
Decoding. Extract the 50-bps navigation message from the tracked signal. The timestamp embedded in this message tells you, with millisecond precision, when each subframe was transmitted.
-
Pseudoranging. Measure the time delay between when each satellite said it transmitted and when the receiver detected the correlation peak. Multiply by c to get the apparent distance (called a “pseudorange” because it includes the receiver’s unknown clock error).
-
Position solution. Solve the four-unknown system of equations using the four (or more) pseudoranges, simultaneously yielding 3D position and the receiver clock correction. Done by iteratively linearizing around an initial guess (Earth’s center is fine), typically converging in three or four iterations.
The position solution itself is straightforward least-squares math once you have the inputs. The hard part of GPS is getting the inputs: hearing the impossibly faint signals, decoding the timestamps, accounting for relativistic and atmospheric corrections, and managing the receiver’s own clock drift. Modern GPS chips do all of this in dedicated silicon — fundamentally similar to the kind of signal-processing pipelines you find in cellular modems and radar — and present the result as a (lat, lon, altitude, time) tuple to the host system over a NMEA serial protocol or a vendor binary protocol.
Why Cold Fixes Are Slow and Warm Ones Are Fast
If you turn on a GPS receiver after weeks unused, in a new location, it can take 30 seconds or more to produce its first fix. Turn the same receiver back on five minutes later in the same place, and it fixes in under a second. The difference is what the receiver already knows.
A receiver’s state has three relevant pieces of cached information:
- The almanac: coarse orbital data for the entire constellation, valid for weeks. Used to predict which satellites are above the horizon and at what approximate Doppler shift. Cuts the acquisition search dramatically.
- The ephemeris: precise orbital data for each satellite, valid for about four hours. Required to compute the satellite’s exact position when it transmitted; without it the position solution cannot be computed.
- The last known position and time: used as the initial guess for the iterative position solver and to narrow the satellite-visibility prediction.
The standard receiver states:
| State | What it has | Time to first fix | Why |
|---|---|---|---|
| Cold start | Nothing useful | 30-60+ seconds | Must download almanac and ephemeris from satellites |
| Warm start | Almanac, last position, but old ephemeris | 25-50 seconds | Must wait ~30s for ephemeris to be transmitted |
| Hot start | Valid almanac, ephemeris, and recent position | 1-5 seconds | Just needs to reacquire and compute |
| A-GPS assisted | Pre-loaded almanac/ephemeris via cellular | 1-3 seconds | Skips the satellite download entirely |
The slowest part of a cold fix is almost always waiting for the navigation message to transmit. At 50 bps, the full ephemeris for one satellite takes 30 seconds to receive. Lose the signal during that 30 seconds (drive under a bridge, walk into a building lobby) and the receiver has to start over. This is precisely the problem Assisted GPS (A-GPS) solves.
A-GPS uses a phone’s cellular data connection to download the almanac and ephemeris from a server operated by the carrier or the device vendor, in milliseconds rather than 30+ seconds. The phone then knows exactly which satellites are visible and where they are, and only has to acquire and measure pseudoranges — the slow data-download step is skipped entirely. A modern phone with cellular signal usually gets a fix in 1–3 seconds from a “cold” power-up. Without cellular (in airplane mode, abroad without service), it falls back to standard GPS and takes the full satellite-data wait. The hardware is identical; the difference is whether the phone could shortcut the data download.
Modern receivers also do predicted ephemeris — using the cached current ephemeris plus orbital mechanics to extrapolate where satellites will be hours or days from now. This is why phones in airplane mode can still fix quickly for a day or two after leaving cellular: they downloaded the predicted data before disconnecting.
Accuracy, Failure Modes, and What’s Underneath
A consumer GPS receiver under good sky in 2026 typically delivers position accurate to 3–5 meters. The factors that degrade this:
-
Atmospheric delay. GPS signals propagate slower through the ionosphere (the charged layer 60–1000 km up) and the troposphere (the weather layer). Both layers slightly delay the signal, biasing the distance estimate. Single-frequency receivers correct for this with a model; dual-frequency receivers (L1 + L5, increasingly common in modern phones and chips) measure the delay directly by comparing arrival times at two frequencies, which respond differently to the ionosphere. Dual-frequency support is one of the biggest accuracy improvements in consumer GPS over the last few years.
-
Multipath. Signals bouncing off buildings, mountains, or the ground arrive slightly later than the direct signal, producing a confused correlation peak. Multipath is the killer for urban canyons — Manhattan, Hong Kong, downtown Tokyo — where the direct signal is often blocked and only reflections reach the receiver. There is no clean fix for this; only better antennas, multi-frequency, and higher-end receivers help.
-
Geometry. Position accuracy depends not just on signal quality but on the geometry of the satellites used. Satellites clustered in one part of the sky give worse accuracy than satellites spread evenly across it. This is summarized by DOP (Dilution of Precision): lower DOP, better geometry, smaller position uncertainty.
-
Other constellations. Modern receivers do not use only GPS. GLONASS (Russian), Galileo (European), BeiDou (Chinese), and QZSS (Japan, regional) all transmit similar signals. A phone listening to all of them sees 30–50 satellites instead of 8, getting much better geometry and accuracy. The blanket consumer term is GNSS (Global Navigation Satellite System); the underlying signal-processing tricks are the same.
For applications that need much better than 5 meters, differential GPS and RTK (Real-Time Kinematic) techniques compare a roving receiver’s measurements against a fixed reference station whose position is known precisely, canceling most error sources to get centimeter-level accuracy. This is what surveyors and autonomous vehicles use, and it requires both a base station and a communication link, but the underlying signal-receiving math is identical to a phone’s.
The whole stack — orbital atomic clocks, relativistic correction, pseudorandom code correlation, four-unknown position solving — runs in a few square millimeters of silicon in any modern phone, while the underlying transistors that make it possible are themselves a story in solid-state physics. Treat it as routine and you will miss what is actually happening every time your phone draws a blue dot on a map.
The other underappreciated story is what GPS provides besides position: extremely accurate time. Cell networks, power grids, stock exchanges, and any system that timestamps events at scale relies on the synchronized time GPS distributes for free across the planet. Loss of GPS is more often a catastrophic timing outage than a navigation one. This is why nation-state GNSS systems exist in parallel — having only one constellation of timing references is too much concentration risk for critical infrastructure — and why outages of GPS attract immediate attention from a much wider audience than just navigators.
Verdict
GPS works because four orbiting atomic clocks let a receiver simultaneously solve for both its position and the error in its own clock, turning a trilateration problem that would be hopeless with a bad timepiece into one that is straightforward least-squares math. The first non-obvious piece of cleverness is needing the fourth satellite to absorb the receiver’s clock error; the second is correcting the satellites’ own atomic clocks for both special- and general-relativistic effects, a net 38 microseconds per day that would render the system useless within an hour if ignored; the third is the C/A code correlation that lets a phone antenna recover a signal weaker than thermal noise by 30 dB of processing gain; and the fourth is the receiver-side state — almanac, ephemeris, last-known position — whose presence or absence is the difference between a 30-second cold fix and a one-second warm one, with A-GPS collapsing that gap by simply downloading the satellite data over cellular. Modern receivers stack all of this with multi-constellation tracking (GPS, GLONASS, Galileo, BeiDou) and dual-frequency ionospheric correction, delivering 3–5 meter accuracy on a chip the size of a coin in a phone that costs nothing extra. The full system is a beautiful piece of engineering precisely because every layer is doing real work: the orbits, the clocks, the relativity corrections, the spread-spectrum receiver, the equations, and the assisted shortcuts. Treat it as routine and you miss that one of the few things humanity has continuously kept overhead for the public good is a constellation of atomic clocks that thinks for you about where you are.
Sources
- Wikipedia, “Global Positioning System”: https://en.wikipedia.org/wiki/Global_Positioning_System
- NIH PMC, Neil Ashby, “Relativity in the Global Positioning System”: https://pmc.ncbi.nlm.nih.gov/articles/PMC5253894/
- Per Thirty Six, “How The Heck Does GPS Work? (An Interactive Exploration)”: https://perthirtysix.com/how-the-heck-does-gps-work
- STEM Learning, “The physics of GPS – Trilateration”: https://www.stem.org.uk/system/files/elibrary-resources/2018/08/Quantum%20Tech_Teacher%20guide_GPS%20and%20Trilateration.pdf
- eZoneToday, “The Science and maths Behind GPS: Trilateration Explained”: https://ezonetoday.com/2025/09/07/global-positioning-system-working-principle-trlateration/
- Ethan White (Medium), “The GPS — Relativistic Satellite Trilateration”: https://medium.com/@ethw99999/the-gps-relativistic-satellite-trilateration-5bf0d0b2287a
- U.S. GPS official site, “GPS Accuracy”: https://www.gps.gov/systems/gps/performance/accuracy/
- U.S. GPS official site, “Space Segment”: https://www.gps.gov/systems/gps/space/
Comments