Enter Coordinates

Point 1

Point 2

Distance
0

Additional Values

Midpoint-
Slope-
Δx (horizontal)-
Δy (vertical)-

Distance & Related Formulas

2D Distance Formula

d = √[(x₂ − x₁)² + (y₂ − y₁)²]

3D Distance Formula

d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]

Midpoint

M = ( (x₁+x₂)/2 , (y₁+y₂)/2 )
3D: also (z₁+z₂)/2

Slope (2D only)

m = (y₂ − y₁) ÷ (x₂ − x₁)

Undefined when x₂ = x₁ (vertical line)

Worked Example

Distance between (2, 3) and (8, 7):

d = √[(8−2)² + (7−3)²]
d = √[36 + 16]
d = √52 ≈ 7.2111

Frequently Asked Questions

In 2D, the distance between points (x₁,y₁) and (x₂,y₂) is d = √[(x₂-x₁)² + (y₂-y₁)²]. In 3D, it extends to d = √[(x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²]. The formula comes directly from the Pythagorean theorem - the distance is the hypotenuse of a right triangle formed by the differences in each coordinate.
The midpoint is the average of each coordinate: Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2). For 3D, also average the z coordinates. For example, the midpoint of (2,3) and (8,7) is ((2+8)/2, (3+7)/2) = (5,5).
Slope = (y₂-y₁) ÷ (x₂-x₁), often described as 'rise over run'. A positive slope goes up from left to right, a negative slope goes down, a slope of 0 is a horizontal line, and a vertical line has an undefined slope (because x₂-x₁ = 0, which would mean dividing by zero).
Squaring the coordinate differences ensures the result is always positive regardless of which point you subtract from which, and it's what the Pythagorean theorem requires (a² + b² = c²). The square root then converts the squared total back into the actual straight-line distance.

Distance Between Two Points Calculator - 2D & 3D Coordinate Geometry

The distance formula is one of the most widely used tools in coordinate geometry, appearing everywhere from high school algebra homework to computer graphics, navigation systems, and physics simulations. It calculates the straight-line ("Euclidean") distance between any two points, and this calculator handles both 2D and 3D coordinates while also showing the midpoint and slope.

2D formula: d = √[(x₂−x₁)² + (y₂−y₁)²]
Quick example: Distance from (2,3) to (8,7) = √52 ≈ 7.2111

Where the Formula Comes From

The distance formula is really just the Pythagorean theorem in disguise. If you draw a right triangle where the horizontal leg is the difference in x-coordinates and the vertical leg is the difference in y-coordinates, then the straight-line distance between the two points is the hypotenuse. Since a² + b² = c², the distance is √(a² + b²) - exactly what the distance formula computes. Extending to 3D simply adds a third squared term for the z-axis difference.

Related Values This Calculator Also Finds

  • Midpoint: The exact center point between the two coordinates, found by averaging each coordinate pair.
  • Slope (2D only): The steepness of the line connecting the points, calculated as rise over run. A vertical line has an undefined slope.
  • Δx and Δy: The horizontal and vertical differences between the points, useful for understanding direction as well as distance.

How this calculator works, and where the numbers come from

The Distance Between Points applies the standard formula for this calculation to the values you enter and updates the result as you type. The calculation itself happens in your browser, and the page explains the method so you can check any result by hand.

Please note: Results are provided for general information and are calculated from the values you enter.

Sources and further reading

Last reviewed: by the CalcQube Editorial Team. See our editorial policy for how we build and check calculators, or report an error.