Coordinate Distance Calculator
Enter two latitude/longitude points in decimal degrees to calculate the great-circle distance, initial bearing, and midpoint.
What is a distance calculator for coordinates?
A coordinate distance calculator computes how far two points are from each other using latitude and longitude. Instead of measuring a straight line on a flat map, it estimates distance across the curved surface of Earth. This makes it useful for travel planning, logistics, GIS work, geofencing, and educational projects.
The calculator above uses decimal degree coordinates (for example, 40.7128, -74.0060) and applies a geodesic-friendly method to return a realistic great-circle distance. It also gives a directional heading (initial bearing) and the midpoint between points.
How the calculation works
1) Great-circle distance with the Haversine formula
Since Earth is roughly spherical, the shortest route between two coordinates is an arc called a great-circle path. The Haversine formula is a standard approach for this and is reliable for most everyday use cases. It performs especially well compared to simple flat-Earth formulas over longer distances.
- Convert latitudes and longitudes from degrees to radians.
- Compute angular separation between points.
- Multiply the central angle by Earth’s mean radius to get distance.
2) Initial bearing
Bearing tells you which direction to start traveling from point A toward point B, measured in degrees clockwise from north. For example:
- 0° = North
- 90° = East
- 180° = South
- 270° = West
3) Midpoint
The midpoint calculation finds a location halfway along the great-circle route. This is useful for selecting meeting points, planning fuel stops, or visualizing route segmentation.
How to use this calculator effectively
- Enter start and destination coordinates in decimal degrees.
- Choose your preferred output unit (km, miles, meters, or nautical miles).
- Click Calculate Distance.
- Review distance, bearing, and midpoint output.
Tip: Use the Load Sample button to test with New York City and Los Angeles coordinates. If you accidentally reverse points, click Swap Points.
Coordinate format tips
Decimal degrees (DD)
This tool expects decimal degrees, not degrees-minutes-seconds (DMS). If your source is in DMS, convert it first. North and East are positive; South and West are negative.
- Latitude valid range: -90 to 90
- Longitude valid range: -180 to 180
Common real-world use cases
- Travel planning: estimate flight or road-leg distances.
- Field operations: dispatch nearest crew or asset.
- Maritime and aviation: use nautical miles and headings.
- GIS projects: validate point-to-point spacing.
- Education: teach map math and Earth geometry.
Accuracy considerations
For most practical purposes, Haversine is very good. Still, no model is perfect:
- Earth is not a perfect sphere; it is slightly ellipsoidal.
- Route distance (roads, trails, air corridors) is often longer than straight geodesic distance.
- Coordinate precision matters—small decimal changes can shift results significantly.
If you need survey-grade precision, consider ellipsoidal formulas like Vincenty or geodesic libraries tied to WGS84.
Quick FAQ
Is this the same as driving distance?
No. This is straight-line distance over Earth’s surface, not turn-by-turn road distance.
Can I use this for very short distances?
Yes. It works for short distances too, though GPS noise can dominate tiny ranges.
Why do I get an error?
Check for empty inputs or out-of-range values (latitude beyond ±90, longitude beyond ±180). Make sure you are using decimal degrees.