Distance Calculator

Calculate the straight-line distance between two points.

The distance formula

The straight-line distance between two points comes from the Pythagorean theorem. In two dimensions it is √((x₂ − x₁)² + (y₂ − y₁)²). In three dimensions, add the z term under the root.

Examples

From (1, 2) to (4, 6) the horizontal change is 3 and the vertical change is 4, so the distance is 5. In 3D, from (1, 2, 3) to (4, 6, 15) the changes are 3, 4 and 12, which gives a distance of 13.

This is the distance on a flat plane or in space. It does not measure distances between places on Earth, which curve with the globe.

Frequently asked questions

Is this the same as driving distance?

No. It is the straight-line distance between coordinates, not a route.

Can coordinates be negative?

Yes. Negative values are fine, and the formula squares the differences.

Last updated