By · Updated

Distance Formula Calculator

Coordinate Distance and Midpoint Between Two Points, With the Exact Root

No ratings yet
Result

—

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Distance Formula Calculator works

This distance formula calculator finds the straight-line distance between two points on a coordinate grid. Enter the x and y of each point and it shows the change in x and y, the sum of squares, the decimal answer and the exact surd, plus the midpoint and the grid distance.

The distance between two points is the hypotenuse of a right triangle. The horizontal gap between the points is one leg and the vertical gap is the other, so Pythagoras gives the length of the line joining them. Negative coordinates are fine, because each gap is squared before it is added.

How the distance formula calculator works

The formula is d = √((x₂ − x₁)² + (y₂ − y₁)²). The calculator subtracts to get Δx and Δy, squares and adds them, then takes the square root. When the sum is a whole number it also simplifies the root, so 80 becomes 4√5, which is the form most textbooks ask for.

First example. From (1, 2) to (5, 10), Δx = 4 and Δy = 8. Then 16 + 64 = 80 and d = √80 = 4√5, about 8.944.

Second example. From (−3, 1) to (3, −7), Δx = 6 and Δy = −8. Then 36 + 64 = 100, so d = 10 exactly.

How many blocks do you walk from (2, 3) to (7, 9) on a street grid? You cannot cut across, so use the Manhattan distance: |5| + |6| = 11 blocks, against a straight-line distance of about 7.81.

Distance from the origin (0, 0) to 24 points, with exact roots

Point Δx² + Δy² Exact Distance
(3, 4) 25 5 5.000
(5, 12) 169 13 13.000
(8, 15) 289 17 17.000
(7, 24) 625 25 25.000
(1, 1) 2 √2 1.414
(2, 3) 13 √13 3.606
(-4, 3) 25 5 5.000
(6, 8) 100 10 10.000
(-5, -12) 169 13 13.000
(9, 12) 225 15 15.000
(1, 2) 5 √5 2.236
(2, 2) 8 2√2 2.828
(10, 10) 200 10√2 14.142
(-3, 7) 58 √58 7.616
(12, 16) 400 20 20.000
(20, 21) 841 29 29.000
(-6, 2) 40 2√10 6.325
(4, 4) 32 4√2 5.657
(0, 9) 81 9 9.000
(-8, -6) 100 10 10.000
(1, 7) 50 5√2 7.071
(11, 60) 3721 61 61.000
(15, 20) 625 25 25.000
(3, -3) 18 3√2 4.243

Tips

FAQ

How do you find the distance between two points?

Subtract the x values and the y values, square both differences, add them and take the square root. For (2, 1) and (8, 9) that is √(36 + 64) = √100 = 10. It is Pythagoras applied to the right triangle whose legs are the horizontal and vertical gaps between the points.

What is the distance formula in 3D?

Add a third squared term for the z difference: d = √(Δx² + Δy² + Δz²). From (0, 0, 0) to (2, 3, 6) the distance is √(4 + 9 + 36) = √49 = 7. The idea is the same, applying Pythagoras twice instead of once.

What is the difference between Euclidean and Manhattan distance?

Euclidean distance is the straight line the distance formula measures. Manhattan distance adds the absolute horizontal and vertical gaps, as if you could only travel along grid lines like city streets. Manhattan distance is always at least as long, and equal only when the points share an x or y.

How do I leave the answer in simplest radical form?

Find the largest perfect square that divides the number under the root and take its square root outside. √72 = √(36 × 2) = 6√2. The calculator does this automatically whenever the sum of squares is a whole number, and shows the simplified form beside the decimal.

See also: all Algebra and Geometry tools, Arithmetic, Number Theory, Statistics, Trigonometry and Calculus.

Related tools