Distance Between Two Points Calculator
Enter the coordinates of two points to calculate the straight-line distance between them, along with their midpoint.
Distance
—
Enter two points to calculate.
How the Distance Between Two Points formula works
The distance formula, derived from the Pythagorean theorem:
Distance = √( (x₂−x₁)² + (y₂−y₁)² ) Midpoint = ( (x₁+x₂)/2, (y₁+y₂)/2 )
Step-by-step calculation
- Subtract the x-coordinates and square the result.
- Subtract the y-coordinates and square that result.
- Add the two squared differences together and take the square root for the distance.
- Average the x-coordinates and average the y-coordinates for the midpoint.
Worked example
Points (1, 2) and (4, 6): Distance = √((4−1)² + (6−2)²) = √(9 + 16) = √25 = 5. Midpoint = ((1+4)/2, (2+6)/2) = (2.5, 4).
Frequently asked questions
Does this work in 3D as well as 2D?
This calculator handles 2D coordinates (x, y). The same underlying idea extends to 3D by adding a squared z-difference term inside the square root, but that's a separate calculation.
What's the distance formula actually based on?
It's a direct application of the Pythagorean theorem — the horizontal and vertical differences between the points form the two legs of a right triangle, and the distance is the hypotenuse.