Distance Formula Calculator

Enter the coordinates of two points to calculate the straight-line distance and midpoint between them.

Last updated: September 5, 2026

Frequently asked questions

What is the distance formula?

d = √((x₂-x₁)² + (y₂-y₁)²) - it finds the straight-line distance between two points (x₁,y₁) and (x₂,y₂) on a coordinate plane.

How is the distance formula related to the Pythagorean theorem?

It's the same theorem applied to coordinates - the horizontal difference (Δx) and vertical difference (Δy) between the two points form the two legs of a right triangle, and the distance between the points is the hypotenuse.

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

5 - Δx = 4-1 = 3, Δy = 6-2 = 4, so d = √(3² + 4²) = √(9+16) = √25 = 5.

How do I find the midpoint between two points?

Average the x-coordinates and average the y-coordinates separately: midpoint = ((x₁+x₂)/2, (y₁+y₂)/2). For (1,2) and (4,6), the midpoint is (2.5, 4).

Can the distance formula give a negative result?

No - distance is always zero or positive because the formula squares the differences (removing any negative sign) before taking a square root, which by convention returns the non-negative root.

Does this work for points in 3D space?

This calculator handles 2D coordinate pairs only, but the same idea extends to 3D by adding a z-term: d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²).

What if both points are the same?

The distance is 0 - if (x1,y1) equals (x2,y2), then Δx and Δy are both 0, so d = √(0² + 0²) = 0, correctly indicating there's no separation between the points.

Calculate