AbraCalc

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.

Embed this tool on your site

How to use this tool

  1. Enter x1, y1, x2 and y2 in the fields above.
  2. Results update instantly as you type โ€” or click Calculate.
  3. 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)

  1. d
  2. x
  3. =
  4. 3
  5. ,
  6. d
  7. y
  8. =
  9. 4
  10. .
  11. d
  12. =
  13. s
  14. q
  15. r
  16. t
  17. (
  18. 9
  19. +
  20. 1
  21. 6
  22. )
  23. =
  24. 5
  25. .

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.

References & sources