Distance Calculator

Calculate the Euclidean distance between two points in 2D or 3D space, plus midpoint and Manhattan distance.

Points

Point 1
Point 2
Distance
5
FormulaExpression
2D Distance√((x₂−x₁)² + (y₂−y₁)²)
3D Distance√((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)
Manhattan (2D)|x₂−x₁| + |y₂−y₁|
Midpoint (2D)((x₁+x₂)/2, (y₁+y₂)/2)

Results

MeasurementValue
Euclidean Distance5
Manhattan Distance7
Midpoint(2.5, 4)
Δx (horizontal)3
Δy (vertical)4
Euclidean
5
Manhattan
7

Distance Types

TypeAlso known asDescription
EuclideanStraight-lineShortest path between two points
ManhattanTaxicab / City blockSum of absolute differences
ChebyshevChessboardMaximum of absolute differences

Distance between two points is not the x difference plus the y difference. That total is a different measure, called Manhattan or taxicab distance, and it overstates the straight-line gap. For (1, 2) and (4, 6) the sum is 7, but the true distance is 5. This calculator reports both, in 2D or 3D, along with the midpoint and each coordinate difference.

Euclidean versus Manhattan on one pair of points

Start with the page defaults, (1, 2) and (4, 6) in 2D. The Euclidean distance is 5, the Manhattan distance is 7, the midpoint is (2.5, 4), Δx is 3 and Δy is 4.

Here is where each figure comes from. Δx = 4 − 1 = 3 and Δy = 6 − 2 = 4 are the two legs of an imaginary right triangle. The straight-line distance is its hypotenuse, d = √(Δx² + Δy²) = √(9 + 16) = √25 = 5. Manhattan distance walks along both legs instead, |Δx| + |Δy| = 3 + 4 = 7. The midpoint averages each coordinate: ((1 + 4) / 2, (2 + 6) / 2) = (2.5, 4).

Switch to 3D and the pattern gains a third term. With z₁ = 0 and z₂ = 3, d = √(9 + 16 + 9) = √34 = 5.83095189, the Manhattan distance is 3 + 4 + 3 = 10, and the midpoint is (2.5, 4, 1.5). Results are rounded to eight decimals.

A quick sanity rule helps when a result looks odd. The Euclidean distance can never exceed the Manhattan distance, and in 2D it equals it only when the two points share an x value or a y value, so the path is already a straight horizontal or vertical run. In the other extreme, a 45-degree diagonal makes the Manhattan figure about 1.41 times the Euclidean one.

How to Use This Calculator

  1. Choose 2D or 3D with the tabs at the top.
  2. Enter x and y for Point 1 and Point 2, and z as well if you are in 3D.
  3. Read the Euclidean distance in the large box. The table also shows Manhattan distance, midpoint and the differences.
  4. Change any coordinate to see the answer update immediately.
  5. Negative coordinates are allowed. The order of the two points does not change the distance.

Frequently Asked Questions

Can I use this for latitude and longitude?

Not for anything beyond a few kilometres. Degrees are angles on a sphere, and a degree of longitude shrinks as you move away from the equator, while a degree of latitude stays near 111 km. Use a great-circle method instead.

Why did the answer change when I switched to 3D without typing anything?

The z fields are prefilled with 0 and 3, and in 2D they are hidden and ignored. Switching to 3D uses them, so the default distance jumps from 5 to 5.83095189. Clear or change them first.

Is the Manhattan figure really two-dimensional?

The formula table labels it 2D, but in 3D mode the page adds the |Δz| term as well, so the default pair gives 10. The Chebyshev distance listed in the reference table is not computed, but you can read it as the largest of the Δ rows.

What units does the result use?

The same units you typed, with no conversion. If your coordinates come from a map with a scale, such as 1 cm for 500 m, multiply the answer by the scale yourself.

Which one should I use for a delivery route or a cable run?

It depends on how movement is constrained. A drone or a laser line follows the Euclidean figure. A cable run along walls, or a courier on a street grid, is closer to Manhattan distance, though real routes are usually longer than either because of obstacles. Neither number includes slopes, bends or slack.