The distance between two points on a flat coordinate plane is d = √[(x₂ − x₁)² + (y₂ − y₁)²]. Subtract the horizontal coordinates, subtract the vertical coordinates, square both differences, add them and take the square root.

This formula gives the straight-line length joining the points. In the Distance Calculator, use the coordinate-points option for this kind of problem. Latitude and longitude on Earth require a different calculation.
Work through a complete example
Take point A = (2, 3) and point B = (5, 7). The first number in each pair is x; the second is y. These example points have been chosen so that each stage can be checked without rounding.
- Horizontal change: 5 − 2 = 3 units.
- Vertical change: 7 − 3 = 4 units.
- Distance: √(3² + 4²) = √(9 + 16) = √25 = 5 units.
Imagine moving 3 units right and 4 units up to reach the second point. Those two movements form the legs of a right triangle; the direct line between the points forms its hypotenuse. This is the Pythagorean theorem expressed using coordinates, as explained in OpenStax’s coordinate geometry lesson.
What changes when coordinates are negative?
The same formula works. Suppose C = (−4, 2) and D = (2, −6). The horizontal difference is 2 − (−4) = 6. The vertical difference is −6 − 2 = −8. Squaring the differences produces 36 and 64, so the distance is √100 = 10 units.
Use parentheses around a negative coordinate when subtracting it. The expression 2 − (−4) becomes 6, not −2. Also, (−8)² is positive 64. The distance between two different points cannot be negative.
Why adding the horizontal and vertical changes is different
For the first example, 3 + 4 = 7 units is the distance along a route with one horizontal section and one vertical section. It is not the 5-unit direct diagonal. A robot constrained to an aisle grid might follow the longer route, while the mathematical distance formula describes the unrestricted straight line.
Neither answer is a substitute for an actual road route. A coordinate problem gives a geometric length; a trip may also involve barriers, permitted paths or curved surfaces.
Check the scale on both axes
The usual formula assumes the x and y coordinates use the same distance unit and scale. If x is in feet and y is in inches, convert one before calculating. For example, a 3-foot horizontal change and a 48-inch vertical change are 3 feet and 4 feet, producing a 5-foot diagonal.
If coordinates are grid positions on a drawing where one grid unit equals 2 meters, a result of 5 grid units represents 10 meters. A stretched image on a screen does not change the underlying coordinates, so judge the calculation from the stated scale rather than the picture’s apparent shape.
Three quick ways to check an answer
- Reverse the points: swapping A and B changes the signs of the differences but must leave the distance unchanged.
- Use a straight-axis check: if both y coordinates are equal, the distance is simply the absolute x difference.
- Estimate a sensible range: the diagonal cannot be shorter than either horizontal or vertical change, or longer than their sum.
Keep extra decimal places during calculation and round only the final answer. If a problem asks for an exact value, a result such as √13 may be preferable to 3.61.
Enter your own pair of points in the Distance Calculator’s 2D coordinate mode, then use the differences above to check the result.