1001Ferramentas
🌍 Calculators

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.

FAQ

Haversine or Vincenty? Haversine is fine for almost everything (~0.5% error, easy to implement). Use Vincenty for surveying, aviation flight planning over thousands of km, or any case where ellipsoidal precision matters.

Why does Google Maps show a longer distance? Maps shows the road distance (graph of streets); this tool shows the great-circle distance "as the crow flies", which is always shorter.

What's the difference between km, miles and nautical miles? 1 nautical mile = 1.852 km = 1.151 statute miles, and equals 1 arc-minute of latitude on Earth. Aviation and shipping use nautical miles.

What is the bearing? The initial compass direction from A to B (0° = north, 90° = east). On long routes following a great circle, the bearing changes along the path.

Related Tools

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.