Distance Calculator (Euclidean Coordinate Distance)

Calculate the shortest straight-line distance ($D$) between two points, $P_1$ and $P_2$, in a two-dimensional (2D) or three-dimensional (3D) coordinate system. Enter the coordinates of both points below.

Endpoints $P_1$ and $P_2$

Point

X-Coordinate

Y-Coordinate

Z-Coordinate (Optional)

P₁

P₂

Leave Z coordinates blank for a 2D calculation.

The Euclidean Distance Formula

The distance formula is a direct application of the Pythagorean Theorem in a coordinate system. It finds the length of the hypotenuse created by the differences in the $x$ and $y$ coordinates ($\Delta x$ and $\Delta y$).

Distance Formula (2D)

Given points $P_1(x_1, y_1)$ and $P_2(x_2, y_2)$, the distance $D$ is:

$$D = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$

Distance Formula (3D)

For three dimensions, the formula simply adds the difference in the $z$ coordinates:

$$D = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$$

Related Formula: Midpoint

The midpoint ($M$) is the coordinate point exactly halfway between the two endpoints. Since the calculation relies on the same input coordinates, this calculator provides it as a helpful related value:

$$M = \left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}, \dots \right)$$

Frequently Asked Questions (FAQ)

What is the Euclidean Distance Formula (2D)?

How does the distance formula relate to the Pythagorean Theorem?

What is the difference between Euclidean and Geodesic distance?

Can the distance calculator handle negative coordinates?