Distance Between Coordinates
Measure the great-circle distance, bearing and midpoint between two latitude/longitude points, right in your browser.
The two coordinates you enter are used to compute distance, bearing and midpoint entirely in your browser and are never uploaded; only OpenStreetMap tiles are fetched to render the map.
Want to plot a single point? Open the Coordinate Map Viewer.
About Distance Between Coordinates
This calculator measures the great-circle distance between two latitude/longitude points using the haversine formula, and shows it at once in kilometres, miles and nautical miles. Enter each point as separate lat and lng fields or paste a "lat, lng" pair, and you also get the initial bearing from A to B (0–360°) with a 16-point compass heading such as SSE, plus the midpoint of the route. A map draws pins at both points and a line between them, auto-fitted so the whole route is visible, and one-click links open the route in Google Maps or OpenStreetMap. It is handy for pilots, sailors, surveyors, logistics planners and anyone comparing GPS positions. The coordinates you enter stay on your device; only OpenStreetMap map tiles are loaded to draw the map.
Features
- Great-circle (haversine) distance shown at once in kilometres, miles and nautical miles
- Initial bearing from A to B in degrees, with a 16-point compass label (N, NNE, NE, …)
- Midpoint of the two points, ready to copy as a lat/lng pair
- Enter each point as lat and lng fields, or paste a full "lat, lng" pair
- Map with pins at both points and a line between them, auto-fit to show the whole route
- Open the route straight in Google Maps directions or on OpenStreetMap
- Copy any distance, the bearing or the midpoint with one click
- Accepts N/S/E/W hemispheres and validates latitude (−90 to 90) and longitude (−180 to 180)
How to use the Distance Between Coordinates
- Enter latitude and longitude for point A, or paste a "lat, lng" pair.
- Do the same for point B — or load the London → Paris example to try it.
- Read the distance in km, miles and nautical miles, plus the bearing and midpoint.
- Check the map, then open the route in Google Maps or OpenStreetMap if you need directions.
- Copy any value you need with the button beside it.
Example
Input
A: 51.5074, -0.1278
B: 48.8566, 2.3522
Output
Distance: 343.6 km · 213.5 mi · 185.5 nmi
Bearing A→B: 148.2° (SSE)
Midpoint: 50.1962, 1.0872
London to Paris: about 344 km on a south-south-east heading.
Common errors & troubleshooting
- The distance is far larger or smaller than expected. — Check that latitude and longitude are not swapped. This tool reads latitude first, then longitude — for example 51.5074, -0.1278.
- A point lands in the ocean or the wrong hemisphere. — South latitudes and West longitudes are negative. Type the value with a minus sign, or add the N/S/E/W letter and the sign is applied for you.
- The measured route is shorter than a road-trip distance you know. — This is the straight great-circle distance over the Earth's surface, not driving distance. Use the Google Maps or OpenStreetMap link for a road route.
Frequently asked questions
- How is the distance between two coordinates calculated here?
- It uses the haversine formula on the WGS84 mean Earth radius (6371 km) to compute the great-circle distance — the shortest path over the surface of a spherical Earth. That is accurate to a few metres over typical distances and is the standard method for lat/long point-to-point distance.
- What is the difference between distance in kilometres, miles and nautical miles?
- They measure the same great-circle length in different units. One mile is 1.609344 km and one nautical mile is exactly 1.852 km, so the nautical-mile figure is smaller. Aviation and marine navigation use nautical miles because one nautical mile is close to one minute of latitude.
- What does the bearing from A to B mean?
- It is the initial bearing, or forward azimuth: the compass direction you would set off in from point A to travel the great-circle path to point B, measured in degrees clockwise from true north (0–360°). On a long route the bearing changes along the way, so this is the heading at the start.
- How is the midpoint between two coordinates found?
- The midpoint is the point halfway along the great-circle path between A and B, not the simple average of the two lat/long pairs. Averaging works only for nearby points; over long distances the spherical midpoint can differ noticeably, so this tool computes the true great-circle midpoint.
- Does this give driving distance or straight-line distance?
- It gives the straight-line great-circle ("as the crow flies") distance over the Earth's surface. For road or walking distance, follow the Directions in Google Maps or View route on OpenStreetMap link, which routes along real streets.
- Are the coordinates I enter sent anywhere?
- No. The distance, bearing and midpoint are all computed in your browser, so the coordinates you type stay on your device. Only the OpenStreetMap map tiles are loaded over the network to draw the map.
Related tools
- Coordinate Map Viewer — Plot a latitude/longitude on an OpenStreetMap map, or click the map to read coordinates back out.
- MGRS Converter — Convert between latitude/longitude and MGRS (Military Grid Reference System) coordinates, both ways, in your browser.
- Plus Codes Converter — Convert between latitude/longitude and a Plus Code (Open Location Code) both ways, with the covered bounding box and cell size.
- Coordinate Converter (DMS & Decimal) — Convert coordinates between decimal degrees, DMS and degrees-decimal-minutes, both ways, in your browser.
- GPX Viewer — Open a GPX file and see its tracks, routes and waypoints on a map, with distance, elevation and bounds.
- GeoJSON Viewer & Validator — Paste or drop GeoJSON to validate it and see its features on a map, with feature counts and a bounding box.
All ArrayKit tools