Calculate the Euclidean distance between two points in 2D or 3D space, plus midpoint and Manhattan distance.
| Formula | Expression |
|---|---|
| 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) |
| Measurement | Value |
|---|---|
| Euclidean Distance | 5 |
| Manhattan Distance | 7 |
| Midpoint | (2.5, 4) |
| Δx (horizontal) | 3 |
| Δy (vertical) | 4 |
| Type | Also known as | Description |
|---|---|---|
| Euclidean | Straight-line | Shortest path between two points |
| Manhattan | Taxicab / City block | Sum of absolute differences |
| Chebyshev | Chessboard | Maximum 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.
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.
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.
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.
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.
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.
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.