Distance Calculator

Calculate Euclidean distance between two coordinate points.

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Euclidean Distance (d)
5
d = √((3-0)² + (4-0)²) = 5

Pythagoras on a coordinate grid

The distance formula is the Pythagorean theorem wearing coordinates. Two points form the opposite corners of a right triangle whose legs are the horizontal gap x₂ − x₁ and the vertical gap y₂ − y₁, so the straight-line distance is√((x₂ − x₁)² + (y₂ − y₁)²). There is nothing new to learn beyond recognising the triangle.

Because both differences are squared, the order of the points is irrelevant — any sign disappears. In three dimensions the pattern simply extends to√(Δx² + Δy² + Δz²). The midpoint, by contrast, is just the average of each coordinate.

This is Euclidean distance, and it is not always the right one. Manhattan distance — |Δx| + |Δy| — measures travel restricted to a grid, which is closer to reality for city streets. And over long distances on Earth, straight-line coordinate distance is simply wrong, because the surface is curved; great-circle calculations using the haversine formula are what navigation actually uses.

Frequently Asked Questions

What is the 2D Euclidean distance formula?

d = √((x₂ - x₁)² + (y₂ - y₁)²).

What is the 3D distance formula?

d = √((x₂ - x₁)² + (y₂ - y₁)² + (z₂ - z₁)²).

How is the distance between two points calculated?

In the plane, by the Pythagorean theorem: sqrt((x2-x1)^2 + (y2-y1)^2). In three dimensions a z term is added under the same square root. This is Euclidean distance, the straight-line measure.

How is distance measured on the Earth's surface?

With the haversine formula, which computes great-circle distance on a sphere and is accurate to about 0.5% since the Earth is slightly oblate. For higher precision, Vincenty's formulae work on an ellipsoid. Neither gives driving distance, which follows roads and is always longer.