Calculate the Distance Between Any Two Locations on a Map
This free online distance calculator lets you find the distance between two places on an interactive map. Enter any address, postcode, city name, or latitude/longitude coordinates in the From and To fields and click Calculate. The tool returns two results simultaneously: the straight-line (aerial) distance and the road driving distance, both in kilometres and miles.
A magenta dashed line shows the direct path between the two points. A solid blue line shows the actual road route calculated by the OSRM routing engine. Both are drawn on the interactive map and can be downloaded as a GeoJSON file for further analysis in QGIS, ArcGIS, or Mapbox.
Who Uses This Tool
Key Features
- Address & Postcode Search — accepts any address, city, ZIP, or postcode worldwide
- Coordinate Input — enter decimal-degree lat/lng directly in either field
- GPS Location — one click to set the From field to your current position
- Straight-Line Distance — Haversine formula, accurate to within metres for any distance
- Road Distance — OSRM open-source routing for realistic driving distance
- Dual Results — km and miles shown simultaneously for both distance types
- Visual Map Lines — magenta dashed straight line and blue solid road route
- Search History — last 5 searches shown as clickable chips to quickly re-run
- GeoJSON Export — download both paths with distance properties for GIS use
- Basemap Switcher — Street, Satellite, and Terrain base layers
- Fullscreen Mode — expand to a full-browser view for easier work
How to Use — Step by Step
Type any street address, town, postcode or ZIP code into the From and To boxes. You can also enter decimal-degree coordinates (e.g. 51.5074, -0.1278). Press Enter or click Calculate.

Click "📍 My Location" to automatically fill the From field with your current GPS coordinates. Your browser will ask for permission. A green marker appears on your position.

Latitude/longitude coordinates in decimal degrees work in both fields. Format: 29.7519, -95.3677. Useful when you already know the exact geographic position of a point.

After calculating, the map shows two lines: a magenta dashed line for the straight-line (aerial) path, and a solid blue line for the actual road route. Both markers appear with popups.

The results panel shows the full address of each location, the straight-line distance in km and miles, and the road driving distance in km and miles. Recent searches appear as clickable history chips.

Click the red Clear button to remove all markers, lines, and results from the map and reset both inputs. The map returns to the global view, ready for a new calculation.

Click GeoJSON to download a standard GeoJSON FeatureCollection with two LineString features — one for the straight-line path and one for the road route — including distance properties.

The downloaded file contains both paths with distance_km and distance_miles properties. Open it in QGIS, ArcGIS, Mapbox, Google Earth, or geojson.io for further GIS analysis.

Straight-Line vs Road Distance Explained
| Type | Also Known As | How Calculated | When to Use |
|---|---|---|---|
| ━ ━ Straight-line | Aerial, as-the-crow-flies, geodesic | Haversine formula on WGS84 sphere | Signal coverage, coverage radius, bird migration, quick estimates |
| ━━━ Road distance | Driving distance, route distance | OSRM shortest-path routing on OpenStreetMap road network | Delivery time, fuel cost, logistics planning, travel time |
Road distance is always ≥ straight-line distance. In urban areas with good road networks the difference is typically 20–40%. In areas with rivers, mountains, or sparse roads the ratio can be much higher.
Distance Unit Reference
| Unit | Symbol | Conversion | Common Use |
|---|---|---|---|
| Kilometre | km | 1 km = 1,000 m | International standard, most countries |
| Mile | mi | 1 mi = 1.60934 km | USA, UK, Liberia, Myanmar |
| Metre | m | 1 m = 0.001 km | Short distances, engineering |
Frequently Asked Questions
Open Source & Credits
- Map library: Leaflet — open-source interactive maps
- Routing engine: OSRM — open-source routing on OpenStreetMap
- Geocoding: Nominatim / OpenStreetMap — address and postcode search
- Map tiles: CARTO Light, OpenStreetMap, Esri (satellite/terrain)