1. A 3–4–5 triangle
From (0, 0) to (3, 4):
d = √((3 − 0)² + (4 − 0)²)
= √(9 + 16) = √25 = 5
If the coordinates are in metres, the distance is 5 metres.
Enter (x₁, y₁) and (x₂, y₂) to calculate the straight-line Euclidean distance between two points in a 2D Cartesian plane.
Use integers, decimals, fractions such as 3/4, or mixed numbers such as -1 1/2. Both axes must use the same unit.
Valid changes recalculate automatically. You can also press Enter in any coordinate field.
Enter two complete points to plot them. The graph uses equal scale on both axes.
The coordinate differences form the two legs of a right triangle. The distance d is its hypotenuse, so the formula follows from the Pythagorean theorem.
The answer is in coordinate units unless the axes represent a named physical unit. For example, coordinates measured in metres produce a distance in metres.
From (0, 0) to (3, 4):
d = √((3 − 0)² + (4 − 0)²)
= √(9 + 16) = √25 = 5
If the coordinates are in metres, the distance is 5 metres.
From (−3, −1) to (3, 2):
d = √((3 − (−3))² + (2 − (−1))²)
= √(36 + 9) = √45 = 3√5 ≈ 6.7082
The distance is about 6.7082 coordinate units.
From (1/2, 1/4) to (5/2, 13/4):
d = √((5/2 − 1/2)² + (13/4 − 1/4)²)
= √(2² + 3²) = √13 ≈ 3.6056
The distance is about 3.6056 coordinate units.
The coordinate differences are squared, so their sum is nonnegative. The distance is the nonnegative square root of that sum.
No. Swapping the points changes the signs of Δx and Δy, but their squares—and therefore the distance—stay the same.
Use (0, 0) as one point. The formula simplifies to d = √(x² + y²).
Both coordinate differences are zero, so the distance is √0 = 0. The graph shows a single shared location.
Yes. Each coordinate accepts integers, decimals, fractions such as 3/4 or -5/2, and simple mixed numbers such as 1 1/2.
Yes. Both axes must use the same scale and unit for the result to be meaningful. The answer uses that same unit.
Not directly. This formula measures a straight line on a flat Cartesian plane. Road routes require network data, while latitude/longitude normally requires a spherical or ellipsoidal Earth-distance method.
Editorial owner: Starlight Tools Editorial Team. The calculator applies the Euclidean formula in the browser and has been checked with positive, negative, decimal, fractional, identical-point, horizontal-line, and vertical-line cases. Inputs are not uploaded.
Reference: OpenStax, “The Rectangular Coordinate Systems and Graphs”, derives the coordinate distance formula from the Pythagorean theorem.