Distance Formula Calculator
Distance between two points, with the exact radical.
Inputs
- Working
- d = √((7 − 1)² + (10 − 2)²) = √(6² + 8²) = √(36 + 64) = √100 = 10
- Horizontal change (Δx)
- 6
- Vertical change (Δy)
- 8
- Δx² + Δy²
- 36 + 64 = 100
Use this calculator on your own site
Free embed
- Two lines of HTML, unlimited views
- Shows a small CalculateEveryday bar, with a credit link under the calculator
What each Distance Formula input means
- x₁
- x₁ and y₁ are the first point's horizontal and vertical coordinates. Negatives and decimals are fine. On a map grid, both axes must use the same unit, or the answer mixes them.
- x₂
- x₂ and y₂ are the second point. Swapping the two points changes nothing, since each difference is squared.
Distance Formula formula
d = √((x₂ − x₁)² + (y₂ − y₁)²)
The distance formula is the Pythagorean Theorem written in coordinates. Draw a right triangle with the segment as its hypotenuse: one leg runs horizontally for Δx = x₂ − x₁, the other vertically for Δy = y₂ − y₁. Then a² + b² = c² becomes Δx² + Δy² = d², and the square root gives d. OpenStax College Algebra derives it exactly this way. Because both changes are squared, their signs — and which point you call first — stop mattering. When the coordinates are whole numbers the sum of squares is a whole number too, so the page also gives the exact answer as a simplified radical, such as √52 = 2√13, which is what most textbooks want, beside the decimal rounded to four places.
Formula last checked against OpenStax College Algebra 2e, §2.1 'The Rectangular Coordinate System and Graphs' (the distance formula, derived from the Pythagorean Theorem) on 2 October 2026. Built and maintained by Suman Kumar · How we check
Distance Formula worked example
From (1, 2) to (7, 10) the change is 6 across and 8 up. 6² + 8² = 36 + 64 = 100, and √100 = 10 — a 6-8-10 right triangle.
More Distance Formula examples
From (−3, 4) to (1, −2): Δx = 1 − (−3) = 4 and Δy = −2 − 4 = −6. Squaring removes the minus sign, (−6)² = 36, so the sum is 16 + 36 = 52 and the distance is √52 = 7.2111. For the exact form, 52 = 4 × 13, so the textbook answer is 2√13.
From the origin to (5, 12): 25 + 144 = 169, and √169 = 13 exactly. That is the 5-12-13 right triangle, one of the Pythagorean triples that give a whole-number distance.
Where the Distance Formula calculator can give the wrong answer
- The exact radical form appears only when Δx² + Δy² is a whole number. With decimal coordinates there is no tidy radical, so only the decimal is shown.
- Squaring removes the sign, so it does not matter which point is first or whether a change is negative.
- This is straight-line distance on a flat plane. For three dimensions add (z₂ − z₁)² under the root; for places on a map use a great-circle formula instead.
Spotted a mistake? Tell us
Distance Formula reference table
| Δx | Δy | Distance | Example points |
|---|---|---|---|
| 3 | 4 | 5 | (0, 0) to (3, 4) |
| 6 | 8 | 10 | (1, 2) to (7, 10) |
| 5 | 12 | 13 | (0, 0) to (5, 12) |
| 8 | 15 | 17 | (−4, 1) to (4, 16) |
| 7 | 24 | 25 | (2, −3) to (9, 21) |
| 20 | 21 | 29 | (0, 0) to (20, 21) |
| 9 | 40 | 41 | (−1, −1) to (8, 39) |
Distance Formula FAQ
- They are the same number. 2√5 is the exact form — √20 with the perfect square 4 pulled out — and 4.4721 is its decimal rounded to four places. The page shows both when the coordinates are whole numbers.
- No. Both squared terms are zero or positive, so the square root is never negative. A distance of 0 means the two points are the same.
- d = √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (7, 10): √(6² + 8²) = √100 = 10.
- It is the Pythagorean theorem. The horizontal and vertical gaps between the points are the two legs of a right triangle, and the distance is its hypotenuse: a² + b² = c².
- Add the third squared difference under the root: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). From (1, 2, 3) to (4, 6, 15) that is √(9 + 16 + 144) = √169 = 13. This page takes two coordinates; for three, find Δx and Δy here and add Δz² yourself.
- Only on a flat map over short distances. Latitude and longitude are angles on a sphere, and a degree of longitude shrinks towards the poles, so the formula gives wrong answers for them. A great-circle (haversine) calculation is the one to use.
- Checking whether three points make an isosceles or a right triangle, finding a circle's radius from its centre and a point on it, and testing whether three points lie on one line — they do when the two shorter distances add up to the longest. NCERT Class X uses it for all three.