Distance Formula Calculator: Distance Between Two Points
By FindMySum · Last reviewed
A distance formula calculator finds how far apart two points are on a flat plane. The distance formula, d = √((x₂ − x₁)² + (y₂ − y₁)²), is the Pythagorean theorem written in coordinates: the differences in x and in y are the legs of a right triangle, and the distance is the hypotenuse. This page also gives the midpoint and the slope of the line through the two points.
Worked example
Find the distance between (1, 2) and (4, 6).
- Horizontal difference: 4 − 1 = 3.
- Vertical difference: 6 − 2 = 4.
- Square and add: 3² + 4² = 9 + 16 = 25.
- Square root: d = √25 = 5.
The two points are exactly 5 units apart, the 3-4-5 right triangle in disguise. The midpoint of the segment is (2.5, 4), and its slope is 4 ÷ 3.
When the sum under the root is not a perfect square, the calculator gives the exact form as well as a decimal: from (1, 2) to (3, 8) the distance is √40 = 2√10 ≈ 6.325.
Common slips
Subtract before you square, not after: (4 − 1)² is 9, while 4² − 1² is 15. Keep negative coordinates in brackets: from (−2, 3) to (4, −5), the differences are 6 and −8, giving √(36 + 64) = 10. And do not forget the final square root; 25 is the squared distance, not the distance.
For the midpoint on its own, use the midpoint calculator; for the slope and the equation of the line, the slope and line calculator.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.