September 20, 2025 · 6 min read · MapBench editorial
Distance Calculation: Haversine, Geodesics & When It Matters
The shortest path between two points on the Earth's surface is not a straight line on a flat map — it's an arc of a great circle. Any tool that measures real distances has to respect the planet's curvature.
The haversine formula
Haversine treats the Earth as a sphere with the mean radius 6371.0088 km and computes the central angle between two points from their latitudes and the longitude difference. It's numerically stable even for tiny distances and is the workhorse of virtually every quick distance tool on the web — including ours.
The ellipsoidal truth
The Earth isn't a sphere: it's flattened at the poles by about 21 km. Geodesics on the WGS84 ellipsoid (computed by Vincenty's or Karney's algorithms) are the reference answer. The sphere-vs-ellipsoid error is bounded by the flattening — at most about 0.3%, and usually far less on typical routes. For a 1000 km trip that's under 3 km; for a city commute it's centimetres.
When the difference matters
- Surveying, legal boundaries and engineering: use an ellipsoidal library (e.g. GeographicLib) and the correct CRS.
- Navigation and aviation: great-circle math is exactly what they use, plus winds and airspace.
- Web tools, logistics estimates, data analysis: haversine on WGS84 is well within the noise of the question.
Areas deserve the same care. Our polygon tool uses the spherical-excess method, which integrates around the boundary on the sphere — robust from garden plots up to country-sized shapes.
The toolkit behind this post, in depth
Distance Between Two Places
Search any two places on Earth — cities, addresses, airports or raw coordinates — and this tool returns the straight-line distance between them in miles, kilometres, meters, feet or nautical miles, together with the initial bearing and its compass point. The calculation is a great-circle measurement on the WGS84 sphere using the haversine formula: the same geometry behind flight planning, and accurate to within about 0.3% of a full ellipsoidal geodesic. A dashed line on the map shows exactly what is being measured, and swapping A and B takes one click.
Use it for quick reality checks — how far is the airport, how big is this country, how far apart are two offices — and as the entry point to deeper tools: the bearing calculator for direction, the halfway tool for meet-ups, the driving calculator for road distance and time. Because straight-line distance is the physical lower bound, it is the right number for radio range, wildlife movement, flight baselines and service-radius thinking. Coordinates are accepted in decimal or DMS, results convert across all units live, and the URL stores both points so any calculation is shareable and reproducible.
Great Circle Calculator
A great circle is any circle whose centre is the Earth's centre, and its arcs are the shortest surface paths between points — the reason long-haul flights curve toward the poles on a flat map. This calculator exposes the full geometry: distance along the arc, the initial bearing you would steer at departure, and how direction evolves along the route. Enter two places or coordinates and the results panel separates initial from final bearing, making visible the subtle turn a true shortest-path flight performs, something a single 'direction' number hides.
The math is spherical trigonometry on the WGS84 mean sphere: haversine for distance, the standard atan2 azimuth formula for bearings — the same equations aviation distance tables are built from, accurate to about 0.3% of ellipsoidal geodesics. Pilots, dispatchers, students and sim enthusiasts use the page to check route legs, understand why JFK–HKG arcs over Alaska, or verify homework. Pair it with the nautical calculator for knots and passage time, or the map radius tool to visualise range rings from the same departure point.
Map Area Calculator
Click the corners of a field, plot, lake or district and this tool closes the polygon and reports its true spherical area — square metres, hectares, acres, square kilometres and square miles — plus the perimeter. The math uses the spherical-excess method on the WGS84 sphere, which stays accurate from garden plots to county-sized shapes, where flat 'shoelace on lat/long' formulas silently produce nonsense. Undo removes a vertex, closing is one click, and the finished polygon exports as GeoJSON or KML for records and GIS.
Farmers checking paddock sizes, buyers verifying listing claims, teachers demonstrating hectares, drone pilots sizing survey jobs — the workflow is the same: click, close, read, export. At this resolution the tool measures the boundary you draw; for legal survey grades, licensed surveyors and local datum transformations remain authoritative, and the page says so. When the shape is a circle the circle-area calculator is faster, and when you already have vertex coordinates the polygon calculator accepts pasted lists directly.
Crow-Flies Distance Calculator
'As the crow flies' is the everyday name for great-circle distance: the shortest possible path between two points along the Earth's curved surface, ignoring roads, fences and terrain. Enter two places or coordinates and this tool computes that path with the haversine formula, reporting it in miles, kilometres, meters, feet or nautical miles plus the initial compass direction. The map's dashed line shows the true shortest path — and on long east-west routes it visibly reminds you why flat maps lie: the straight line on a globe projects as a curve.
Straight-line distance is the right metric whenever nothing on the ground constrains movement: radio and cellular coverage, drone and aircraft range, bird and seed dispersal, light and sound propagation, insurance radius clauses, and quick geographic comparisons. When roads do matter, the driving distance tool provides the on-road counterpart so you can see the detour penalty side by side. Both endpoints accept names, addresses or raw coordinates, results convert live between units, and the shareable URL reproduces your exact pair — free, private and instant in the browser.
The geometry of distance: why the crow flies in arcs
Distance on a planet is not distance on paper. The shortest path between two points on Earth is an arc of a great circle — a circle whose centre is the planet's centre — and every serious distance tool computes that arc, not a straight line on a flat map. The standard formula, haversine, turns two latitudes and a longitude difference into a central angle and multiplies by Earth's mean radius. On the WGS84 sphere it agrees with survey-grade ellipsoidal geodesics to about three parts in a thousand, which is far tighter than the uncertainty in most real questions, like where exactly 'the city centre' is.
Bearings complete the picture. The initial bearing is the compass angle you would steer at departure; on a great circle it drifts continuously as the route crosses meridians, so the final bearing at arrival is generally different. That drift is why intercontinental flights arc toward the poles on flat charts — they are not detouring, they are taking the shortest path, and the map is what bends. Tools that report a single 'direction' for a long route are hiding this geometry; the honest display shows initial bearing, final bearing and the compass point for humans.
Finally, keep the family of distances distinct in your head: straight-line (the physical lower bound, right for radio and wildlife), road distance (what you drive, always equal or longer), and travel time (road distance reshaped by speed limits and network structure). Comparing the first two tells you how much geography taxes your route — a number that is itself interesting, whether you are planning a commute or pricing a delivery zone.
Distance literacy: choosing the right yardstick
Most distance errors are category errors: quoting straight-line where a road is meant, or a road where a schedule is meant. A useful discipline is to name the yardstick aloud in every sentence that uses a number — 'as the crow flies', 'by road', 'at free-flow speeds'. The three form a ladder of realism, each rung adding assumptions: the sphere's geometry, the network's topology, then human speed limits. Crow-flies is reproducible forever from coordinates alone; road distance depends on the mapping vintage; travel time depends on the traffic model. Knowing which rung your decision stands on tells you how much it can move.
The ladder also teaches when disagreement is a bug and when it is truth. If your road distance is shorter than your straight-line distance, something is wrong — topology cannot beat geometry. If two straight-line tools disagree by more than half a percent, one is using flat math or a wrong radius. And if bearings from A→B and B→A don't differ by roughly 180° (convergence aside from exact antipodal oddness), a tool is faking the back-bearing. These consistency checks cost seconds and catch most published nonsense.
- State the yardstick in every sentence that carries a number; ambiguity is the enemy, not imprecision.
- Use nautical miles and bearings together for anything marine; statute miles and compass points for prose.
- For multi-point studies, export the matrix as CSV and let the spreadsheet hold the single source of truth.
- Check tool sanity with known pairs (Equator quarter ≈ 10,018 km; London–Paris ≈ 344 km) before trusting exotic ones.
Honest limits & when to escalate
The honest limits here are about category, not quality: great-circle math is near-exact, but it answers 'how far over the surface', not 'how far as driven, flown or walked'. Airline distances follow airways and winds; odometers follow detours; hikers follow switchbacks. Quoting a straight-line number into a fuel budget is the classic misuse, which is why the tools keep the ladder visible — crow-flies, road, time — and label each rung. A second limit is definitional: 'city to city' means mapped centre to mapped centre, and a suburb-to-airport question is a different measurement wearing the same sentence.
Within those bounds the numbers are durable: reproducible from coordinates alone, stable across tools that use the same radius convention, and accurate to a fraction of a percent of geodetic truth. The escalation path is short and rarely needed — ellipsoidal libraries (Karney's algorithms) for survey-grade millimetres, the routing engine for network truth, and the airline's schedule for invoice truth. Knowing which authority owns which number is the entire craft of distance literacy.
- Survey-grade millimetres → ellipsoidal geodesic libraries, not sphere math.
- Fuel and schedule planning → road routing plus your congestion buffer.
- Airline invoicing → carrier distance tables (airways ≠ great circles).
- Legal boundary lengths → licensed survey, never a clicked polygon.
Step-by-step masterclass
- Name the yardstick first — Decide straight-line, road or schedule distance before typing anything; the three form a ladder of realism and mixing them silently is the classic distance error.
- Enter endpoints at the right grain — City-to-city for comparisons, addresses for logistics, coordinates for datasets — the grain sets the honest precision of the answer you'll quote.
- Read bearing with the distance — A distance without direction is half a fact; the compass point turns the number into something a human can point at.
- Cross-check with a known pair — London–Paris ≈ 344 km, a quarter meridian ≈ 10,018 km; two seconds of calibration catches broken tools and broken inputs alike.
- Export the pair, not just the number — Share the URL or copy both endpoints; a distance without reproducible endpoints is unverifiable folklore.
Great-circle math is universal, but the meaning of 'between two places' varies by mapping culture: US users expect miles and ZIP-to-ZIP convenience, European users think in kilometres and postcodes, marine users in nautical miles — the unit table exists precisely so one calculation serves every convention without rounding arguments.
Tips & common mistakes
Always confirm which distance you need before quoting one: straight-line for physical questions, road distance for driving, and network time for schedules. The three can differ by half again in mountainous or island geography, and quoting the wrong one is the most common distance mistake in reports.
Remember that bearings are true-north by default. If you are transferring a bearing to a magnetic compass, add (or subtract) your local declination — it exceeds 10° in many inhabited regions and flips hemispheres of behaviour.
Use the midpoint tool instead of averaging coordinates when splitting journeys: latitude/longitude averages distort over long legs and fail across the date line, while the spherical midpoint follows the actual path the distance was measured along.
Quick glossary
- Great circle: A circle centred on Earth's centre; its arcs are the shortest surface paths.
- Haversine: The standard stable formula for great-circle distance on a sphere.
- Initial bearing: Compass angle from true north at departure along a great circle.
- Geodesic: The ellipsoid-true shortest path; haversine approximates it within ~0.3%.
Two more questions, answered
Which unit is 'most accurate'?
None — they're exact conversions of one measurement; pick the unit your reader thinks in.
Do mountains change great-circle distance?
No — it's the surface path on the reference sphere; terrain adds effort, not arc length.