- Home
- Math
- Distance Calculator
Distance Calculator
The distance between two points is d = โ((xโ โ xโ)ยฒ + (yโ โ yโ)ยฒ). From (1, 2) to (4, 6) it is โ(9 + 16) = 5. For places on Earth, use the latitude and longitude tab.
Lahore to Karachi is about 1,030 km in a straight line, but the road is longer. The map tab gives the straight โas the crow fliesโ distance between any two coordinates.
Distance between two points
Distance between two points in space
Straight-line distance between two places
Use decimal degrees; south and west are negative. Example: Lahore to Karachi.
How we got this
Compare options
Row 1 follows the calculator above. Edit any cell.Bulk mode
My saved calculations
Stored only in this browser. Nothing is sent to our servers.Country & format
Change the country edition from the menu at the top.Your next step
Your answer carries over, so you donโt have to type it again.
The distance formula
It comes from Pythagoras: the horizontal and vertical gaps are the two short sides of a right triangle, and the distance is the long side.
| Formula | |
|---|---|
| 2D | โ((xโโxโ)ยฒ + (yโโyโ)ยฒ) |
| 3D | โ((xโโxโ)ยฒ + (yโโyโ)ยฒ + (zโโzโ)ยฒ) |
| On Earth (haversine) | 2R ร asin(โ(sinยฒ(ฮฯ/2) + cos ฯโ cos ฯโ sinยฒ(ฮฮป/2))) |
Distances on the Earth
The Earth is round, so a flat formula is wrong over long distances. We use the haversine formula with a mean Earth radius of 6,371 km. It assumes a perfect sphere, which is accurate to about 0.5%. Road and flight distances are longer than this straight line.
Finding coordinates
In most map apps, press and hold (or right-click) a place to see its latitude and longitude. Use decimal degrees such as 31.5204, 74.3587.
Frequently asked questions
How do I find the distance between two points?
Subtract the x values and y values, square both, add them and take the square root.
How do I calculate distance between latitude and longitude?
Use the haversine formula, or enter both coordinates in the Latitude & longitude tab.
Why is the road distance longer?
Roads bend and follow terrain. This calculator gives the shortest straight path over the Earthโs surface.
What is a nautical mile?
Exactly 1,852 metres, used at sea and in the air.