Distance between two points
Find the straight-line (Euclidean) distance between two points on a coordinate plane. It is a staple of geometry homework, graphics and game programming, surveying and any task that needs the shortest gap between two (x, y) locations.
How it works
The distance formula is the Pythagorean theorem applied to the horizontal and vertical gaps between the points:
distance = √((x₂ − x₁)² + (y₂ − y₁)²)
The horizontal difference (Δx) and vertical difference (Δy) form the two legs of a right triangle, and the distance is the hypotenuse. Because each difference is squared, the order of the points and any negative coordinates never change the result — the distance is always a positive number.
Example
The distance between (0, 0) and (3, 4):
Δx = 3 − 0 = 3, Δy = 4 − 0 = 4 distance = √(3² + 4²) = √(9 + 16) = √25 = 5
This is the classic 3-4-5 right triangle, one of the most recognisable examples in geometry. Other point pairs can produce the same distance while lying in completely different positions on the plane:
| Point 1 | Point 2 | Δx | Δy | Distance |
|---|---|---|---|---|
| (0, 0) | (3, 4) | 3 | 4 | 5 |
| (1, 1) | (4, 5) | 3 | 4 | 5 |
| (−2, −3) | (1, 1) | 3 | 4 | 5 |
| (0, 0) | (5, 12) | 5 | 12 | 13 |
Practical applications
Geometry homework: The formula appears in every coordinate-geometry unit, from finding the length of a triangle’s sides to verifying whether a quadrilateral is a square.
2D game and graphics programming: Collision detection, pathfinding, and camera range checks all use the Euclidean distance formula to test whether two objects are within a certain radius of each other.
Surveying and GIS (small areas): For short distances on a flat map projection, the Cartesian formula gives a reliable approximation. For large geographic distances on a curved Earth, the haversine formula is more accurate.
Data science (feature space): k-nearest-neighbours, k-means clustering, and many other algorithms define proximity between data points using this same Euclidean measure.
What this calculator does not do
This tool computes the straight-line distance — the crow-flies path with no obstacles. It does not calculate driving distances, walking routes, or distances along a curve. For latitude/longitude coordinates over large areas, use a haversine or Vincenty calculator instead, because treating degrees as flat-plane units introduces meaningful error at distances above a few kilometres.
Everything is computed in your browser — nothing is uploaded.