Distance Calculator
Direct answer
The straight-line distance between two places is found with the haversine formula, using their latitude and longitude:
d = 2R × arcsin( √( sin²(Δlat/2) + cos(lat₁) × cos(lat₂) × sin²(Δlon/2) ) ), with Earth’s mean radius R = 6,371 km
New York (40.7128, −74.0060) to Los Angeles (34.0522, −118.2437) is 3,935.75 km, which is 2,445.56 miles (3,935,750 metres). Enter your own two coordinate pairs below and the tool does the same calculation for you.
For plain x/y points on a flat plane, the formula is simpler: d = √((x₂ − x₁)² + (y₂ − y₁)²). For example, (0, 0) to (3, 4) is √(3² + 4²) = √25 = 5 units.
Distance Calculator
Enter the latitude and longitude of two places to find the straight-line (great-circle) distance between them.

Inputs
| Field | Default | Unit |
|---|---|---|
| Point 1 — Latitude | 40.7128 (New York) | degrees |
| Point 1 — Longitude | −74.0060 (New York) | degrees |
| Point 2 — Latitude | 34.0522 (Los Angeles) | degrees |
| Point 2 — Longitude | −118.2437 (Los Angeles) | degrees |
Outputs
| Output | Formula | Default result |
|---|---|---|
| Straight-line distance | haversine, R = 6,371 km | 3,935.75 km |
| Distance in miles | km ÷ 1.609344 | 2,445.56 miles |
| Distance in metres | km × 1,000 | 3,935,750 metres |
| Distance in feet | miles × 5,280 | 12,912,557 feet |
Defaults on load: New York to Los Angeles → 3,935.75 km / 2,445.56 miles. The result shows as soon as the page loads, before you enter anything.
How it works
- Enter two coordinate pairs. Latitude runs from −90 (South Pole) to 90 (North Pole); longitude runs from −180 to 180. North and east are positive, south and west are negative — so New York is 40.7128, −74.0060.
- Convert degrees to radians. The trigonometric functions need radians, so each angle is multiplied by π ÷ 180. Forgetting this step is the most common distance-calculation mistake.
- Apply the haversine formula. It computes the central angle between the two points on a sphere, using the sine of half the latitude and longitude differences and the cosines of the two latitudes.
- Multiply by Earth’s radius. The central angle (in radians) times R = 6,371 km gives the great-circle distance — the shortest path over the surface.
- Read the conversions. The same distance is shown in kilometres, miles, metres and feet, so no separate conversion is needed.
Distances between well-known city pairs
| From | To | Kilometres | Miles |
|---|---|---|---|
| London | Paris | 343.56 | 213.48 |
| Paris | Berlin | 877.46 | 545.23 |
| New York | Chicago | 1,144.29 | 711.03 |
| San Francisco | Seattle | 1,093.21 | 679.29 |
| Sydney | Melbourne | 713.43 | 443.30 |
| Tokyo | Osaka | 392.44 | 243.85 |
| Dubai | Cairo | 2,423.35 | 1,505.80 |
| Chicago | Los Angeles | 2,803.97 | 1,742.31 |
| Toronto | Vancouver | 3,358.91 | 2,087.13 |
| New York | Los Angeles | 3,935.75 | 2,445.56 |
| London | New York | 5,570.22 | 3,461.18 |
All figures are straight-line (great-circle) distances from the haversine formula with R = 6,371 km — not road distances.

Unit conversion table
| Kilometres | Miles | Metres |
|---|---|---|
| 1 | 0.62 | 1,000 |
| 10 | 6.21 | 10,000 |
| 100 | 62.14 | 100,000 |
| 500 | 310.69 | 500,000 |
| 1,000 | 621.37 | 1,000,000 |
| 3,935.75 | 2,445.56 | 3,935,750 |
Conversion constants: 1 mile = 1.609344 km exactly; 1 km = 1,000 m; 1 mile = 5,280 feet.
Worked examples
Example 1 — New York to Los Angeles: 3,935.75 km
Latitude/longitude: New York (40.7128, −74.0060), Los Angeles (34.0522, −118.2437).
- Haversine with R = 6,371 km → 3,935.75 km
- 3,935.75 ÷ 1.609344 = 2,445.56 miles
- 3,935.75 × 1,000 = 3,935,750 metres
- 2,445.56 × 5,280 = 12,912,557 feet
This is the page default — the tool shows it before anything is typed.
Example 2 — London to Paris: 343.56 km
London (51.5074, −0.1278), Paris (48.8566, 2.3522).

- Haversine with R = 6,371 km → 343.56 km
- 343.56 ÷ 1.609344 = 213.48 miles
- 343.56 × 1,000 = 343,556 metres
About one-eleventh of the New York–Los Angeles distance: 3,935.75 ÷ 343.56 = 11.46 times further.
Example 3 — Two points on a flat plane: 5.00 units
Points (0, 0) and (3, 4), using the 2D formula d = √((x₂ − x₁)² + (y₂ − y₁)²).

- (3 − 0)² = 9; (4 − 0)² = 16; 9 + 16 = 25; √25 = 5.00 units
- A second check: (2, 3) to (8, 11) → (6)² + (8)² = 36 + 64 = 100; √100 = 10.00 units
The 3-4-5 and 6-8-10 right triangles are the classic checks that the formula is right. The same 3-4-5 triangle idea measures flat shapes too: the area calculator works out the area of rectangles, circles and triangles, and the volume calculator extends the same measurements to boxes, cylinders and spheres.
Example 4 — Chicago to Los Angeles: 2,803.97 km
Chicago (41.8781, −87.6298), Los Angeles (34.0522, −118.2437).
- Haversine with R = 6,371 km → 2,803.97 km
- 2,803.97 ÷ 1.609344 = 1,742.31 miles
- New York to Chicago (1,144.29 km) plus Chicago to Los Angeles (2,803.97 km) = 3,948.26 km — close to, but not equal to, the direct New York–Los Angeles distance (3,935.75 km), because the three cities are not on one straight great-circle line.
Tips and mistakes
- Straight-line is not road distance. The tool gives the shortest path over the Earth’s surface. A driving route between the same two cities is always longer — roads bend around terrain, cities and borders. Never use this figure to estimate driving time or fuel.
- Do not swap latitude and longitude. Latitude comes first (−90 to 90) and longitude second (−180 to 180). Entering −74.0060 as a latitude is out of range and will be rejected; entering them swapped gives a wrong place entirely.
- Convert degrees to radians before the trigonometry. The haversine formula’s sine and cosine need radians. Multiplying by π ÷ 180 first is not optional — using degrees directly gives a nonsense answer.
- Mind the minus signs. Western longitudes (the Americas) and southern latitudes are negative. Leaving out the minus sign puts the point in the wrong hemisphere.
- The Earth is treated as a sphere. The tool uses the mean radius 6,371 km. Real Earth is slightly flattened at the poles, so distances from a spherical model can differ from survey-grade geodesic figures by up to about 0.5% — fine for planning and schoolwork, not for surveying.
- Same point means zero. Two identical coordinate pairs give exactly 0.00 km — a useful check that the tool is working.
Sources
Distances use the haversine formula on a spherical Earth (mean radius 6,371 km) — see Haversine on MathWorld. Reviewed by the Average Calculator Team. Last reviewed: 7 November 2026.
Frequently asked questions
How do you calculate the distance between two coordinates?
Use the haversine formula with the two latitude/longitude pairs and Earth’s mean radius R = 6,371 km: d = 2R × arcsin( √( sin²(Δlat/2) + cos(lat₁) × cos(lat₂) × sin²(Δlon/2) ) ). For example, New York (40.7128, −74.0060) to Los Angeles (34.0522, −118.2437) is 3,935.75 km, or 2,445.56 miles.
Is this the same as the driving distance?
No. This tool gives the straight-line (great-circle) distance — the shortest path over the Earth’s surface. Driving distance follows roads and is always longer. Use this figure for “as the crow flies” distance, and a maps service for driving distance and travel time.
What is the haversine formula?
It is the standard formula for great-circle distance on a sphere. It takes the latitude and longitude of two points, converts the angles to radians, and returns the shortest surface distance between them. It is accurate to about 0.5% for Earth because the planet is slightly flattened rather than a perfect sphere.
How do I find the distance between two points on a graph?
Use the 2D distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). For example, (0, 0) to (3, 4) is √(3² + 4²) = √25 = 5 units. This is the Pythagorean theorem applied to the horizontal and vertical gaps between the points.
How many kilometres are in a mile?
1 mile = 1.609344 km exactly, so 1 km = 0.621371 miles. To convert, divide kilometres by 1.609344: 3,935.75 km ÷ 1.609344 = 2,445.56 miles.
Why does the tool ask for latitude before longitude?
Latitude-first is the standard geographic order (for example, 40.7128, −74.0060 for New York). Latitude is always between −90 and 90 and longitude between −180 and 180, so the tool can check each value is in range. Swapping them puts the point in the wrong place, or out of range entirely.
Disclaimer
Distances on this page are straight-line (great-circle) figures computed from the coordinates you enter, using a spherical Earth of mean radius 6,371 km. They are not road, driving or flight distances, and real-world routes are longer. The spherical model is accurate to about 0.5%; it is suitable for planning, schoolwork and general reference, not for surveying or navigation. City coordinates used in the examples and table are the commonly published centre coordinates for each city.
Related calculators
- Average Calculator Online — the homepage average tool
- Scientific Calculator — trigonometry and square roots for distance math
- Area Calculator — area of the land or room a distance spans
- Volume Calculator — volume for boxes, cylinders and spheres
- Time Calculator — time math for pairing a distance with a travel time
Last updated: November 7, 2026.
