Distance Between Two Points Calculator

Enter two points to get the straight-line (Euclidean) distance between them.

Distance-
Squared-

The distance formula

The distance formula is the Pythagorean theorem applied to coordinates: d = √((x2 - x1)² + (y2 - y1)²). The horizontal gap and the vertical gap are the two legs of a right triangle, and the distance is its hypotenuse. For example, from (1, 1) to (4, 5) the gaps are 3 and 4, so d = √(9 + 16) = √25 = 5.

Worked examples

Point 1Point 2Distance
(0, 0)(3, 4)5
(1, 1)(4, 5)5
(0, 0)(5, 12)13
(-2, 3)(4, -5)10
(2, 2)(5, 6)5

FAQ

What is the distance formula?

d = √((x2 - x1)² + (y2 - y1)²). It gives the straight-line distance between two points on a plane.

How is the distance formula related to the Pythagorean theorem?

It is the same thing. The differences in x and y are the two legs of a right triangle, and the distance between the points is the hypotenuse c in a² + b² = c².

Does the order of the points matter?

No. Squaring removes the sign, so the distance from A to B equals the distance from B to A.

Can I use this for latitude and longitude?

Not accurately over long distances. The Earth is curved, so GPS coordinates need the haversine formula; the flat distance formula is only a rough guess over a few kilometres.

See also: slope calculator · midpoint calculator · pythagorean theorem calculator · all tools