Latitude and Longitude Distance Calculator
Enter the latitude and longitude of two points and this calculator instantly computes the great-circle distance (the shortest path across Earth's surface) in kilometers, statute miles, and nautical miles. You also get the initial compass bearing from Point A to Point B, the midpoint coordinates, and a full haversine working. Coordinates are accepted as signed decimal degrees (e.g. -73.935 for 73.935 W) or in degrees, minutes, and seconds (DMS) format.
Formula
Worked example
Paris (48.8566° N, 2.3522° E) to Krakow (50.0647° N, 19.9450° E): Delta-lat = 1.2081° = 0.02109 rad, Delta-lon = 17.5928° = 0.30706 rad. a = sin²(0.01054) + cos(0.85297) x cos(0.87404) x sin²(0.15353) = 0.00011 + 0.64934 x 0.02357 = 0.01542. c = 2 x arcsin(sqrt(0.01542)) = 0.24941 rad. d = 6371 x 0.24941 = 1588.7 km = 987.2 mi = 858.0 nmi.
What is great-circle distance?
Great-circle distance is the shortest path between two points on the surface of a sphere. Because the Earth is approximately spherical, this path (also called an orthodrome) is the most direct route any aircraft, ship, or satellite could travel. It differs from the straight-line (Euclidean) distance you would measure if you bored a tunnel through the planet: the great-circle route follows the curve of the surface. For short distances of a few kilometres the two values are nearly identical, but for intercontinental routes the great-circle distance can be significantly shorter than the apparent map distance, especially at high latitudes where Mercator-projected maps visually distort scale.
The haversine formula explained
This calculator uses the haversine formula, which is specifically designed to avoid numerical instability for very short distances - a limitation of the simpler spherical law of cosines. The formula takes the latitude and longitude of two points, converts them to radians, calculates intermediate values based on the sine and cosine of half the angular differences, and then derives the central angle between the points. Multiplying that angle by Earth's mean radius (6,371.0088 km as standardised by the International Union of Geodesy and Geophysics) gives the surface distance. The result is accurate to within about 0.3% anywhere on Earth, which for most practical purposes is entirely adequate. For geodetic-survey precision (sub-metre accuracy over long baselines), the Vincenty formulae using an ellipsoidal Earth model are preferred.
How to read latitude and longitude
Latitude measures north-south position from 0° at the equator to 90° at either pole. It is positive in the northern hemisphere and negative in the southern hemisphere. Longitude measures east-west position from 0° at the prime meridian (Greenwich, UK) to 180° at the International Date Line. It is positive east of Greenwich and negative west. GPS devices and mapping apps express coordinates as signed decimal degrees (e.g. 40.7128, -74.0060 for New York City) or in degrees-minutes-seconds format (40°42'46"N 74°0'22"W). Both formats are accepted by this calculator.
Bearing and midpoint
The bearing output shows the initial compass direction you would face at Point A to head directly toward Point B along the great-circle path. It is expressed as degrees clockwise from true north (0° = north, 90° = east, 180° = south, 270° = west). Note that on a great-circle route your bearing continuously changes as you travel - this is the initial bearing only. The midpoint is the geographic centre of the great-circle arc, meaning the point halfway along the surface path. It is calculated spherically and will generally not coincide with the simple average of the two sets of coordinates, especially over long distances at high latitudes.
Famous great-circle distances for reference
| Route | km | miles | nmi |
|---|---|---|---|
| New York to London | 5 570 | 3 461 | 3 008 |
| London to Paris | 344 | 214 | 186 |
| Los Angeles to Tokyo | 8 815 | 5 478 | 4 760 |
| Sydney to Cape Town | 11 020 | 6 849 | 5 951 |
| Equator to a pole (90° latitude) | 10 008 | 6 220 | 5 404 |
| Full equatorial circumference | 40 075 | 24 901 | 21 638 |
| One degree of latitude | 111 | 69 | 60 |
| One nautical mile (exact) | 1.852 | 1.151 | 1.000 |
All distances are great-circle (as-the-crow-flies) values using the WGS-84 spherical Earth model.
Frequently asked questions
Why is this different from the distance I see on Google Maps?
Google Maps shows driving or walking distance along roads and paths, which must follow the actual road network. This calculator shows the great-circle distance - the absolute shortest path across Earth's surface as if you could fly in a perfectly straight line. Great-circle distance is always shorter than or equal to any real-world travel route. For a trip from London to Edinburgh, for example, the great-circle distance is about 534 km but driving may be 650 km or more depending on the route.
What coordinate format does the calculator accept?
You can switch between decimal degrees (e.g. 48.8566, 2.3522) and degrees-minutes-seconds format (e.g. 48°51'23.8"N, 2°21'8"E). In decimal degrees, southern latitudes and western longitudes are entered as negative numbers. In DMS mode, use the N/S and E/W direction suffixes. GPS receivers, Google Maps, and most mapping apps can provide coordinates in either format.
What is a nautical mile and why is it different from a statute mile?
A nautical mile was originally defined as one minute of arc along a meridian (1/60 of a degree of latitude), which makes it a natural unit for navigation at sea and in the air. One nautical mile equals exactly 1.852 km or about 1.1508 statute miles. Statute miles (the everyday "mile" in the US and UK) are 1.60934 km. Mariners and aviators prefer nautical miles because the relationship to degrees of latitude simplifies chart work and position reporting.
How accurate is the haversine formula?
The haversine formula assumes Earth is a perfect sphere. In reality the planet is an oblate spheroid (slightly flattened at the poles), so results are accurate to within roughly 0.3% - about 3 km per 1,000 km of distance. For almost all practical uses (planning trips, estimating flight times, comparing locations) this is more than sufficient. Geodetic survey work requiring sub-metre accuracy should use Vincenty's formulae with a WGS-84 ellipsoid model.
What is the meaning of the initial bearing?
The bearing tells you the compass direction you would face at Point A if you set off toward Point B along the shortest possible surface path. It is measured clockwise from true north, so 0° is north, 90° is east, 180° is south, and 270° is west. On a great-circle route this heading changes continuously as you travel, so the bearing shown is the direction at the start of your journey, not the average direction throughout.
Can I calculate distance from an address instead of coordinates?
This tool requires latitude and longitude coordinates. To convert an address to coordinates (geocoding), paste the address into Google Maps, right-click the pin that appears, and copy the coordinates shown at the top of the context menu. You can then paste them here in decimal degrees format.