Distance Between Two Points Calculator
Calculate the straight-line distance between two points in a 2D coordinate plane using the distance formula derived from the Pythagorean theorem. Enter x1, y1, x2, y2 for instant results.
How to use this tool
- Enter x1, y1, x2 and y2 in the fields above.
- Results update instantly as you type โ or click Calculate.
- Read your distance and the full breakdown beneath it.
Formula
d = sqrt((x2-x1)^2 + (y2-y1)^2)
How it works
Distance formula: d = โ((x2โx1)ยฒ + (y2โy1)ยฒ).
Worked example
(0,0) to (3,4)
- d
- x
- =
- 3
- ,
- d
- y
- =
- 4
- .
- d
- =
- s
- q
- r
- t
- (
- 9
- +
- 1
- 6
- )
- =
- 5
- .
Common mistakes to avoid
- Subtracting coordinates in the wrong order โ because the differences are squared, (x2-x1) squared equals (x1-x2) squared, so the order does not matter, but students sometimes panic and reorder mid-calculation inconsistently.
- Forgetting to take the square root at the end, leaving the answer as the squared distance rather than the actual distance.
- Using the distance formula in 3D without adding a third squared term โ if your points have z-coordinates you must include (z2-z1) squared.
Key terms
Frequently asked questions
- What does the distance formula have to do with the Pythagorean theorem?
- The horizontal separation (x2-x1) and vertical separation (y2-y1) form the two legs of a right triangle whose hypotenuse is the straight-line distance. Applying a squared + b squared = c squared gives the distance formula directly.
- Can I use this for GPS coordinates?
- Only for very short distances where the Earth's curvature is negligible. For geographic distances you should use the Haversine formula, which accounts for the spherical surface.
- What is the distance from a point to the origin?
- Set (x1, y1) = (0, 0). Then d = sqrt(x2 squared + y2 squared), which is also the magnitude of the position vector.