Skip to content

Distance Calculator

Find the straight-line distance, the midpoint and the Manhattan distance between two points on a plane or in three-dimensional space.

Formulas last reviewed: September 2026

Disclaimer: Results are calculated with standard formulas and are meant for learning and quick checks. Please double-check important work, especially anything used for exams, engineering, finance or safety.

The straight line between two points

The distance between two points is the length of the straight line joining them. On a flat plane it comes from the Pythagorean theorem, and in three-dimensional space it adds a third term for height.

Enter the coordinates and this calculator returns the straight-line (Euclidean) distance, the midpoint and the Manhattan distance, which is how far you would travel if you could only move along the axes, like along city blocks.

How it is calculated

2-D: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3-D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)

Worked example

From (1, 2) to (7, 10)

Differences
6 across and 8 up
Distance
10
Midpoint
(4, 6)
Manhattan distance
14

Good to know

  • This tool works with coordinates on a grid, not with latitude and longitude on the Earth's curved surface.
  • The distance is the same in either direction and is never negative.
  • A point's distance from the origin uses the same formula with (0, 0).

Frequently asked questions

Can I use it for cities on a map?

Not directly. Latitude and longitude need a great-circle formula. This calculator is for flat x and y coordinates.

What is the Manhattan distance?

It is the sum of the absolute differences in each coordinate, the distance if you can only move along the axes.

How do I find the midpoint?

Average the x-values and average the y-values. The calculator shows it for you.

Is the 3-D formula different?

It is the same idea with one more squared difference, for the z coordinate, under the square root.