Distance Between Points Calculator

Enter the coordinates of two points, and find the straight-line distance between them using the distance formula.

Distance
5
d = √((x₂−x₁)² + (y₂−y₁)²)
Embed on your website →

How to use the distance between points calculator

  1. Enter the coordinates of the first point (x₁, y₁).
  2. Enter the coordinates of the second point (x₂, y₂).
  3. The distance between the points updates automatically as you type.

How does the distance formula work?

The distance formula builds directly on the Pythagorean theorem: the difference in x and the difference in y form the two legs of a right triangle, and the distance itself is the hypotenuse. The formula is d = √((x₂−x₁)² + (y₂−y₁)²).

A straight line on a plane — but not on a globe

The formula here calculates Euclidean distance: the shortest line between two points on a flat plane. That is correct for a map, a drawing, a coordinate system or a room. It is not correct for latitude and longitude, because the Earth is curved and degrees are not the same length everywhere.

A degree of latitude corresponds to roughly the same distance everywhere, but a degree of longitude shrinks the further from the equator you go — around 111 kilometres at the equator, less than half that at high latitudes. To calculate the distance between two geographic positions you therefore need a great-circle formula such as the haversine, not Pythagoras applied to the degree values.

Worked example: the distance from (0, 0) to (3, 4) is √((3 − 0)² + (4 − 0)²) = √25 = 5. The formula is Pythagoras in disguise: the differences in x and y are the legs of a right triangle, and the distance is the hypotenuse. The signs of the differences make no difference since they are squared — the distance from A to B is the same as from B to A.

Frequently asked questions

Why does the distance formula use a square root?

Because the formula is built on the Pythagorean theorem (a² + b² = c²) — we square the differences in x and y, add them together, and take the square root to find the actual straight-line distance (the hypotenuse).

Does this work for negative coordinates?

Yes, the formula works the same whether the coordinates are positive or negative — it's the difference between them that matters.

Can I use this for distance in 3D?

This calculator only works in two dimensions (x, y). In three dimensions, the formula extends with an extra z term: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²).

Embed this calculator on your website

Copy the code below to show this calculator directly on your blog or website — completely free.