Distance between two coordinates calculator
Enter latitude and longitude for two points and the tool returns the straight-line (great-circle) distance in kilometers, miles, nautical miles or meters, plus the bearing. Paste thousands of pairs at once and copy the results back into a spreadsheet.
Everything runs in your browser. Your text and files stay on your device and are never uploaded.
Commas, tabs, semicolons or spaces all work. Paste straight from Sheets or Excel. Decimal degrees, with optional N, S, E, W.
3935.75 km
Initial bearing 273.7 degrees (W). Midpoint 39.51031, -97.16013.
How to use it
- Type or paste one pair per line as lat1, lon1, lat2, lon2. Four columns copied from Google Sheets or Excel work as they are.
- Pick kilometers, miles, nautical miles or meters, and how many decimal places you want.
- Read the distance and compass bearing for each line. Lines with a problem show what is wrong and are left out of the total.
- Copy the distance column to paste back into a sheet, or download everything as a CSV with bearings and midpoints.
Questions
How do you calculate the distance between two latitude and longitude points?
The tool uses the haversine formula, which treats the Earth as a sphere with a mean radius of 6,371.0088 km and measures the shortest path along its surface between the two points.
How accurate is the result?
Treating the Earth as a sphere puts the result within about 0.5 percent of the distance on the true, slightly flattened Earth, which is fine for travel, delivery zones and classroom work. Surveying needs an ellipsoidal method such as Vincenty.
Is this the driving distance?
No. It is the straight line over the Earth's surface, the same as measuring on a globe. Roads, flight paths and detours make real trips longer.
Which coordinate formats can I paste?
Decimal degrees such as 40.7128, -74.0060, with a minus sign for south and west. Letters work too, before or after the number: 40.7 N, 74.0 W or N40.7 W74.0. Latitude must be between -90 and 90 and longitude between -180 and 180. Degrees, minutes and seconds need converting to decimal first.
What does the bearing mean?
It is the compass direction you would head in at the first point to travel the shortest route to the second, in degrees from north (0 to 360) with the nearest of 16 compass points.
How many pairs can I calculate at once?
Up to 20,000 lines. The table shows the first 500 rows, and the copy and CSV buttons include every line.