Distance Between Coordinates
Calculate the great-circle distance between two GPS points using the Haversine formula. Result in km, miles and nautical miles, with bearing. Everything in your browser.
Ponto A
São Paulo
Ponto B
Rio de Janeiro
Distância (km)
—
Milhas
—
Milhas náuticas
—
Rumo (A→B)
—
Fórmula de Haversine
A fórmula de Haversine calcula a distância em arco (great-circle) sobre uma esfera. É a distância em linha reta entre dois pontos na superfície da Terra — mais curta que percorrer a curvatura, mas representa o caminho mais curto possível voando.
Usa raio médio da Terra de 6371 km. Erro típico de 0.5% para distâncias até 1000 km — suficiente para a maioria dos casos. Para precisão extrema, use Vincenty (que considera o achatamento da Terra).
Tudo no navegador.
Distance between coordinates: Pythagoras and Haversine
For two points on the Cartesian plane, distance is the Pythagorean theorem: d = √((x₂−x₁)² + (y₂−y₁)²). For points on the sphere (Earth, given as latitude/longitude), use the Haversine formula: d = 2R · asin(√(sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2))), with R = 6,371 km (mean Earth radius). Haversine has typical error below 0.5% — enough for most uses. The Vincenty formula models Earth as an oblate ellipsoid and is more accurate over long distances, at the cost of complexity. Other metrics include Manhattan distance |x₁−x₂| + |y₁−y₂| (used in grid-based routing) and Chebyshev distance max(|Δx|, |Δy|) (chess king moves). Example: São Paulo (−23.55, −46.63) to Rio (−22.91, −43.17) via Haversine ≈ 360 km in a straight line, while road distance is ~430 km.
Applications: GPS, geofencing and clustering
Used by GPS devices for waypoint distance, geofencing (alert when a vehicle leaves a zone), radius search on Uber/iFood/Rappi ("drivers within 5 km"), k-NN clustering in machine learning, and routing algorithms. Note: door-to-door travel time in Google Maps or Waze uses a street graph with Dijkstra/A*, not raw Haversine — the great-circle distance is only the lower bound. For drone delivery or air routes, Haversine is the right model.
Straight-line distance between coordinates
What's the straight-line distance between two points on the map? Since the Earth is curved, a simple subtraction won't cut it. That's where the Haversine formula comes in, accounting for the planet's sphericity, and it's what this tool applies from the GPS coordinates of the two points.
The result comes out in kilometres, miles and nautical miles, and it also carries the bearing (the heading, the direction from one point to the other). It's useful for aviation, navigation, route planning, coverage-radius calculations and any situation involving geographic distance.
Your coordinates don't go anywhere: the calculation runs entirely in the browser. Enter the two latitude/longitude pairs and the distance shows up right after.
Frequently asked questions
Haversine or Vincenty?
Why does Google Maps show a longer distance?
What's the difference between km, miles and nautical miles?
What is the bearing?
Related Tools
Haversine Distance Between Two Coordinates
Enter two latitude and longitude pairs to get the great-circle distance in kilometers and miles, using Earth mean radius R = 6371 km.
Belt Center Distance Calculator
Compute center distance between two pulleys for a given belt length using Liter's approximation.
Flight Distance (Haversine Formula)
Enter origin and destination latitude and longitude in degrees for the great-circle distance in km, taking Earth's mean radius as 6371 km.
Parallel Lines Distance 2D Calculator
Computes distance between two parallel lines in the plane from coefficients a x plus b y plus c1 and a x plus b y plus c2.
Home Magic Portal Walk
Computes minutes on foot between home and a magic portal at 80 m/min.
Geographic Midpoint Calculator
Calculate the geographic midpoint between two coordinates (latitude and longitude). Useful for finding a meeting spot halfway between two places.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.