Distance Between Two Points Calculator

Straight-line distance between two coordinates, with the Manhattan alternative.

Distance
Adjust the inputs

Your result updates live as you type.

The distance formula is Pythagoras applied to a coordinate grid. The horizontal separation and the vertical separation form the two legs of a right triangle, and the straight-line distance between the points is the hypotenuse. The order of the points makes no difference, because both differences are squared.

Manhattan distance, the sum of the two separations without squaring, is the alternative worth knowing. It is what you actually travel on a street grid, and it is always at least as large as the straight-line distance — up to about 41% larger when the two points sit on a perfect diagonal. Routing software uses one or the other depending on whether movement is free or constrained to axes.

The formula

d = √((x2 − x1)2 + (y2 − y1)2)
x₁, y₁
Coordinates of the first point
x₂, y₂
Coordinates of the second point
Δx, Δy
The horizontal and vertical separations

How it works, step by step

  1. Enter the coordinates of the first point.
  2. Enter the coordinates of the second point.
  3. The gauge shows the straight-line distance.
  4. The separations, the Manhattan distance and the bearing appear below.

Worked examples

From (2, 3) to (10, 9)

The separations are 8 and 6, so the distance is the root of 64 + 36 = 10. The Manhattan distance is 14, which is 40% further.

A perfect diagonal

From the origin to (10, 10) the straight-line distance is 14.1421 but the Manhattan distance is 20. That ratio, 1.4142, is root two and is the largest the gap can ever be.

How to read your score

0–5Close togetherThe two points nearly coincide on this scale.
5–15Moderate separationA typical distance on a working grid.
15–50Far apartA large separation.
50–—Very far apartThe points are at opposite ends of the coordinate space.

Frequently asked questions

Does it matter which point I enter first?

No. Reversing the points flips the sign of both separations, but squaring removes the sign entirely. Only the reported bearing changes, by 180 degrees.

What is Manhattan distance?

The distance travelled when you can only move along the axes, like walking a street grid. It is the sum of the absolute separations and never smaller than the straight-line distance.

How do I extend this to three dimensions?

Add the square of the z separation before taking the root. The structure of the formula is identical.

Can I use this for latitude and longitude?

Only over very short distances. The Earth is curved and a degree of longitude shrinks towards the poles, so proper geographic work needs the haversine formula instead.

Distances from the origin

Straight-line and Manhattan distances from (0, 0)
PointStraight lineManhattanRatioBearing
(3, 4)5.000071.400053.13 deg
(5, 0)5.000051.00000.00 deg
(5, 5)7.0711101.414245.00 deg
(8, 6)10.0000141.400036.87 deg
(10, 2)10.1980121.176711.31 deg
(12, 5)13.0000171.307722.62 deg
(1, 9)9.0554101.104383.66 deg

The ratio column peaks at root two for a perfect diagonal and falls to one on an axis.

Related calculators