Distance Formula Calculator

THE DISTANCE
Type two points, then press =.
The two differences, the squares, and the root
Exact — a whole number where it can be, a simplified surd where it cannot, never a bare decimal.
Two points
Type the two points. An empty box counts as 0, and fractions like 3/4 and decimals both work. The answer is kept exact — a whole number where it comes out whole, and a simplified surd like 3√5 where it does not. A rounded decimal is given beside it and is always labelled as one.
first point
,
second point
,
Tap a box, then use the keys
The distance formula is Pythagoras in disguise: the two points make the corners of a right triangle, the differences in x and y are its two short sides, and the distance is the hypotenuse. That is why it is d = √(Δx² + Δy²). And it is why the order of the points cannot matter — the differences change sign, but squaring throws the sign away.
The working, step by step

This distance formula calculator finds the straight-line distance between two points and keeps the answer exact — a whole number where it comes out whole, and a fully simplified surd where it does not.

That second part matters. The distance between (−3, 2) and (3, 5) is 3√5. You will see it written as √45, or as 6.708, and neither is the finished answer.

Distance Formula Calculator — a free tool from Monkza

How to Find the Distance Between Two Points

Four steps, and the middle two are where the work is.

1. Subtract the two x values, and the two y values.
2. Square both results.
3. Add the squares.
4. Take the square root of the total.

Worked through with (−3, 2) and (3, 5):

Δx = 3 − (−3) = 6 Δy = 5 − 2 = 3
6² + 3² = 36 + 9 = 45
d = √45 = 3√5

Notice the last line. √45 is correct but unfinished: 45 = 9 × 5, and the 9 comes out of the root as a 3. Leaving it inside is like handing in 6/8 instead of 3/4.

Why It Is Just Pythagoras

d = √(Δx² + Δy²)

Draw a horizontal line from one point and a vertical line from the other. They meet at a right angle, and you now have a right triangle whose two short sides are exactly the differences you just calculated. The distance you want is its hypotenuse.

So this is a² + b² = c² in different clothing, not a separate formula to memorise. That is worth knowing because a formula you can rebuild is one you cannot forget — and it is why this calculator draws the triangle, with your own numbers on it, before showing any arithmetic.

It also explains the shape of the answer. Squares of ordinary numbers are ordinary, so Δx² + Δy² is always a plain number. It is only the square root at the end that can turn awkward.

Why the Order Never Matters

Take the same two points the other way round. The differences become −6 and −3 — both signs flipped. But they are squared immediately, and (−6)² = 36 just as 6² = 36.

Squaring throws the sign away. That is the whole reason the distance from A to B equals the distance from B to A, and it is a better answer than "because distance is always positive", which describes the result rather than explaining it.

It is worth noticing what this does not say. The direction between the two points really does reverse. Size on its own is a distance; size together with direction is a displacement, and the two behave differently. If you have met vectors, this is exactly where the difference starts.

When the Answer Is a Surd, and Why It Should Stay One

Most of the time the sum of squares is not a perfect square, and the honest answer contains a root:

(1, −3) to (4, −6) → sum 18 → 3√2
(0, 0) to (2, 3) → sum 13 → √13
(4, 1) to (−2, 10) → sum 117 → 3√13

Two things get done to those answers that should not be.

Left unreduced. √18 and 3√2 are the same number, but only the second is finished. Pull out every square factor and nothing is left to simplify.

Turned into a decimal. 3√2 ≈ 4.2426, and that decimal will never be exactly right no matter how many digits you write. It is useful when you are measuring something; it is not the answer to a coordinate geometry question.

There is a third case people forget: the answer can be an exact fraction. The points (1/3, 0) and (0, 1/4) are exactly 5/12 apart — exact, and not a whole number. This page names all three kinds so you always know which you are holding.

Why Whole Answers Keep Turning Up

Do enough exercises and you will notice something odd: the answers are whole numbers far more often than they should be. That is not chance, and it is not luck.

Three whole numbers with a² + b² = c² are called a Pythagorean triple, and they are rare. The small ones are:

3–4–59 + 16 = 25
5–12–1325 + 144 = 169
8–15–1764 + 225 = 289
7–24–2549 + 576 = 625

Every other triple is a multiple of one of these — 6–8–10 is just 3–4–5 doubled. So when two points are 3 across and 4 up, the distance is exactly 5; when they are 5 across and 12 up, it is exactly 13.

Exercises are built from these on purpose, so that the answer can be written down neatly. This calculator names the triple when it finds one, which is a quick way to learn to spot them — and spotting them lets you write the answer before you have finished the arithmetic.

Two Shortcuts Worth Knowing

If both points have the same y, the line is level, Δy is 0, and the formula collapses. The distance is simply the gap in x: (1, 3) to (6, 3) are 5 apart. No squaring, no root.

If both points have the same x, the line stands upright and the same thing happens the other way round: (4, 1) to (4, 9) are 8 apart.

These come up constantly — the sides of rectangles, the edges of grids, anything laid out square — and reaching for the full formula on one of them is wasted work. It is worth a two-second glance at the coordinates before you start.

How to Use This Distance Calculator

Four boxes, arranged as two points.

x₁, y₁The first point. An empty box counts as 0
x₂, y₂The second point
← → ↑ ↓Move between the boxes
±Flips the sign, for a negative coordinate
and .Fraction bar and decimal point
/ ACDelete one character, or clear everything
=Works it out

Fractions like 3/4 and decimals like 0.25 both work, and the answer stays exact either way. Open the working and you get the triangle drawn from your coordinates, the two differences, the squares, the root reduced as far as it goes, and the triple named when there is one.

The same two differences also give the slope of the line through the points — distance squares them and adds; slope divides one by the other. Two questions, one pair of numbers.

Distance Formula FAQ

How do you find the distance between two points?
Subtract the two x values and the two y values, square both results, add them, and take the square root. For (-3, 2) and (3, 5) the differences are 6 and 3, the squares add to 45, and the distance is 3 times the square root of 5.
What is the distance formula?
d equals the square root of (x2 minus x1) squared plus (y2 minus y1) squared. It is the Pythagorean theorem applied to the right triangle whose short sides are the two differences.
Does it matter which point you call the first one?
No. Swapping them flips the sign of both differences, and both are squared before anything else happens, so the sign is thrown away. Distance from A to B always equals distance from B to A.
Should the answer be left as a square root or written as a decimal?
As a square root, and a reduced one. The square root of 45 is the same number as 3 times the square root of 5, but the second is finished and the first is not. A decimal such as 6.708 is a rounding of the answer rather than the answer.
Why do textbook answers so often come out whole?
Because the questions are built from Pythagorean triples on purpose. Three whole numbers with a squared plus b squared equal to c squared are rare, and the small ones are 3-4-5, 5-12-13, 8-15-17 and 7-24-25. If two points are 3 across and 4 up, the distance is exactly 5.
What if both points have the same y value?
Then the line is level, one difference is 0, and the distance is simply the gap in x. No squaring and no square root are needed. The same applies the other way round when the x values match.

Subtract, square, add, root — and then finish the job: reduce the surd, and check whether the triangle was a triple all along.