ConvertThemAll

Distance calculator

The straight-line distance between two points on a plane or in space.

Formula Geometry

Distance

Distance: 5

Exact form
5
Δx
3
Δy
4
Step by step
  1. d = √(3² + 4²) = √25

How it works

The distance formula is Pythagoras’ theorem applied to the differences between the coordinates. In 2D the differences in x and y are the legs of a right triangle and the distance is its hypotenuse.

In 3D the same idea adds the difference in z. With whole-number coordinates the distance is also shown as an exact surd.

Formula

d = √((x₂ − x₁)² + (y₂ − y₁)²)
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)

Worked example

From (1, 2) to (4, 6): Δx = 3, Δy = 4, so d = √(9 + 16) = √25 = 5. From (0, 0) to (3, 3) the distance is √18 = 3√2 ≈ 4.242640687.

Questions people ask

Can I use this for map distances?

Only over short distances on a flat map. For places on the Earth, use a great-circle formula, as the surface is curved.

Does the order of the points matter?

No. The differences are squared, so swapping the points gives the same distance.

What is Euclidean distance?

The ordinary straight-line distance this calculator gives, as opposed to, for example, the city-block distance |Δx| + |Δy|.