The Distance Formula: Calculator, Proof & Worked Examples
Need the straight-line distance between two points on a coordinate plane? Use the calculator for a fast answer with every step shown, or keep reading for the formula, the Pythagorean proof, and practice problems.
Published: June 12, 2026
Distance formula calculator
Enter the coordinates of two points to find the distance between them.
Result
Distance is always non-negative.
Step-by-step working
1.Substitute the coordinates into the distance formula.
2.Subtract to find the horizontal and vertical changes.
3.Square each difference and add them.
4.Take the square root to get the distance.
By the Solve Formulas Editorial Team. Published June 12, 2026.
Why this calculator exists. Most online tools give you the answer and nothing else. We built this one to show every step, because on a test, knowing how you got is the whole point.
What is the distance formula?
The distance formula calculates the straight-line distance between two points and on a coordinate plane. It answers the question students ask most often: how far apart are these two points?
Subtract the x-coordinates, subtract the y-coordinates, square both results, add them, and take the square root. That is the full distance formula.
The distance formula and the Pythagorean theorem
You do not need a separate rule to memorize. Plot the two points, draw a right triangle whose hypotenuse connects them, and the legs are and . The Pythagorean theorem gives:
Take the positive square root and you have the distance formula. Squaring removes the sign, so you do not need absolute-value bars inside the formula.
SAT tip. When a problem gives you three coordinate pairs, find all three side lengths with the distance formula first. Then check whether the longest side squared equals the sum of the other two squared. Example: vertices , , give sides 3, 4, and 5. Since , it is a right triangle.
When to use the distance formula
You will use it whenever you have two coordinate pairs and need the length between them: checking if a triangle is isosceles (compute all three sides and compare), finding a circle's radius from its center to a point on the edge, or getting the diagonal of a rectangle on a grid.
It works with negative numbers, decimals, and fractions. Subtract carefully; squaring takes care of the signs.
How to find the distance between two points (step by step)
- Label your points as and .
- Subtract: compute and .
- Square each difference.
- Add the two squares.
- Take the square root of the sum. That value is .
Walk-through with and :
Distance formula examples
Example 1: Whole-number coordinates (3-4-5 triangle)
Distance between and :
Classic 3-4-5 right triangle. The answer is exactly 5 units.
Example 2: Negative coordinates
Between and :
Show working
Example 3: Decimal coordinates
Between and :
Show working
Example 4: Distance from the origin
Between and :
When one point is the origin, the formula simplifies to .
3D distance formula
In three dimensions, add a term under the root for points and :
Example: to gives .
Where you will see this in real life
- Game development. Engines use vector distance (same Pythagorean form) for collision checks and pathfinding on a 2D map.
- Data science. K-nearest neighbors and clustering measure how far apart data points are in feature space.
- Class and tests. SAT and ACT geometry often give coordinate vertices and ask about side lengths or right triangles.
GPS apps use spherical formulas such as the haversine equation, not flat Euclidean distance, because the Earth is curved. For a homework grid, Euclidean distance is what you want.
Distance formula practice problems
Try these, then open the answers to check your work.
- Find between and .
- Find between and .
- Find between and .
- In 3D, find between and .
- Triangle has vertices , , . Find each side length.
Show answers
- 1.
- 2.
- 3. (not )
- 4.
- 5. , (isosceles)
Common mistakes to avoid
- Forgetting to square before adding. If you got something like 7, you probably added instead of .
- Mishandling negatives. , not −1.
- Taking the square root too early. Add the squared terms first, then take one square root.
- Mixing x and y. Always subtract x from x and y from y.
Rule of thumb: distance should never be negative. If your result is negative, re-check the arithmetic inside the radical before you took the root.
Back to the geometry formulas hub.
Frequently asked questions
- How do I find the distance between two points on a graph?
- Subtract the x-coordinates and the y-coordinates, square both differences, add them, and take the square root. Our calculator above runs those steps for you automatically.
- Does the order of the points matter?
- No. Squaring removes the sign, so swapping the two points gives the same distance.
- Can distance ever be negative?
- No. Distance is a length, so it is zero or positive. You get zero only when both points are identical.
- How is the distance formula related to the Pythagorean theorem?
- The distance formula is the Pythagorean theorem on a coordinate grid. The horizontal and vertical gaps are the legs; the segment between the points is the hypotenuse.
- How do I find the distance in three dimensions?
- Add a z-term under the root: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). Same idea, one more leg.
- What is the distance formula used for on the SAT?
- Side lengths from coordinates, checking for right triangles, and finding a circle's radius from its center to a point on the edge.
- How do I find the radius of a circle with the distance formula?
- Apply the formula between the center and any point on the circle. That distance is the radius.
- Does the distance formula work with fractions?
- Yes. Subtract the coordinates as usual, then square. With fractions, keep a common denominator when subtracting the y-values so you do not mix them up.