Distance Between Two Points Calculator

Find the exact distance between two points (x1,y1) and (x2,y2) on a coordinate plane using the Pythagorean theorem, with a simplified radical and decimal steps.

Loading calculator…

The distance formula

The distance between two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on a coordinate plane is:

d=(x2x1)2+(y2y1)2d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}

The two points, together with the corner point directly across from them, form a right triangle: the horizontal leg has length Δx=x2x1\Delta x = x_2 - x_1, the vertical leg has length Δy=y2y1\Delta y = y_2 - y_1, and the straight-line distance between the original points is the hypotenuse. Applying the Pythagorean theorem to that triangle gives the formula above.

Step by step

To find the distance between two points:

  1. Subtract the x-coordinates: Δx=x2x1\Delta x = x_2 - x_1.
  2. Subtract the y-coordinates: Δy=y2y1\Delta y = y_2 - y_1.
  3. Square both differences and add them: Δx2+Δy2\Delta x^2 + \Delta y^2.
  4. Take the square root of that sum — simplifying it to a smaller radical when possible, or rounding it to a decimal approximation.
Tip: The order you subtract in doesn't matter — swap which point is "1" and which is "2" and every difference just flips sign, which disappears the moment it's squared.

Worked examples

Example 1 — irrational result, simplifies to a smaller radical: for (2,3)(-2, 3) and (4,7)(4, -7), Δx=4(2)=6\Delta x = 4-(-2) = 6 and Δy=73=10\Delta y = -7-3 = -10, so d=62+(10)2=36+100=136=23411.6619d = \sqrt{6^2+(-10)^2} = \sqrt{36+100} = \sqrt{136} = 2\sqrt{34} \approx 11.6619.

Example 2 — Pythagorean triple, exact whole number: for (5,6)(5, 6) and (7,11)(-7, 11), Δx=12\Delta x = -12 and Δy=5\Delta y = 5, so d=(12)2+52=144+25=169=13d = \sqrt{(-12)^2+5^2} = \sqrt{144+25} = \sqrt{169} = 13 exactly.

Example 3 — the classic 3-4-5 triangle: for (0,0)(0,0) and (3,4)(3,4), d=32+42=9+16=25=5d = \sqrt{3^2+4^2} = \sqrt{9+16} = \sqrt{25} = 5.

Example 4 — no coefficient to pull out: for (0,0)(0,0) and (1,1)(1,1), d=12+12=21.4142d = \sqrt{1^2+1^2} = \sqrt{2} \approx 1.4142 — already in simplest radical form, since 2 has no perfect-square factor other than 1.

Exact form vs. decimal approximation

Because most coordinate pairs are not a Pythagorean triple apart, the exact distance is usually an irrational number — one that never terminates or repeats as a decimal. This calculator shows both forms: the exact simplified radical (e.g. 2342\sqrt{34}), obtained the same way as the Simplify Radicals calculator pulls perfect-square factors out of a radicand, and a rounded decimal approximation beneath it (e.g. 11.661904\approx 11.661904) for whichever a problem calls for.

Tip: A distance of exactly 00 means the two points coincide — there's nothing to simplify, and the decimal approximation is omitted since it would just repeat the same whole number.

Related calculators

This calculator shares its exact-radical engine with Simplify Radicals (prime-factors out perfect-square factors from any whole-number radicand) and its underlying triangle relationship with the Pythagorean Theorem calculator, which takes the two leg lengths directly instead of coordinate points. The same two points also determine a Midpoint (exactly halfway between them) and a Slope (the steepness of the line through them) — three complementary views of the same pair of coordinates.

Frequently asked questions

What is the distance formula?
The distance dd between two points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) on a coordinate plane is d=(x2x1)2+(y2y1)2d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}. It comes directly from the Pythagorean theorem: the segment connecting the two points is the hypotenuse of a right triangle whose legs are the horizontal distance Δx=x2x1\Delta x = x_2 - x_1 and the vertical distance Δy=y2y1\Delta y = y_2 - y_1.
Why does the distance formula use the Pythagorean theorem?
Any two points on a plane, together with the point directly below (or above) one of them and level with the other, form a right triangle. The two coordinate differences Δx\Delta x and Δy\Delta y are that triangle's legs, and the straight-line distance between the original points is its hypotenuse — so d2=Δx2+Δy2d^2 = \Delta x^2 + \Delta y^2 is just the Pythagorean theorem a2+b2=c2a^2+b^2=c^2 written in coordinates.
Does it matter which point I call (x1,y1) and which I call (x2,y2)?
No. Swapping the two points flips the sign of both Δx\Delta x and Δy\Delta y, but each difference gets squared immediately afterward, and squaring erases the sign. The final distance — and every intermediate square — comes out identical either way, so pick whichever point is more convenient to list first.
What does it mean when the answer is a simplified radical like 2√34?
Most pairs of points do not sit a whole number of units apart, so the distance is an irrational number that never terminates as a decimal. This calculator reports the exact value as a simplified radical (pulling out any perfect-square factor, e.g. 136=234\sqrt{136} = 2\sqrt{34} since 136=4×34136 = 4 \times 34) alongside a rounded decimal approximation, so you can use whichever form a problem calls for.
When is the distance a whole number?
The distance is a whole number whenever Δx2+Δy2\Delta x^2 + \Delta y^2 is a perfect square — most famously when Δx|\Delta x|, Δy|\Delta y|, and dd form a Pythagorean triple such as 3-4-5, 5-12-13, or 8-15-17. Any scaled multiple of a known triple (e.g. 6-8-10) also lands on a whole-number distance.
Can I use decimal coordinates instead of whole numbers?
Yes — the formula works identically for decimal coordinates. If the coordinate differences do not happen to cancel out to a whole number, the value under the square root is shown unsimplified (e.g. 6.25\sqrt{6.25}) alongside its decimal approximation, since prime-factorization simplification only applies to whole-number radicands.
How is this different from the Pythagorean Theorem calculator?
The Pythagorean Theorem calculator takes the two leg lengths of a right triangle directly. This calculator takes two coordinate points instead, computes Δx\Delta x and Δy\Delta y for you, and then applies the same a2+b2=c2a^2+b^2=c^2 relationship to find the hypotenuse — the straight-line distance between the points.

Related calculators