How to use the Distance Formula Calculator
- Enter the x- and y-coordinates of the first point.
- Enter the coordinates of the second point.
- Review the horizontal and vertical differences and the resulting straight-line distance.
Two-dimensional distance formula
Where:
- = coordinates of the first point
- = coordinates of the second point
Show as plain text
Distance = √((x₂ − x₁)² + (y₂ − y₁)²)
The coordinate differences are the legs of a right triangle. The Pythagorean theorem gives the straight-line distance as the square root of the sum of their squares.
The calculation uses a scaled hypotenuse operation to reduce intermediate overflow risk and displays a rounded decimal result.
Assumptions and limitations
- Both points lie in the same flat two-dimensional Cartesian coordinate system.
- Coordinates must be finite values between −1 × 10¹⁵⁰ and 1 × 10¹⁵⁰; the result is rounded for display.
Example: Find the distance from (1, 2) to (4, 6)
- Horizontal difference: 4 − 1 = 3.
- Vertical difference: 6 − 2 = 4.
- Distance = √(3² + 4²) = √25 = 5 coordinate units.
When to use the Distance Formula Calculator
- Checking the distance between two plotted points in a coordinate plane.
- Applying the Pythagorean theorem to horizontal and vertical coordinate differences.
- Comparing a line's length with its direction using the slope calculator.
Distance Formula Calculator FAQs
Does the order of the points change the distance?
No. Reversing the points changes the signs of both coordinate differences, but their squares and the final distance stay the same.
What units does the answer use?
The distance uses the same coordinate unit as the inputs. If the coordinates are in meters, the distance is in meters; if they are unitless, the answer is in coordinate units.
Does this calculate distance on a map or globe?
No. It calculates straight-line Euclidean distance in a flat 2D coordinate plane. Map projections and distances over Earth's curved surface require different methods.
How this calculator was built and tested is explained in our methodology. Spotted a problem? Let us know.