Distance Formula: Calculator, Step-by-Step Proof & Examples
Use the calculator below to find the straight-line distance between any two points, with every step shown. Below the calculator you'll find the distance formula, the Pythagorean proof, worked examples with negative numbers and decimals, and five practice problems.
Published: June 12, 2026 · Updated: June 15, 2026
Distance formula calculator and solver
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 Tim Carter, Math Educator & Founder · Published June 12, 2026 · Updated June 15, 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?
By definition, the distance formula calculates the straight-line (Euclidean) distance between two points and on a coordinate plane. It answers the question students ask in every geometry class: how far apart are these two points? The distance between two points formula gives you a single number: the length of the segment connecting them.
Distance formula cheat sheet
- 2D:
- 3D:
- From the origin:
- Order of points: Does not matter; squaring removes the sign.
- Distance is always: zero or positive, never negative.
Subtract the x-coordinates, subtract the y-coordinates, square both results, add them, and take the square root. That's the full distance formula: five steps, every time.

Distance formula proof: the connection to the Pythagorean theorem
You don't 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 don't need absolute-value bars inside the formula, so it works with negative coordinates automatically.
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's a right triangle.
When to use the distance formula
Use it whenever you need the length between two coordinate pairs, or put another way, whenever you need to find the distance between coordinates. Common situations: checking whether 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.
Negative numbers, decimals, fractions: it handles all of them. Subtract carefully; squaring fixes the signs after that.
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 .
The most common mistake happens at step 3: students sometimes add the differences before squaring. Always square first, then add.
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 . Same formula, one extra leg.
Distance formula and Pythagorean theorem: real-life applications
- Game development. Engines use vector distance (the same Pythagorean form) for collision detection and pathfinding on a 2D map. Two characters with positions and are units apart.
- Construction. A carpenter cutting a diagonal brace for a rectangular frame measuring 3 ft by 4 ft uses ft for the brace length. That's the distance formula (and the Pythagorean theorem) in action.
- Data science. K-nearest neighbors and clustering algorithms measure how far apart data points are in feature space using Euclidean distance, the same formula extended to many dimensions.
- Tests. SAT and ACT geometry questions often give coordinate vertices and ask about side lengths, right triangles, or circle radii.
GPS apps use spherical formulas such as the haversine equation rather than 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. If you want more practice, treat the five problems below as a mini distance formula worksheet: write them out by hand before checking each answer.
Want a printable distance formula worksheet?
Download our free worksheet (10 problems with a full answer key), designed so you can write out each step by hand. Working through problems on paper is still the fastest way to lock in the method before a test. Request it via the contact page and we'll send it to you.
- Find between and .
- Find between and .
- Find between and .
- In 3D, find between and .
- Triangle has vertices , , . Find each side length and identify the triangle type.
Show answers
- 1.
- 2.
- 3.
- 4.
- 5. , , an isosceles triangle
Common mistakes to avoid
- Adding before squaring. If you got something like 7, you probably added instead of . Always square first.
- Mishandling negatives. , not −1. Draw the subtraction out if you're unsure.
- Taking the square root too early. Add the squared terms first, then take one square root at the end.
- Mixing x and y. Always subtract x from x and y from y; keep the coordinates in their own columns.
Rule of thumb: distance should never be negative. If your result is negative, something went wrong before the square root step; check the arithmetic inside the radical.
Related geometry formulas
The distance formula is part of a cluster of coordinate geometry tools. Once you have the distance between two points, the midpoint formula tells you the coordinates of the point exactly halfway between them, useful for finding the center of a segment. The slope formula uses the same coordinate differences to describe the steepness of the line connecting the two points. These three formulas together cover the most common coordinate geometry questions on the SAT and ACT.
The distance formula also appears inside the equation of a circle: the standard form is simply the distance formula squared, where is the center and is the radius.
Sources & References
Explore more on the geometry formulas hub, or jump to the distance formula calculator at the top of this page.
Frequently asked questions
- How do I find the distance between two points on a graph?
- Think of it as the Pythagorean theorem's connect-the-dots version. Find the horizontal gap by subtracting the x-coordinates, find the vertical gap by subtracting the y-coordinates, square both, add them, then take the square root. The calculator at the top of this page runs those steps automatically and shows the working.
- Does the order of the points matter?
- No. Swapping the points gives the same distance because squaring removes any negative sign. You can assign either point as (x₁, y₁); the result won't change.
- Can distance ever be negative?
- No. Distance is a length, so it is always zero or positive. You get zero only when both points are identical, meaning they're the same point.
- How is the distance formula related to the Pythagorean theorem?
- The distance formula is the Pythagorean theorem applied to a coordinate grid. The horizontal and vertical gaps between the two points are the legs of a right triangle; the segment connecting the points is the hypotenuse. That's the whole proof.
- How do I find the distance in three dimensions?
- Add a z-term under the root: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). You're just extending the same idea by one more dimension, one more leg on the right triangle.
- What is the distance formula used for on the SAT?
- Side lengths from coordinates, checking whether three points form a right triangle, and finding a circle's radius from its center to a point on the edge. Those three tasks cover most of the coordinate geometry questions you'll see.
- 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. This is exactly how the standard equation of a circle (x − h)² + (y − k)² = r² is derived.
- Does the distance formula work with fractions?
- Yes. Subtract the coordinates as usual, keeping a common denominator when the fractions have different denominators, then square each result. The process is the same; fractions just take a bit more care at the subtraction step.
Was this page helpful?