The distance formula gives the straight-line gap between two points: d = √((x₂ − x₁)² + (y₂ − y₁)²). It's just the Pythagorean theorem in disguise — the horizontal change and the vertical change are the two legs of a right triangle, and the distance is the hypotenuse. This calculator returns the distance, the midpoint (the average of the coordinates), and the separate x and y changes, for any points you enter.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the Euclidean distance and midpoint formulas, recomputed in code.
The formulas
To find the distance, take the horizontal change (x₂ − x₁) and vertical change (y₂ − y₁), square each, add them, and take the square root. Squaring removes any sign, so the order of the points doesn't matter and the result is never negative. The midpoint is simply the average of the two x-coordinates and the two y-coordinates — the exact centre of the segment.
Worked example — (1, 2) to (4, 6)
Scenario: find the distance and midpoint between (1, 2) and (4, 6).
The two points are exactly 5 units apart — a clean 3-4-5 right triangle — with midpoint (2.5, 4). The formula handles every case the same way: (−2, −3) to (4, 5) gives changes of 6 and 8, distance √(36 + 64) = 10, and a (0, 0) to (5, 12) pair gives 13. Negative coordinates and decimals work just as well.
Frequently Asked Questions
d = √((x₂ − x₁)² + (y₂ − y₁)²). For (1,2)→(4,6): √(9+16) = 5.
Average the coordinates: ((x₁+x₂)/2, (y₁+y₂)/2). E.g. (2.5, 4).
Δx and Δy are the legs of a right triangle; the distance is the hypotenuse.
No — the differences are squared, so distance is the same either way and never negative.
Yes. (−2,−3)→(4,5): distance 10, midpoint (1, 1).