To find the distance between two points on a coordinate plane, use the distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). Subtract the x-coordinates, subtract the y-coordinates, square both results, add them, then take the square root. This works for every pair of points in any quadrant, including negatives and decimals. If your two points share the same x-value or the same y-value, a shortcut applies and you can skip most of the work. The four-step version below is the general method that never fails.
Name the Coordinates Before You Subtract Anything
Every distance calculation starts with clean labels. Call one point (x₁, y₁) and the other (x₂, y₂). The order you assign them doesn't change the answer, because squaring removes any sign difference. Writing the labels down first prevents the most common error: mixing an x-value into the y-difference, or dropping a negative sign mid-calculation.
A worked example makes this concrete. Take point A at (3, 4) and point B at (7, 1). Label A as (x₁, y₁) and B as (x₂, y₂), so x₁ = 3, y₁ = 4, x₂ = 7, y₂ = 1. Alternatively label B as the first point — the result is identical, which is a useful self-check if you doubt your arithmetic.
Negative coordinates deserve explicit attention because they trip up more students than any other part of the formula. If point C sits at (−2, 5) and point D at (4, −3), then x₂ − x₁ = 4 − (−2) = 6, and y₂ − y₁ = −3 − 5 = −8. The subtraction of a negative becomes addition. Write the parentheses out rather than simplifying in your head until the habit is automatic.
Decimals and fractions follow the same rules, so no special case exists here. Points at (1.5, 2.25) and (4.5, 6.25) produce differences of 3 and 4, which happen to form a 3-4-5 triangle. If the coordinates come from a word problem — map positions, screen pixels, graph readings — confirm the units match before you calculate, because mixing kilometers with meters produces a distance in the wrong unit with no warning.
Apply the Distance Formula in Four Numbered Steps
The formula itself is one expression, but executing it in a fixed order keeps errors out. Each step below names exactly what to write on the page. Do them in sequence and check the sign of each difference before squaring.
1: Subtract the x-coordinates: x₂ − x₁. This is the horizontal leg of the right triangle formed by the two points. 2: Subtract the y-coordinates: y₂ − y₁. This is the vertical leg, also called the rise or the vertical change. 3: Square each difference and add the results: (x₂ − x₁)² + (y₂ − y₁)². Squaring makes both values positive, so sign mistakes from steps 1 and 2 cannot survive this step. 4: Take the square root of that sum: d = √((x₂ − x₁)² + (y₂ − y₁)²). If the sum isn't a perfect square, round to the decimal place your problem or teacher specifies.
If step 4 produces a messy root like √52, simplify it to 2√13 or evaluate it to roughly 7.21. If your answer comes out negative, stop — a square root of a positive sum cannot be negative, so you've made an arithmetic error somewhere in steps 1 through 3. If the sum inside the root is zero, both points are identical and the distance is zero, which is a valid answer, not a mistake. Check also that you squared before adding; adding first and then squaring gives a different, wrong result.
Work Through a Full Calculation With Real Numbers
Run the example from start to finish to see the formula in action. Points (3, 4) and (7, 1) give x₂ − x₁ = 7 − 3 = 4 and y₂ − y₁ = 1 − 4 = −3. Square both: 16 and 9. Add: 16 + 9 = 25. Take the root: √25 = 5. The distance between the two points is exactly 5 units.
That result is clean because (3, 4), (7, 1), and (7, 4) form a 3-4-5 right triangle — a shape that appears constantly in textbook problems and standardized tests. Recognize the triple and you can often skip the arithmetic. The legs are 4 and 3, and the hypotenuse is 5. The same pattern shows up with 6-8-10, 5-12-13, and 8-15-17.
Try a messier pair to see rounding. Points (−1, 2) and (5, 10): x₂ − x₁ = 6, y₂ − y₁ = 8, so the squares are 36 and 64, the sum is 100, and the distance is 10. Another pair, (2, 3) and (5, 7): differences 3 and 4, squares 9 and 16, sum 25, distance 5. Both land on clean values, which is by design in most practice sets.
Now take (0, 0) and (2, 3). Differences are 2 and 3, squares are 4 and 9, sum is 13, and the distance is √13 ≈ 3.61. This is the case most real-world problems produce: an irrational result that must be rounded. State the rounded value with its unit and, if your answer will feed into further calculation, keep more decimal places than you plan to report.
The pattern generalizes. If a point sits at the origin (0, 0), the distance formula collapses to √(x² + y²), because both subtractions vanish. That's the special case behind vector magnitude and the reason distances from the origin are easier to compute than distances between two arbitrary points.
Use the Horizontal and Vertical Shortcuts
When two points share a coordinate, the distance is a simple subtraction and the square root never appears. These shortcuts come up often enough to memorize, and they're also a fast way to check a full-formula answer.
If both points have the same y-value, the segment is horizontal and the distance equals |x₂ − x₁|. Points (2, 5) and (9, 5) are 7 units apart. If both points have the same x-value, the segment is vertical and the distance equals |y₂ − y₁|. Points (4, −1) and (4, 6) are 7 units apart. The absolute value matters because distance is never negative, even when the subtraction runs backward.
Run the general formula on a horizontal pair to see why the shortcut works. For (2, 5) and (9, 5), the y-difference is 5 − 5 = 0. The formula gives √((7)² + 0²) = √49 = 7. The zero disappears and the square root undoes the square. Any time one difference is zero, the calculation reduces to the other difference.
The shortcut is also the fastest sanity check on any full calculation. If your two points differ by 6 in x and 8 in y, the distance must be greater than 8 (the hypotenuse of a right triangle is always the longest side), and it must be less than 6 + 8 = 14 by the triangle inequality. A result outside that range is wrong. For points 6 and 8 apart, the answer is exactly 10, which falls between 8 and 14 as expected.
Avoid the Sign and Order Mistakes That Cost Marks
Three errors account for most lost points on distance problems, and each has a specific fix. Knowing them in advance turns a common trap into a quick check.
The first is subtracting in inconsistent order. If you compute x₂ − x₁, you must compute y₂ − y₁, not y₁ − y₂. Mixing the order flips one sign while leaving the other alone, and although squaring usually rescues you, the error becomes visible when you later use the differences for slope: slope requires a consistent order, and inconsistent subtraction gives the wrong slope even when the distance comes out right. Fix: write the labels (x₁, y₁) and (x₂, y₂) directly above the subtraction before computing.
The second is mishandling negative coordinates — subtracting a negative and forgetting that it becomes positive. The fix is to keep the parentheses in writing until the arithmetic is done. The third is forgetting the square root, which happens when a student stops at the sum of squares. The sum of squares is the square of the distance, not the distance itself; a distance of 5 has a square of 25, and reporting 25 as the answer is wrong by a factor of 5.
A fourth, subtler error appears in three dimensions. Some courses extend the formula to points (x₁, y₁, z₁) and (x₂, y₂, z₂), where the distance becomes √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). If your problem gives three coordinates, the two-dimensional formula will silently drop the z-term and produce too small an answer. Count the coordinates before you start.
Derive the Formula From the Pythagorean Theorem
The distance formula isn't a separate rule to memorize — it's the Pythagorean theorem applied to a right triangle drawn on the grid. Understanding the derivation means you can rebuild the formula from scratch if you forget it, and it explains why squaring appears at all.
Plot two points and draw a horizontal line from one and a vertical line from the other until they meet. The meeting point completes a right triangle whose legs are the horizontal and vertical differences between the original points. Those legs have lengths |x₂ − x₁| and |y₂ − y₁|. The straight-line distance between the original points is the hypotenuse.
Pythagoras gives leg² + leg² = hypotenuse², so (x₂ − x₁)² + (y₂ − y₁)² = d². Take the square root of both sides and you have the distance formula. The absolute value bars disappear inside the squares because squaring a negative gives the same result as squaring its positive, which is exactly why the formula tolerates subtracting in either order.
This derivation also explains the shortcut cases. A horizontal segment has a vertical leg of zero, so the triangle collapses to a line and the hypotenuse equals the horizontal leg. The same logic covers vertical segments. When you see a distance problem, the triangle is always there in the background, whether or not the diagram shows it.
Check Your Answer Against the Grid and the Triangle Inequality
Two independent checks catch nearly every arithmetic slip before it reaches your final answer. Neither requires redoing the whole calculation, so they're cheap insurance on exams and homework alike.
The first check is visual. Plot both points roughly on grid paper or a sketch and estimate the distance by eye. If your calculation says the points are 12 units apart but the sketch shows them about 5 units apart, something went wrong. Estimation gets easier with practice, and the grid makes the horizontal and vertical gaps obvious.
The second check is the triangle inequality. The straight-line distance must be at least as long as the larger of the two differences and no longer than their sum. For differences of 5 and 12, the distance must fall between 12 and 17; the exact answer, 13, fits. A computed distance of 7 for those differences would fail the check and signal a mistake in squaring or adding.
Rounding introduces its own form of error. √50 is about 7.0710678, and rounding to 7.1 is fine for most purposes but loses precision if the value feeds into another formula. Keep four to six decimal places during intermediate work, then round only the final answer to whatever precision the problem specifies. For a distance that must be exact, leave it as a simplified radical.
Handle Word Problems, Maps, and Screen Coordinates
Real problems dress the coordinates in units, and the units are where most real-world mistakes happen. A distance of 5 is meaningless without knowing whether it's meters, miles, or pixels.
On a map, coordinates might be given in degrees of latitude and longitude. The distance formula applies directly only for small areas where the curvature of the Earth is negligible; over long spans, degree differences don't translate linearly into ground distance, and the spherical law of cosines or a map tool is the appropriate method. For classroom maps with grid coordinates, the formula works as written, and the units are whatever the grid specifies.
Screen coordinates follow a quirk: on most computer displays the y-axis points downward, with (0, 0) at the top-left corner. The distance formula still works, because squaring removes the direction, but a positive y-difference means "downward on screen" rather than "up." Graphics programmers rely on this constantly, and the same formula computes the length of any line segment in a drawing or a game.
Word problems also ask for the midpoint alongside the distance. The midpoint is the average of the coordinates: ((x₁ + x₂)/2, (y₁ + y₂)/2). For (3, 4) and (7, 1), the midpoint is (5, 2.5). The midpoint formula doesn't use square roots, so it's usually the easier half of a two-part question, and computing it first can help you sketch the segment accurately for the visual check.
Compare the Four Common Methods Side by Side
Several methods claim to find the distance between two points, and they aren't interchangeable in effort or applicability. The table below compares them on the dimensions that matter when you're choosing what to use.
| Method | Best for | Requires | Fails when |
|---|---|---|---|
| Distance formula | Any two points in a plane | Coordinate pairs | More than two dimensions, unless extended |
| Pythagorean theorem on the grid | Understanding why the formula works; teaching | A sketch of the right triangle | You skip drawing the triangle and misplace the legs |
| Ruler on a printed graph | Quick estimates and answer checks | Accurate scale on the grid | The grid lacks a scale, or points fall off the paper |
| Absolute difference | Points sharing an x or y value | Same x or same y | Any pair with both coordinates different |
The distance formula is the default because it handles every case with one expression. The ruler method is faster for a rough estimate but introduces measurement error and depends entirely on the grid being drawn to scale. Absolute difference is a genuine shortcut only for horizontal and vertical pairs, and applying it to diagonal pairs — subtracting the coordinates and adding — gives the wrong answer by a wide margin.
Pick the formula for exact answers and the ruler for sanity checks. Skip the ruler when the graph has no scale, and skip absolute difference unless one coordinate pair matches exactly. None of the four methods handles three-dimensional points without modification; for those, extend the formula with a third squared term as described earlier.
FAQ
Does the order of the two points change the distance?
No. Swapping (x₁, y₁) and (x₂, y₂) flips the sign of each difference, and squaring erases the sign, so the final root is identical. You can verify on (3, 4) and (7, 1): either assignment gives differences of magnitude 4 and 3, and the distance is 5 both ways. The order does matter for slope, which is a separate calculation.
What is the distance between (0, 0) and (12, 16)?
It's 20 units. The differences are 12 and 16, whose squares are 144 and 256, summing to 400, and √400 = 20. This is the 3-4-5 triple scaled by a factor of 4, since 12 = 3 × 4, 16 = 4 × 4, and 20 = 5 × 4. Recognizing the scaled triple lets you skip the arithmetic entirely.
Why is my answer wrong when I add the numbers before squaring?
Addition before squaring computes (a + b)² instead of a² + b², and those are different quantities. For differences of 3 and 4, adding first gives 7 and squaring gives 49, while the correct procedure gives 9 + 16 = 25. The correct distance is 5, not 7, so order matters: square each difference, then add.
Can the distance ever be zero?
Yes, when both points are identical. If (x₂ − x₁) and (y₂ − y₁) are both zero, the sum is zero and the square root is zero. Some problems ask whether two given points coincide, and a distance of zero is the direct test. A negative result, by contrast, is always an error, since a square root of a positive sum can't be negative.
How do I extend the formula to three dimensions?
Add a third squared difference for the z-coordinates: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). For points (1, 2, 3) and (4, 6, 3), the differences are 3, 4, and 0, so the distance is 5 — the same as the two-dimensional case because the z-values match. Omitting the third term when coordinates are 3D gives an answer that's too small.
Is the distance formula the same as the midpoint formula?
No, they answer different questions and produce different outputs. The midpoint is an average of coordinates and gives a point, while the distance gives a length. For (3, 4) and (7, 1), the midpoint is (5, 2.5) and the distance is 5. A common exam mistake is calculating one when the question asks for the other.
What if the coordinates are fractions or decimals?
The procedure is unchanged; just take care with the arithmetic. Points at (0.5, 1.5) and (2.5, 4.5) give differences of 2 and 3, and a distance of √13 ≈ 3.61. Keep fractions in exact form when a problem requests an exact answer, and convert to decimals only at the final step to avoid compounding rounding error.