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.
The distance formula
The distance between two points and on a coordinate plane is:
The two points, together with the corner point directly across from them, form a right triangle: the horizontal leg has length , the vertical leg has length , 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:
- Subtract the x-coordinates: .
- Subtract the y-coordinates: .
- Square both differences and add them: .
- Take the square root of that sum — simplifying it to a smaller radical when possible, or rounding it to a decimal approximation.
Worked examples
Example 1 — irrational result, simplifies to a smaller radical: for and , and , so .
Example 2 — Pythagorean triple, exact whole number: for and , and , so exactly.
Example 3 — the classic 3-4-5 triangle: for and , .
Example 4 — no coefficient to pull out: for and , — 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. ), 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. ) for whichever a problem calls for.
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 between two points and on a coordinate plane is . 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 and the vertical distance .
- 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 and are that triangle's legs, and the straight-line distance between the original points is its hypotenuse — so is just the Pythagorean theorem 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 and , 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. since ) 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 is a perfect square — most famously when , , and 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. ) 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 and for you, and then applies the same relationship to find the hypotenuse — the straight-line distance between the points.