Distance Calculator
Calculate the straight-line (great-circle), driving and walking distance between any two places on Earth. Enter two cities, addresses or latitude/longitude pairs and get results in kilometers, miles and nautical miles instantly.
This page explains how the distance calculator works, the data and formulas behind it, and how to interpret the result. Great-circle distances are the shortest path over the Earth's surface - the route aeroplanes actually follow. They are the baseline every other distance estimate starts from, and are accurate to ~0.3% of the more complex ellipsoidal (WGS84) distance. The tool is one of 329 free, open tools on JoseFitani for maps and geography. It runs in your browser with no sign-up needed. Use the search field or click the map to drop a pin - the tool uses the Haversine formula on a sphere of radius 6,371 km, plus mode-specific detour factors for driving, walking and flight-time estimates and returns the result in seconds. Below you'll find a step-by-step guide, real use cases, the methodology, FAQs, and data sources.
How to use this tool
Type your query, paste coordinates, or click on the map. The tool uses the Haversine formula on a sphere of radius 6,371 km, plus mode-specific detour factors for driving, walking and flight-time estimates to process your input locally in the browser.
The result appears instantly with the map showing your location. You can adjust by clicking elsewhere or searching a new place.
Click Copy to save to clipboard, or Share to send a direct link with the exact inputs.
What people use this tool for
Travellers weighing a direct flight against a connecting itinerary can compare the true great-circle distance of each option. A connection that looks short on a flat map is often much longer once the Earth's curvature is accounted for, which helps explain higher fares and longer travel days.
Small business owners sourcing stock or ingredients can rank candidate suppliers by straight-line distance before making contact. It is a fast first filter: the closest supplier as the crow flies is worth calling first, even though road distance and delivery terms still need checking.
Thru-hikers and trekkers use straight-line distance between resupply points or camps to establish the absolute minimum ground they must cover. Real trail distance is always longer, so this number anchors conservative planning for food, water, and daylight.
Anyone shipping goods internationally can use great-circle distance to sense-check whether a freight quote is in a sensible range. Quotes should broadly track with distance, so a wildly out-of-line figure stands out immediately and invites a second quote.
How it's calculated
Straight-line distance is computed with the Haversine formula, which treats the Earth as a sphere of radius 6,371 km. Road and walking distances approximate straight-line values with mode-specific correction factors - for precise road distances a routing engine such as OSRM is required.
The calculation runs in your browser - no data is sent to our servers. Map tiles come from OpenStreetMap (ODbL license), geocoding uses Nominatim (1 request/second limit), and elevation uses the Open-Elevation API backed by SRTM data. All are free, open services.
All calculations use the WGS84 datum (EPSG:4326), the same as GPS. For other datums (NAD27, NAD83, ETRS89), a separate conversion is needed. The difference is typically under 1 metre - negligible for most uses but important for survey-grade work.
The formulas match those in professional GIS software (QGIS, ArcGIS, Global Mapper), just in a browser-friendly form. For sub-metre accuracy, use professional software with ellipsoidal calculations. Results are shown in multiple units: km and miles for distance, km²/m²/hectares/acres for area, metres and feet for elevation. Conversion factors are exact (1 mile = 1.609344 km), so the only error source is input precision.
Related tools and resources
Frequently asked questions
How is great-circle distance calculated?
Using the Haversine formula which computes the shortest distance between two points on a sphere.
Why does driving distance differ from straight-line?
Roads follow terrain and the existing network, so real travel distance is typically 1.2-1.5x the great-circle distance.
Are results accurate?
Great-circle distances are accurate to ~0.3%. Driving and walking estimates are approximations unless routed via a real routing engine.
What is the difference between straight-line and driving distance?
Straight-line distance is the shortest arc over the Earth's curved surface between two points, while driving distance follows actual roads. Driving distance is almost always longer because roads detour around terrain, water, and built-up areas. Use straight-line figures for rough estimates and lower bounds, and driving distance when you need a route you can actually travel.
How accurate is the Haversine formula?
The Haversine formula treats the Earth as a perfect sphere with a radius of 6,371 km, while the real Earth is slightly flattened at the poles. The resulting error is typically well under half a percent, which is fine for travel planning, logistics estimates, and everyday curiosity. Surveyors who need centimetre-level precision use more complex ellipsoidal formulas instead.
Why are results also shown in nautical miles?
Nautical miles are the standard unit in aviation and maritime navigation, where one nautical mile equals one minute of latitude. Pilots cross-check flight plans in nautical miles, and sailors use them with nautical charts. Showing them alongside kilometres and miles saves a manual conversion for those users.
Does the calculator account for borders, mountains, or oceans?
No. It measures pure geometric distance and ignores everything in between: national borders, mountain ranges, seas, and restricted airspace. A short straight-line route can still require a very long real journey around an obstacle, so treat the result as a geometric fact, not a travel plan.
Can I measure between places in different countries?
Yes. Any two places with known coordinates can be compared, wherever they are on the globe. Enter city names, addresses, or landmarks and choose the correct suggestion from the list so the measurement starts from the intended point, since many place names exist in multiple countries.
Why does an airline list a different distance than this tool?
Airlines often publish ticketed-point mileage based on the airways their aircraft actually fly, which adds a few percent over the great-circle minimum. Wind, weather avoidance, and air-traffic routing stretch real flown distance further. The tool shows the theoretical minimum; the airline shows something closer to reality.
Is this the same as as-the-crow-flies distance?
Yes, exactly. Great-circle distance is the modern, mathematically precise version of the old as-the-crow-flies idea: the shortest path between two points on a sphere. The phrase dates from an era of flat paper maps; the formula corrects for the Earth's curvature.
Does the calculation itself need the internet?
The Haversine math runs entirely in your browser and needs no connection. What does need the internet is place-name search: turning a typed city or address into coordinates queries an online gazetteer. If you already have coordinates, you can paste them in and measure with no search at all.
Data sources & methodology
- OpenStreetMap — Map tiles and address data.
- Open-Elevation API — Free elevation lookup.
- Nominatim — OpenStreetMap-based geocoding.
- WGS84 datum — Global reference datum used by GPS.