Try it with your numbers
Show every step
Subtract the x-values, subtract the y-values, square both results, add them, and take the square root.
This is the Pythagorean theorem in coordinate form, so there is almost nothing to memorize. Once you see the triangle hiding inside it, sign slips and misplaced square roots become easy to catch. The sections below cover the proof, negatives and fractions, radical answers, related formulas, a fast way to check your work, and real uses.
Where the distance formula comes from
Take any two points that do not share a row or column. From the first point, draw a horizontal line. From the second, draw a vertical line. They meet at a corner, and the three points form a right triangle with the segment you want as the hypotenuse.
The horizontal leg has length and the vertical leg has length . The Pythagorean theorem gives . Squaring wipes out the absolute value bars, because for every real number, so the bars disappear:
That one fact explains two things students often ask about. The formula never needs absolute values, and it does not matter which point you call first, since . If plotting points on the coordinate plane still feels shaky, practice plotting points first, because the formula is a description of the picture you would draw.
Quick check
Answer:
How do you use the distance formula step by step?
The process is the same every time, and it is worth doing in this order so errors have nowhere to hide.
- Label the points and .
- Subtract in the same order for both coordinates.
- Square each difference and add the two squares.
- Take the square root of the sum.
Example 1. Find the distance between and .
The differences are and . Then:
The exact answer is . The decimal is only an approximation, so keep the radical until the last line and round once at the end.
The square root acts like a grouping symbol over everything beneath it, so the addition must finish before the root is taken. If that rule ever wobbles, a few order of operations practice problems will fix it. For more repetitions on this exact skill, use the distance formula practice problems.
Distance formula with negative coordinates and fractions
Negatives cause most of the lost points. When is negative, the subtraction turns into an addition, as in . A reliable way to think about it: the difference is how many steps lie between two numbers on a number line. From up to is five steps, because the path crosses zero. When two points sit in different quadrants of the graph, the gap crosses an axis and the two sizes add instead of subtract.
, but . When a difference is negative, keep it in parentheses before squaring.
Example 2. Find the distance between and .
The differences are and . Squaring gives and , and , so:
There is a shortcut for fractions. Multiply every coordinate by the common denominator, find the distance, then divide by that same number. Here, doubling gives and , whose distance is . Halving gives the same . Scaling every coordinate by scales every distance by , which is why this works.
How do you simplify a distance formula answer with a radical?
Most distances are not whole numbers, and many teachers want the exact simplified radical. Look for the largest perfect square that divides the number under the root, then pull its square root out front.
Example 3. Find the distance between and .
The differences are and . So:
When both differences are equal in size, the segment is the diagonal of a square, and the distance is the leg times . Spotting that gives with no arithmetic at all.
| Under the root | Simplified |
|---|---|
Never split the root across the sum. , not . The root covers the whole sum, and roots do not distribute over addition.
Distance formula vs slope formula and midpoint formula
Three formulas use the same two subtractions and answer three different questions. Mixing them up is common because the setups look alike.
- The slope formula divides: tells you steepness.
- The midpoint formula averages: tells you the center.
- The distance formula squares, adds and roots: it tells you length.
One difference matters in practice. Slope and distance both need the subtractions in a consistent order, but slope can flip sign if you are sloppy, while distance cannot, because every term is squared. A negative distance is therefore always a sign that something went wrong.
Try this: Take and . Find the distance, the slope and the midpoint, using the same two subtractions for each. You should get , and .
Distance formula for horizontal and vertical segments
If two points share a y-value, the vertical difference is zero and the formula collapses to . For and the distance is . The same happens with a shared x-value. You can read these off the graph without any root, and they are exactly the cases covered in horizontal and vertical lines.
This gives a neat use with intercepts. The line crosses the axes at and , so the segment between its intercepts has length . If you need to find those crossing points first, see finding x and y intercepts. The distance from the origin to any point is the shortened form .
Know where the formula stops working. It measures a straight line only. It says nothing about a route along streets or a curved path, and it assumes a flat plane.
How can you check a distance answer in ten seconds?

Before you trust a result, test it against three quick facts. First, the distance can never be shorter than the longer leg, and never longer than the two legs added together. In Example 1 the legs are and , so must land between and . The answer passes. An answer of or would flag an error immediately.
Second, estimate the root using neighboring perfect squares. Because , the root sits between and , and since is nearer to , a little above is right.
Legs of and give , and legs of and give . Multiples such as keep the pattern, so some answers come out whole at a glance.
Third, swap the order of the points and recompute. If the squared differences come out the same, the setup was sound. This also catches the most common slip, a dropped negative sign, because only one version of the subtraction will tend to be wrong.
Quick check
Answer:
How is the distance formula used for triangles and circles?

Geometry problems often hand you three points and ask what kind of triangle they make. Compute the squared side lengths, which skips the roots entirely, and test the Pythagorean relationship.
Take , and . Then , and . Since , the triangle has a right angle at , and the equal sides make it isosceles. A second method confirms it: the slopes of and are and , and their product is , the signature of perpendicular lines. This also gives a clean way to classify a right angle without a protractor.
A circle is simply the distance formula held fixed. Every point at distance from the center satisfies . A circle centered at passing through has radius , so its equation is . Three points are collinear when the two shorter distances add up exactly to the longest one.
Quick check
Answer:
Where is the distance formula used in real life?
Any time positions are stored as coordinates, this formula measures the gap. Video games use it to decide whether a character is within reach of an object, and apps use it to find the nearest store on a flat map. Scale is a related idea: on a map, real distance is proportional to measured distance, which is a case of direct variation.
Add a third coordinate and the idea carries into space: . The points and have differences , and , so . Data science uses the same idea in many dimensions as Euclidean distance.
Two limits are worth knowing. On Earth, long distances follow a curved surface, so navigation uses the great-circle (haversine) formula rather than a flat plane. For a city grid where you can only travel along blocks, the relevant measure is the taxicab distance , which is blocks from to even though the straight-line distance is . When you want to pair distance with its partner, the midpoint formula practice problems are a good next step.
Practice problems
0 of 5 solved
- Find the distance between and .
Answer:
Step 1: The differences are and . Step 2: . - Find the distance between and .
Answer:
Step 1: difference: . difference: . Step 2: . - Find the exact distance between and , then round to two decimal places.
Answer:
Step 1: difference: . difference: . Step 2: . Step 3: . - Find the distance between and .
Answer:
Step 1: difference: . difference: . Step 2: . Step 3: . - The distance between and is . Find every possible value of .
Answer:
Step 1: , so . Step 2: , so or . Step 3: or .
Common questions
What is the distance formula?
The distance formula is . It gives the straight-line length of the segment joining and . It comes straight from the Pythagorean theorem.
Does it matter which point is (x1, y1) and which is (x2, y2)?
No. Swapping the points flips the sign of each difference, and squaring removes the sign. You only need to keep the same order within the x subtraction and within the y subtraction.
Can a distance be negative?
No. The square root symbol returns the non-negative root, and the squared terms are never negative. If you get a negative answer, a sign error happened outside the formula.
How do you find the distance between two points with a negative coordinate?
Put the negative coordinate in parentheses before subtracting, so becomes . Then square each difference as usual. The squares are always positive.
What is the distance formula in 3D?
Add a third squared difference: . For example, the points and are units apart.
Is the distance formula the same as the slope formula?
No. Both use the differences and , but the slope divides them and the distance squares them, adds, and takes a root. Slope measures steepness, distance measures length.