Distance Formula Calculator
Find the straight-line distance between two points on the coordinate plane. Enter (x₁, y₁) and (x₂, y₂) — decimals and negatives are fine — and get the distance, its exact square-root form, the rise and run, and the midpoint.
Example: with x₁ (first point) 1 · y₁ (first point) 2 · x₂ (second point) 4 · y₂ (second point) 6 → Distance: 5 (= √25).
- Δx (run)3
- Δy (rise)4
- Midpoint(2.5, 4)
Computed by the calculator below using its default values. Change any input to see your own numbers.
d = √((x₂ − x₁)² + (y₂ − y₁)²) — the Pythagorean theorem with Δx and Δy as the legs. Here: √(3² + 4²) = √25 = 5.
The distance formula is the Pythagorean theorem in disguise
Draw the two points and connect them; then drop a horizontal leg (Δx = x₂ − x₁) and a vertical leg (Δy = y₂ − y₁). Those legs meet at a right angle, and your distance is the hypotenuse — so d² = Δx² + Δy². From (1, 2) to (4, 6) the legs are 3 and 4, giving the classic 3-4-5 triangle and a distance of exactly 5.
Squaring is what makes the formula forgiving: (−8)² and 8² are both 64, so it does not matter which point you call first or whether coordinates are negative. What you cannot do is skip the squares — √(Δx² + Δy²) is not Δx + Δy, and adding the legs (3 + 4 = 7) always overshoots the true straight-line distance unless the points share a row or column.
How it’s calculated
d = √((x₂ − x₁)² + (y₂ − y₁)²). The exact form shows d² under the radical; the decimal is rounded to 4 places when the root is irrational. Midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2). For 3D points, the same formula extends with a (z₂ − z₁)² term.
Distances are Euclidean (straight-line) in a flat plane — grid-walking distance or distances on the curved Earth need different formulas.
Leg pairs that give whole-number distances
| Δx | Δy | Distance |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
Computed with d = √(Δx² + Δy²); these are the classic Pythagorean triples, handy for building clean practice problems.
Common mistakes
- Adding the legs instead of their squares — the distance from (1, 2) to (4, 6) is 5, not 3 + 4 = 7.
- Mixing coordinates across axes, pairing an x with a y when subtracting.
- Dropping a negative during subtraction: from x = −2 to x = 4 the run is 6, not 2.
- Forgetting the final square root and reporting d² (25) as the distance.
Frequently asked questions
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²). Subtract the x-coordinates, subtract the y-coordinates, square both differences, add them, and take the square root.
How is it related to the Pythagorean theorem?
It is the theorem, applied to coordinates: Δx and Δy are the legs of a right triangle and the distance is its hypotenuse, so d² = Δx² + Δy².
Does it matter which point I call (x₁, y₁)?
No. Swapping the points flips the signs of Δx and Δy, but squaring erases the signs, so the distance comes out identical either way.
How do I find the distance between two points in 3D?
Add a third squared term: d = √(Δx² + Δy² + Δz²). The logic is the same — a right triangle built one dimension at a time.
Why does the answer show a square root?
Most distances are irrational — from (0,0) to (1,1) it is √2 = 1.4142... The radical form is exact; the decimal is a rounded approximation, so keep √2 if you are carrying the value into more algebra.