Distance between two points calculator
Enter both points. Leave both z values empty for a 2D distance, or fill them in for 3D.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter x1, y1, z1 (optional), x2, y2 and z2 (optional).
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
d = √((x2 - x1)² + (y2 - y1)²) in 2D, adding (z2 - z1)² under the root in 3D. It comes from the Pythagorean theorem.
Example
Inputs: x1 = 1, y1 = 2, x2 = 4, y2 = 6. Result: Distance d: 5; Δx: 3; Δy: 4.
Limits and caveats
- Gives straight-line (Euclidean) distance, not distance over the Earth between map coordinates.
- The unit is whatever unit the coordinates use.
Questions about this tool
Can I use it for the distance between two cities?
No. Latitude and longitude sit on a sphere and need the great-circle formula; this tool is for flat coordinates.
How does it relate to Pythagoras?
Δx and Δy are the legs of a right triangle and the distance is the hypotenuse: d² = Δx² + Δy².
Does the order of the points matter?
No. The differences are squared, so the distance is the same.
