Distance Calculator: Distance Between Two Points

This distance calculator finds the straight-line distance between two points on a graph using the distance formula, d = √((x2 − x1)² + (y2 − y1)²). Enter the coordinates to get the answer with steps. For road trips or running routes, use a map app instead.

Distance Calculator

Euclidean Distance

-

Δx, Δy

-

Manhattan Distance

-

This distance calculator finds the straight-line distance between two points on a coordinate plane or in 3D space. Along with the Euclidean distance, it shows the change in each coordinate and the Manhattan (grid) distance, with a chart of the points.

How to use the Distance Calculator

  1. Choose 2D (x, y) or 3D (x, y, z) in Dimensions.
  2. Enter Point 1 (x₁, y₁, plus z₁ in 3D) and Point 2 (x₂, y₂, plus z₂). Negative numbers and decimals are fine.
  3. Press Calculate Distance.
  4. Read the Euclidean Distance, the coordinate differences (Δx, Δy, Δz) and the Manhattan Distance. In 2D, the chart plots both points and the segment between them.

Formula

2D: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Manhattan: |Δx| + |Δy| (+ |Δz|)

The distance formula is the Pythagorean theorem applied to the coordinate differences. Manhattan distance adds up the moves along each axis, like walking city blocks instead of cutting diagonally.

Example

From (1, 2) to (4, 6): Δx = 3 and Δy = 4, so d = √(9 + 16) = √25 = 5, and the Manhattan distance is 3 + 4 = 7. In 3D, from (0, 0, 0) to (1, 2, 2): d = √(1 + 4 + 4) = 3.

Frequently asked questions

What is the distance formula?

d = √((x₂ − x₁)² + (y₂ − y₁)²). Subtract the coordinates, square each difference, add them, and take the square root. It comes straight from the Pythagorean theorem.

What is the difference between Euclidean and Manhattan distance?

Euclidean distance is the straight line between two points. Manhattan distance is the total of the horizontal and vertical moves, as if you could only travel along a grid. Manhattan distance is always equal to or larger than Euclidean distance.

Does the order of the points matter?

No. Swapping the points flips the sign of Δx and Δy, but squaring removes the sign, so the distance is the same either way.

Can this calculate the distance between two cities?

Not directly. It measures distance on a flat coordinate grid, in whatever units your coordinates use. Latitude and longitude sit on a curved Earth and need a different formula, such as the haversine formula.

To get the slope and line equation through two points, use the Slope Calculator.

Distance between two points with the formula

How to use it

  1. Enter the first point (x1, y1).
  2. Enter the second point (x2, y2).
  3. Read the distance and the steps.
  4. Use the midpoint and slope if your problem asks for them too.

More questions

What is the distance between (1, 2) and (4, 6)?

5. The changes are 3 and 4, and √(9 + 16) = 5.

Is the distance formula the same as the Pythagorean theorem?

Yes. It applies a² + b² = c² to the horizontal and vertical changes.

Can distance be negative?

No. Distance is always zero or positive.

Related tools: Speed Distance Time Calculator, Slope Calculator, Pythagorean Theorem Calculator.