How to Find the Distance Between Two Points
To find the distance between two points, use d = √((x₂−x₁)² + (y₂−y₁)²): subtract the x-values for dx, subtract the y-values for dy, square both, add, and take the square root. For (3,4) and (7,1), dx = 4 and dy = −3, so d = √(16 + 9) = 5.
Distance between two points is one of the first formulas every geometry student meets. It measures the straight-line gap between any two points, it is the Pythagorean theorem wearing a different hat, and it shares its inputs with the midpoint and slope formulas. This guide covers the five-step method, why it works, the 3-4-5 shortcut, and the mistake that turns a 5 into a 7.
The Five-Step Method: Square, Add, Square Root
The formula d = √((x₂ − x₁)² + (y₂ − y₁)²) looks heavy, but it is just five small steps.
Worked example: (3, 4) and (7, 1).
- Find dx — subtract the x-values: 7 − 3 = 4.
- Find dy — subtract the y-values: 1 − 4 = −3.
- Square both — 4² = 16 and (−3)² = 9. The square removes the minus sign, which is why distance is always positive.
- Add — 16 + 9 = 25.
- Take the square root — √25 = 5.
The distance is 5 units. Want it verified instantly? Calcrio’s free distance and midpoint calculator shows each of these five steps for any two points you enter.
Why the Formula Works: Pythagoras in Disguise
Draw the two points, join them, then draw a horizontal line from one point and a vertical line from the other until they meet: you have built a right triangle. Its legs are |dx| = 4 and |dy| = 3, and the segment is the hypotenuse. Pythagoras says a² + b² = c², so c = √(4² + 3²) = 5. The distance formula is Pythagoras with the legs written as coordinate differences.
The 3-4-5 Shortcut: Spot the Answer Before You Calculate
The most useful habit in distance problems is recognising Pythagorean triples — whole numbers that fit a² + b² = c² exactly. The famous one is 3-4-5: 3² + 4² = 25 = 5². Whenever dx and dy are 3 and 4 (either order, either sign), the distance is 5 — no square root needed.
| dx, dy | Distance | Why |
|---|---|---|
| 3, 4 | 5 | 9 + 16 = 25 = 5² |
| 6, 8 | 10 | 36 + 64 = 100 = 10² (double the 3-4-5) |
| 5, 12 | 13 | 25 + 144 = 169 = 13² |
| 8, 15 | 17 | 64 + 225 = 289 = 17² |
The hero example (3,4)–(7,1) is a 3-4-5 in disguise: dx = 4, dy = −3. So are (0,0)–(3,4), (1,2)–(4,6) and (−1,−2)–(2,2) — all distance 5 — and (0,0)–(6,8) is the doubled triple, distance 10. Glance at dx and dy before you square: if they match a triple, you already know the answer.
What If the Distance Is Not a Whole Number?
Not every pair hides a triple — the formula still works, and the answer is a square root you can leave exact or approximate.
Worked example: (−1, 2) and (3, −4). dx = 3 − (−1) = 4; dy = −4 − 2 = −6. Square: 16 and 36. Add: 52. Square root: d = √52 = 2√13 ≈ 7.21. The exact answer is √52 (or 2√13); the decimal ≈ 7.21 is the approximation. In exams, the exact form usually earns the mark — write √52, not 7.21, unless the question asks for a decimal. The distance between two points calculator shows both forms, so you can copy whichever the question wants.
Special Cases: Same Point, Horizontal, Vertical
Three edge cases exams love. Identical points — distance 0: (2, 3) and (2, 3) are the same point, so dx = 0, dy = 0 and d = 0. The midpoint is the point itself, and the slope is undefined (0/0). Horizontal — distance is just |dx|: (1, 4) and (5, 4) share a y-value, so dy = 0 and d = 4; the slope is 0. Vertical — distance is just |dy|: (2, 1) and (2, 5) share an x-value, so dx = 0 and d = 4. The slope is undefined (division by zero), but the distance is well defined. Distance never breaks — only slope does.
The Most Common Mistake: Adding Instead of Squaring
The single most common distance error is skipping the squares: adding the raw gaps, |dx| + |dy|, instead of √(dx² + dy²). For (3,4)–(7,1) that gives 4 + 3 = 7 — wrong. The correct answer is 5.
The 7 is not nonsense: it is the “Manhattan distance”, the path if you walk along city blocks — right 4, then down 3. But the question asks for the straight line, the hypotenuse, which cuts the corner: 5. Two sanity checks catch the error: the distance must be at least as big as the larger gap (5 ≥ 4 ✓) and at most the sum of the gaps (5 ≤ 7 ✓). If your answer is 7, you added; if it is 3, you forgot a leg.
Frequently Asked Questions
What is the formula for the distance between two points?
d = √((x₂ − x₁)² + (y₂ − y₁)²) — the square root of the squared x-difference plus the squared y-difference. It is the Pythagorean theorem applied to dx and dy.
How do you find the distance between (3, 4) and (7, 1)?
dx = 7 − 3 = 4, dy = 1 − 4 = −3, so d = √(4² + (−3)²) = √(16 + 9) = √25 = 5 units.
Why do you square the differences in the distance formula?
Because dx and dy are the legs of a right triangle and the distance is its hypotenuse: a² + b² = c². Squaring also removes negative signs, so the distance is always positive.
What is the distance between (0, 0) and (3, 4)?
5 units — the classic 3-4-5 triangle: √(3² + 4²) = √(9 + 16) = √25 = 5. The midpoint is (1.5, 2) and the slope is 4/3.
Can the distance between two points be negative?
No — a distance is a length, and the square root is always non-negative. A negative result means you skipped the squares.
Keep Practicing
Work these by hand: (0, 0) → (6, 8) gives d = 10; (2, 3) → (5, 7) gives d = 5; (−3, 1) → (1, 4) gives d = 5; and (4, 4) → (4, 9) is vertical, d = 5. For instant verification with every step shown, use the free distance and midpoint calculator — and for the slope, the slope calculator returns −3/4 for the hero pair. The midpoint guide covers the midpoint (5, 2.5) next.
