Skip to content

Distance Formula Calculator

Distance between two points, with the exact radical.

Inputs

Example: Distance
10

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₁)²)

d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

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

Pythagorean triples: point pairs whose distance is a whole number
ΔxΔyDistanceExample points
345(0, 0) to (3, 4)
6810(1, 2) to (7, 10)
51213(0, 0) to (5, 12)
81517(−4, 1) to (4, 16)
72425(2, −3) to (9, 21)
202129(0, 0) to (20, 21)
94041(−1, −1) to (8, 39)
Source: Arithmetic: every row satisfies Δx² + Δy² = d², the Pythagorean Theorem (OpenStax College Algebra 2e, §2.1)

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.