What this calculator does
The tool above takes two points and returns the shortest distance between them over Earth’s surface, the kind of distance an airline quotes when it tells you the flight is 5,000 km, not the longer driving distance that follows roads. It calculates on the WGS 84 ellipsoid using Vincenty’s formulae, published in 1975 and widely used in survey and mapping software, and shows:
- the distance in kilometers, statute miles, nautical miles, and meters
- the initial bearing leaving A and the final bearing arriving at B
- the midpoint of the route
- the spherical haversine distance for comparison, and the difference
- the great-circle route on a map
Need the coordinates first? The My Location tool gives you yours in two seconds. To see the same point in every format, use the Coordinates Converter. To pick two points visually instead of typing them, drop pins on the interactive map and read off the coordinates.
How far is it? Distance between two places or addresses
You do not need coordinates. To find the distance from one place to another, or the distance between two places, type a city, town, street address or landmark into each box, such as Chicago and Denver, and press Enter or Calculate. The tool finds each place on OpenStreetMap, shows the name it found under the box, and gives the distance in kilometers and miles. For the distance between two addresses, type each full street address with its city.
- Add the state or country when a name is shared by several places: Perth, Australia or Perth, Scotland; Portland, Oregon or Portland, Maine.
- A city is measured from its center, as the map service defines it. For an exact spot, type the full address or paste its coordinates.
- The result is the straight-line distance, sometimes called “as the crow flies”. A trip by road is longer, often much longer; for the road distance and time, use driving directions.
Distance between two points on a map
Every result is drawn on a map: point A, point B, the line between them and the halfway point, so the tool works as a distance between two points map: you see the distance as well as read it. Points can be anything the boxes accept: a city, a street address, a landmark, GPS coordinates, or your own position with Use my location.
- Address to address: as a distance calculator address to address, type a full street address with its town in each box.
- Any two locations: to find the distance between 2 locations you only know by name, type the names; the tool shows which place it found under each box so you can check it.
- Coordinates: as a GPS distance calculator, paste two latitude/longitude pairs in any format.
- Travel distance: as a travel distance calculator it gives the straight-line distance, which is what flight distances are based on. For the distance by road and the driving time, use driving directions.
Distance between cities in miles
Type two city names to get the distance between cities in miles and kilometers at once. London to Paris is 214 miles (344 km) in a straight line, and San Francisco to Los Angeles is 347 miles (559 km). The same works for the miles between two locations of any kind: towns, airports, landmarks or full street addresses.
How far is it from one country to another?
A country covers a large area, so the Iran to Israel distance, the Iran to America distance or the Iran to India distance has no single answer. The usual answer is the distance between major cities. These are calculated with the tool’s own code; type any two cities into the calculator to measure others.
| Countries | From | To | km | miles |
|---|---|---|---|---|
| Iran to Israel | Tehran | Jerusalem | 1,559 | 969 |
| Iran to Israel | Tehran | Tel Aviv | 1,585 | 985 |
| Iran to America | Tehran | Washington, D.C. | 10,198 | 6,337 |
| Iran to America | Tehran | New York | 9,877 | 6,138 |
| Iran to America | Tehran | Los Angeles | 12,209 | 7,586 |
| Pakistan to India | Islamabad | New Delhi | 688 | 427 |
| Iran to India | Tehran | New Delhi | 2,550 | 1,585 |
| Iran to India | Tehran | Mumbai | 2,800 | 1,740 |
These are straight-line distances. A flight is usually longer, because aircraft follow air routes and avoid closed airspace, and a road trip longer still.
Kitni dur hai? Distance in any language
Searching “Lahore se Karachi kitni dur hai” or “Delhi se Mumbai kitni dur hai”? Type the two city names into the boxes above, in English or in the local spelling, and press Calculate. Lahore to Karachi is 1,032 km (641 miles) in a straight line, and Delhi to Mumbai 1,145 km (711 miles); by road both are longer.
The same works as a Distanzrechner (Entfernung berechnen): Berlin to Munich is 505 km in a straight line. Place names are looked up on OpenStreetMap, which knows most places in their local language as well as in English.
Distance formula: how to find the distance between two points
For two points on a flat grid, such as a graph in a math class or a floor plan, the distance formula is:
d = √((x₂ − x₁)² + (y₂ − y₁)²)
This is how to find the distance between two points: subtract the x values, subtract the y values, square both differences, add them, and take the square root. It is Pythagoras’ theorem, with the two differences as the short sides of a right triangle and the distance between two points as the long side.
Worked example: from (1, 2) to (4, 6), the differences are 4 − 1 = 3 and 6 − 2 = 4, so d = √(3² + 4²) = √(9 + 16) = √25 = 5. In three dimensions, add (z₂ − z₁)² under the square root. Try your own numbers in the distance formula calculator:
Distance formula calculator
d = √((4 − 1)² + (6 − 2)²)
d = √(3² + 4²) = √25
d = 5
The distance formula for latitude and longitude
The flat formula breaks down for places on Earth, because a degree of longitude shrinks from about 111 km at the equator to zero at the poles. Calculating distance between GPS coordinates needs a formula for a sphere or an ellipsoid. The common one is the haversine formula, with latitudes φ and longitudes λ in radians and Earth’s mean radius R = 6,371 km:
a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2)
d = 2R · atan2(√a, √(1 − a))
The calculator at the top of this page goes one step further and uses Vincenty’s formulae on the WGS 84 ellipsoid, the Earth model GPS uses, and shows the haversine answer next to it so you can see the difference.
Miles calculator: kilometers to miles
Every result is shown in miles and kilometers at once, so the tool doubles as a miles calculator. The conversion is exact by definition: 1 mile = 1.609344 km and 1 km = 0.621371 miles. A nautical mile, used at sea and in the air, is exactly 1.852 km.
| Miles | Kilometers |
|---|---|
| 1 | 1.609 |
| 5 | 8.047 |
| 10 | 16.1 |
| 26.2 (marathon) | 42.2 |
| 50 | 80.5 |
| 100 | 160.9 |
| 500 | 804.7 |
| 1000 | 1609.3 |
Mile tracker: the distance you actually travel
This calculator measures between two fixed points. To log the distance you walk, run or drive as you go, like a mile tracker, open Live Location, which adds up the distance travelled from your phone’s GPS and can save the route as a GPX file.
GPS distance calculator in meters
For short distances, such as across a field, along a street or between two survey marks, read the Meters box, which shows the GPS distance to a tenth of a meter. Paste the two GPS coordinates with at least five decimal places: five decimals pin a point to about 1.1 m, six to about 11 cm.
The calculation is exact; the coordinates usually are not. A smartphone’s GPS is typically accurate to within about 4.9 m (16 ft) under open sky, according to GPS.gov, and worse near buildings or trees. Two readings taken standing still can be several meters apart, so for a distance of a few meters, take each reading more than once.
Enter latitude and longitude in any format
Each point box reads the same formats as our coordinate converter, and shows underneath how it understood your input:
- Decimal degrees:
51.5074, -0.1278or51.5074° N, 0.1278° W - DMS:
51°30'26.6"N 0°07'40.1"W - DDM:
51°30.444'N 0°07.668'W - UTM:
30U 699316 5710164 - A Google Maps link containing
@lat,lon
You can mix formats: a DMS point A and a UTM point B work fine. Out-of-range values are flagged instead of producing a wrong distance.
Sanity-check the math against known distances
The first time you use any GPS coordinate distance calculator, it pays to verify it against pairs you already know. These six city pairs are calculated with the calculator’s own code when the page is built, so pasting any pair into the tool gives exactly these numbers. The last two columns show what a spherical haversine calculator would say instead, and how far off that is.
| From | To | km | mi | NM | Sphere km | Sphere error |
|---|---|---|---|---|---|---|
| London (51.5074, -0.1278) | Paris (48.8566, 2.3522) | 344 | 214 | 186 | 344 | −0.4 km |
| New York JFK (40.6413, -73.7781) | London LHR (51.47, -0.4543) | 5,555 | 3,452 | 2,999 | 5,540 | −14.9 km |
| Karachi (24.8607, 67.0011) | Dubai (25.2048, 55.2708) | 1,184 | 736 | 639 | 1,182 | −2.0 km |
| Sydney (-33.8688, 151.2093) | Tokyo (35.6762, 139.6503) | 7,792 | 4,842 | 4,207 | 7,826 | +33.7 km |
| San Francisco (37.7749, -122.4194) | Los Angeles (34.0522, -118.2437) | 559 | 347 | 302 | 559 | +0.1 km |
| Cape Town (-33.9249, 18.4241) | Cairo (30.0444, 31.2357) | 7,207 | 4,479 | 3,892 | 7,239 | +31.8 km |
Distances are rounded to the nearest whole unit. Checked against the GeographicLib reference library in October 2026. How the two methods differ by direction and latitude, and where Vincenty fails, is measured in haversine vs Vincenty.
How accurate is great-circle distance, really?
Earth is not a perfect sphere. Its spin makes it bulge at the equator: the equatorial radius is about 21 km larger than the polar radius. The haversine formula, which most online distance calculators use, ignores that and treats Earth as a ball with a 6,371 km radius. This calculator instead uses the WGS 84 ellipsoid, the model GPS itself uses, so the bulge is accounted for.
We tested the calculator against GeographicLib, the reference library used in GIS software, on 20,000 random pairs of points around the world. The largest difference was under 0.1 mm. In practice your input is the limit: six decimal places pin each point to about 11 cm.
Haversine vs ellipsoid: when the difference matters
The spherical haversine shortcut is wrong by up to about 0.56%, and the error depends on direction and latitude. It is worst for short north–south trips near the equator, where it overstates distance by up to about 0.56%, and for short trips near the poles, where it understates by up to about 0.44%. Over very long routes the errors partly cancel; from the equator to the North Pole it is only about 0.06% off.
In kilometers, the table above shows it plainly: haversine is about 15 km short on New York to London and about 32 km long on Cape Town to Cairo. That is irrelevant for estimating a flight time and very relevant for fuel planning, surveying, or checking a developer’s own distance code. The “sphere” line in the tool shows the gap for whatever two points you enter.
Why driving distance is always longer
People sometimes punch in two coordinates expecting the driving distance and are surprised when the result is much smaller. Driving distance has to follow roads, go around lakes and mountains, respect one-way streets, and divert through interchanges. A drive from London to Paris is about 460 km along roads, but only about 344 km in a straight line over the English Channel. The straight-line version is the one this page calculates.
If what you actually want is the road distance, use the Driving Directions tool instead. It calls the routing engine that does know about roads. Across the US, roads average about 1.4 times the straight-line distance.
What the bearing field tells you
The calculator returns two bearings. The initial bearing is the compass direction you set off in from point A; the final bearing is the direction you are travelling when you arrive at point B. On the shortest route the two are usually different, because a great circle crosses each meridian at a different angle. London to Tokyo leaves London heading about 32° (north-northeast) and arrives in Tokyo heading about 156° (south-southeast), even though Tokyo is south of London on the map.
The midpoint between two coordinates
The midpoint is the place exactly halfway along the shortest route, and it is shown as an orange dot on the map. It is not the average of the two latitudes and longitudes: averaging New York and Sydney gives 3.4°N, 38.6°E, in East Africa near the Ethiopia–Kenya border, while the real halfway point is in the central Pacific, near 8.9°N, 147.7°W. The tool walks half the route’s length along the ellipsoid from point A to find it.
Reading the great-circle line on the map
The blue line is the actual shortest route. On a flat web map it usually looks curved, bowing toward the nearer pole, because the map stretches the globe sideways. That curve is the straight line on the real planet. Routes that cross the 180° meridian, such as Tokyo to Los Angeles, are drawn across the Pacific rather than the long way round the map.