Distance Calculator
Enter the coordinates of two points. Choose 3D to add a z coordinate.
Distance between two points
Formulas
2D: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Worked example
From (1, 2) to (4, 6)
- Δx = 3, Δy = 4
- d = √(9 + 16) = 5
- Midpoint: (2.5, 4)
The points are 5 units apart.
It is Pythagoras
The horizontal and vertical gaps form the legs of a right triangle, and the distance is its hypotenuse. This gives straight-line distance on a flat grid; for places on Earth over long distances, the curvature matters and a great-circle formula is needed.