Methodology
How Speedometera turns GPS fixes into speed, distance, max and average: Doppler speed, haversine distance, accuracy filters, smoothing, units and testing.
Last updated: 25 October 2026
In short: our speedometer shows the speed your phone's GPS chip measures from the Doppler shift of satellite signals. When a phone does not report that, we divide the distance between two good position fixes by the time between them. Fixes worse than ±50 m are dropped, speeds under 0.5 m/s count as standing still, and the displayed number is lightly smoothed. Every formula below is the code the site actually runs, and you can check it in the tools.
Where the data comes from
The speedometer uses the browser's W3C Geolocation API. We call watchPosition with enableHighAccuracy: true, maximumAge: 0 (never reuse a cached fix) and a 20-second timeout. Each reading the browser hands us contains:
- latitude and longitude in decimal degrees (WGS 84);
- accuracy in metres. The W3C specification defines it as the radius of a 95% confidence circle around the reported position;
- speed in metres per second, or
nullwhen the device cannot supply it; - heading (degrees clockwise from true north), altitude and altitude accuracy when available;
- a timestamp in milliseconds.
All of this is processed in your browser. Your location is never sent to our server, and trips are not stored anywhere unless you export a GPX file yourself. The only thing the speedometer saves is your chosen unit, kept in your browser's local storage. The only server code we run handles newsletter sign-ups under /api/; like any website, our host Cloudflare still processes basic request data such as IP addresses (see the privacy policy).
How speed is calculated
The function speedOf() in our speed library picks the speed in this order:
- Device (Doppler) speed first. If the fix carries a finite, non-negative
speed, we use it as given. GNSS receivers work this out from the Doppler shift of the satellite carrier signals. That measures velocity directly instead of differencing two noisy positions, so it is the most precise source on almost every modern phone. - Position difference otherwise. If there is no device speed, we take the great-circle distance from the previous good fix and divide it by the elapsed time:
v = haversine(prev, cur) ÷ Δt. If Δt is zero or negative, or there is no previous fix, the speed is unknown. - Plausibility cap. A derived speed above 500 m/s (1,800 km/h, about 1,118 mph) is thrown out as a glitch. That is faster than any airliner at cruise, so a real trip never gets near it.
Smoothing
Raw GPS speed jitters by a few tenths of a metre per second, so the number on screen is smoothed with an exponential moving average: shown = shown + α × (new − shown) with α = 0.6. Each new reading moves the display 60% of the way toward the latest value. A step change is about 84% complete after two updates, so the reading stays responsive without flickering. Smoothing affects only the display. Max speed, distance and average are calculated from the unsmoothed values.
Distance: the haversine formula
The distance between two fixes comes from the haversine great-circle formula on a sphere with the IUGG mean Earth radius R = 6,371,008.8 m:
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2); d = 2R · asin(√a)
Treating Earth as a sphere rather than the WGS 84 ellipsoid introduces an error of at most about 0.5%. Over the few metres between one-second fixes, that is far smaller than GPS noise.
Accuracy filters
| Rule | Threshold | Why |
|---|---|---|
| Ignore poor fixes | accuracy worse than 50 m | Indoor and urban-canyon fixes can jump tens of metres and would invent speed and distance. |
| Stationary threshold | below 0.5 m/s = 1.8 km/h ≈ 1.1 mph | Stops "phantom" distance from piling up while you stand still. Normal walking (about 1.3 m/s) is well above it. |
| Glitch rejection | above 500 m/s = 1,800 km/h | Removes teleporting jumps when a receiver re-acquires satellites. |
A fix that fails the accuracy test is skipped completely. It does not become the reference point for the next calculation.
Distance, max and average rules
Each accepted fix is folded into the trip as follows:
- Elapsed time grows by the time between consecutive accepted fixes.
- Moving time and distance grow only when the speed for that fix is at or above the stationary threshold. A segment is added to distance only if it also passes the 500 m/s plausibility check.
- Max speed is the highest per-fix speed after filtering. It is not smoothed, so a short burst of real acceleration registers. A single bad fix does not, because the filters drop it first.
- Average speed is the moving average: total distance ÷ moving time. Time stopped at lights does not pull it down. This matches how most car trip computers report average speed, and it differs from total distance ÷ total elapsed time.
- Pace (running and walking presets) is 1,000 m or 1,609.344 m ÷ speed ÷ 60, in minutes per km or per mile. It is blank below the stationary threshold.
Unit constants
All speeds are handled internally in m/s and converted only for display. Every constant except Mach is exact by definition (NIST SP 811).
| Unit | Definition | 1 m/s equals |
|---|---|---|
| km/h | 1,000 m per 3,600 s | 3.6 km/h |
| mph | 1 international mile = 1,609.344 m | 2.236936 mph |
| knot | 1 nautical mile (1,852 m) per hour | 1.943844 kn |
| ft/s | 1 ft = 0.3048 m | 3.280840 ft/s |
| Mach | speed of sound in the ICAO standard atmosphere at sea level (15 °C) = 340.294 m/s | 0.002939 Mach |
The speed converter turns any value into m/s and then into the target unit, so every unit pair uses the same two exact factors. Mach depends on air temperature. Our figure holds only at standard sea-level conditions, and the converter is labelled that way. Altitude is shown in feet (× 3.28084) when the unit is mph and in metres otherwise.
Tire and calibration maths
The tire size calculator reads metric codes such as P245/75R16 and flotation codes such as 33x12.50R15. For a metric tire:
- sidewall height = width (mm) × aspect ratio ÷ 100;
- overall diameter = 2 × sidewall + rim diameter × 25.4 mm;
- circumference = π × diameter; revolutions per mile = 1,609,344 mm ÷ circumference.
When you compare two sizes, true speed = indicated speed × (new diameter ÷ original diameter). The speedometer error is (1 ÷ ratio − 1) × 100%. We flag diameter changes larger than ±3%, a common industry rule of thumb rather than a legal limit. These are nominal figures for a new, unloaded tire. Real rolling diameter varies with brand, tread wear, pressure and load.
The speedometer calibration calculator uses these formulas:
- error % = (indicated − true) ÷ true × 100;
- correction factor = true ÷ indicated;
- timed-mile speed = distance × 3,600 ÷ seconds;
- axle-ratio factor = old ratio ÷ new ratio;
- corrected pulses-per-mile setting = current setting ÷ factor.
GPS accuracy limits
A GPS speedometer is only as good as the signal. According to GPS.gov, GPS-enabled smartphones are typically accurate to within about 4.9 m (16 ft) under open sky, and accuracy degrades near buildings, bridges and trees. In practice:
- Cold start: the first fixes after you open the page are often coarse. Outdoors, readings usually settle within seconds to a minute.
- Tunnels, subways and indoors: without a satellite signal there is no real speed, so on underground trains the reading freezes or drops to zero.
- Aircraft: GPS can work from a window seat, but the cabin weakens the signal, and airlines set their own rules on device use.
- Browser and OS: some browsers do not pass Doppler speed through. We then fall back to position differences, which are noisier at low speed.
- Not a certified instrument: readings are for information only. They are not evidence of your speed and are not for legal compliance or safety-critical navigation. Follow posted limits and your vehicle's speedometer. Built-in speedometers are regulated (for example by UNECE Regulation No. 39) and are allowed to read slightly high.
How we test
All the maths lives in pure TypeScript modules with no browser code, so it can be tested in isolation with Vitest. At the time of writing the suite has 43 automated tests: 24 for the speed engine, 11 for unit conversion and calibration, and 8 for tire geometry. Among other things, they check:
- exact unit constants and round-trip conversions;
- known great-circle distances between real cities;
- that Doppler speed takes priority, plus derived speed and zero or negative time steps;
- stationary jitter, poor-accuracy fixes and implausible jumps;
- max speed, moving average, pace, duration formatting and GPX export;
- tire geometry and calibration edge cases such as zero or invalid input.
Our deploy script runs npm run verify first: the tests, a type check, a production build and an SEO gate. If any step fails, that deployment stops.
How we source and fact-check content
- Primary sources first: standards bodies (NIST, ICAO, UNECE, W3C), government agencies (GPS.gov, NHTSA, FAA), manufacturer specifications and peer-reviewed papers. Secondary articles help us find sources but are never the final citation.
- Original numbers: the tables on our pages are generated by our own tested code or calculated from cited definitions. We do not copy them from other sites.
- One author, checkable work: every page is researched and written by Izhar Ahmad Danish. There is no separate technical reviewer, so we make the work verifiable instead: formulas and thresholds are listed on this page, the code that runs them is covered by the tests above, and each claim links to its source. Each page shows its author and the date it was last updated. Drafts that do not yet meet our quality bar stay out of search indexes (
noindex). - Self-check before publishing: numbers in tables are regenerated from the tested code, every external link is opened and checked against the claim it supports, and worked examples are recalculated by hand.
- Images: illustrations are our own, or royalty-free with credit.
More detail is in our editorial standards.
Privacy, ads and analytics
Location is processed only on your device. Google Analytics 4 runs on the live site only when it has been configured, and we plan to show Google AdSense ads around the content, never inside the speedometer. Once ads are live, Google's AdSense program policies require us to tell you that Google and its partners may use cookies to serve ads based on your visits to this and other sites. You can turn off personalised ads in Google Ad Settings. The site is not directed at children under 13 (see the FTC's COPPA guidance). Rights for California residents under the CCPA, as explained by the California Attorney General, are covered in our privacy policy, which also lists the cookies involved and how to opt out.
Update and corrections policy
- We review this page whenever the speed engine changes, and at least every six months.
- We recheck tool pages when a cited law, standard or source changes. The "updated" date on each page shows when that last happened.
- If you spot an error, tell us. We check the report against the primary source, fix confirmed errors, update the date and note significant corrections on the page.
- When a reported error is in the maths, we add a test that reproduces it before fixing it, so the same mistake cannot return.
Sources
- W3C: Geolocation API specification
- GPS.gov: GPS accuracy
- NIST SP 811: Guide for the Use of the International System of Units
- UNECE vehicle regulations (Regulation No. 39, speedometers)
- Google AdSense program policies
- FTC: Children's privacy (COPPA)
- California Attorney General: California Consumer Privacy Act