Enter two points
Choose 2D or 3D, then enter coordinates. For 2D, you only need x and y. For 3D, add z.
Use this free Distance Formula Calculator to find the distance between two points in 2D (coordinate plane) or 3D space. It shows the exact distance (radical form when possible), a decimal approximation, and the step-by-step substitution so you can learn or check homework fast.
Choose 2D or 3D, then enter coordinates. For 2D, you only need x and y. For 3D, add z.
The distance formula is one of the most useful tools in coordinate geometry. It tells you the straight-line distance between two points. If you’ve learned the Pythagorean theorem (a² + b² = c²), the distance formula is basically the same idea — just applied to coordinate differences.
For two points A(x₁, y₁) and B(x₂, y₂), first compute the horizontal and vertical changes:
These become the legs of a right triangle. The distance (the hypotenuse) is: d = √(Δx² + Δy²) = √((x₂−x₁)² + (y₂−y₁)²).
In 3D, points are A(x₁, y₁, z₁) and B(x₂, y₂, z₂). You do the same thing, but add the depth change:
The 3D distance is: d = √(Δx² + Δy² + Δz²).
In 2D, the coordinate differences (Δx and Δy) form a right triangle when you draw a horizontal line from one point and a vertical line to the other. The Pythagorean theorem says the squared distance equals the sum of squares of the legs. In 3D, you can apply the 2D result twice: first find the distance in the x–y plane, then combine that with Δz using the Pythagorean theorem again.
Many textbook problems want the exact answer (like √13) rather than a rounded decimal. This calculator shows both so you can pick the format your class expects.
Here are three examples you can follow step-by-step. Try typing them into the calculator above and compare your work.
The #1 mistake is forgetting parentheses with negatives. For example, y₂ − y₁ = −7 − 5 is −12 (not −2). Always plug negatives in parentheses.
This page uses a simple sequence of steps that mirrors what you’d write by hand. When you press Calculate Distance, the calculator:
A “just the answer” calculator is useful, but it can hide where errors happen. The step display makes it easy to spot issues like swapped points, sign mistakes, or missing parentheses. It’s also great for learning because you can compare your worksheet to the exact same arithmetic.
If the sum under the square root has a perfect square factor, the radical simplifies. Example: √52 becomes 2√13 because 52 = 4·13. If the number under the root is prime (like 61), it can’t be simplified, so the exact form stays √61.
The distance formula is unit-agnostic — if your coordinates are in meters, the distance is in meters. If your coordinates are in miles, the distance is in miles. Just keep your axes consistent.
Yes — it’s the Pythagorean theorem applied to coordinate differences. The legs of the triangle are Δx and Δy, so the hypotenuse is √(Δx² + Δy²).
Always subtract in the same order (x₂ − x₁, y₂ − y₁) and put negatives in parentheses before subtracting. Then square the differences — the squared values are always nonnegative.
No. Distance represents length, and length is never negative. The square root of a sum of squares is always ≥ 0.
Not for the distance formula. Squaring removes negative signs automatically. For example, (−4)² = 16.
Factor the number under the root and look for perfect squares (4, 9, 16, 25, ...). If you can pull out a perfect square, it simplifies. This calculator does that for common cases.
You can enter decimals (like 0.5 for 1/2). For exact fraction work, you’d do the same steps by hand with fractions, but the formula stays identical.
Use 3D when points have x, y, and z coordinates — like in physics problems, 3D graphs, CAD models, or measuring movement in space.
If you’re working in coordinate geometry, these are the next calculators people usually use.
The distance formula is “math viral” when it’s packaged as a quick challenge. Try this: pick two random points, screenshot the exact radical + decimal result, and post “Who can solve it faster: mental math vs calculator?” Then reveal the steps. Students love seeing the clean substitution and simplification.
Tip for teachers/parents: this page is designed to be transparent — it shows the exact substitution and simplification so it supports learning rather than hiding work.