Distance Calculator
Find the distance between two coordinate points in two or three dimensions.
Updated November 2026 · How we build calculators
Result
Your result will appear here
Enter your numbers, then press Calculate.
How the Distance Calculator works
The distance formula is the Pythagorean theorem applied to the differences of the coordinates.
Formula used
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
3D: d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
Step-by-step example
Using the default values in the calculator above:
- Dimensions: 2D (x, y)
- x₁: 1
- y₁: 2
- x₂: 7
- y₂: 10
The calculator then applies the formula above and returns:
- Distance: 10
- Δx: 6
- Δy: 8
- Distance squared: 100
What-if scenarios
Each table changes one input and keeps everything else at the calculator's default values.
| x₁ | Distance |
|---|---|
| 0.5 | 10.307764 |
| 0.75 | 10.15197 |
| 1 (default) | 10 |
| 1.5 | 9.7082439 |
| 2 | 9.4339811 |
| y₁ | Distance |
|---|---|
| 1 | 10.816654 |
| 1.5 | 10.404326 |
| 2 (default) | 10 |
| 3 | 9.2195445 |
| 4 | 8.4852814 |
Distance for different x₁ and y₁
Every other input is left at its default value.
| x₁ | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| 0.5 | 11.101802 | 10.307764 | 9.5524866 | 8.845903 |
| 0.75 | 10.957304 | 10.15197 | 9.3841622 | 8.6638617 |
| 1 | 10.816654 | 10 | 9.2195445 | 8.4852814 |
| 1.5 | 10.547512 | 9.7082439 | 8.9022469 | 8.1394103 |
| 2 | 10.29563 | 9.4339811 | 8.6023253 | 7.8102497 |
Tips and background
Make sure both points use the same units. For latitude and longitude, use a great-circle formula instead.
The distance formula is Pythagoras
The distance between (x₁, y₁) and (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²). The horizontal and vertical differences are the legs of a right triangle, and the distance is its hypotenuse. Between (1, 2) and (7, 10) the legs are 6 and 8, so the distance is exactly 10.
Going 3D and limits
Add (z₂ − z₁)² under the root for three dimensions. This is straight-line (as-the-crow-flies) distance, not driving distance, and not suitable for latitude and longitude over long ranges. Combine with the slope calculator for the angle of the line, or the area calculator for shapes.
What are some worked distances?
| Points | Distance |
|---|---|
| (0, 0) to (3, 4) | 5 |
| (-2, -3) to (4, 5) | 10 |
| (0, 0, 0) to (2, 3, 6) in 3D | 7 |
In the second example the differences are 6 and 8, so the sum of squares is 100.
When does this formula not apply?
It measures a straight line on a flat grid or in ordinary three-dimensional space. It is not driving or walking distance, which follows roads and paths. It also should not be applied directly to latitude and longitude, because those are angles on a curved Earth. When subtracting negative coordinates, keep the signs: 4 minus -2 is 6.
Common mistakes to avoid with the Distance Calculator
- Forgetting to square the differences.
- Using it for map distances on a curved Earth.
- Mixing units between axes.
Frequently asked questions
Is this the same as driving distance?
No. It is the straight-line distance, not road distance.
Can I use negative coordinates?
Yes.
How is this related to Pythagoras?
The horizontal and vertical differences form the legs of a right triangle.
What is the distance between (0,0) and (3,4)?
5.
Does the order of points matter?
No, squaring removes any negative sign.
How do I get 3D distance?
Select 3D and enter z values.