WorkedMathGlossary

Distance Formula Calculator

Enter two points below to instantly find the distance between them.

Distance
5
024602468(1, 2)(4, 6)

The Distance Formula

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

This is the Pythagorean theorem, a² + b² = c², relabeled for coordinates. The horizontal gap (x₂ − x₁) and vertical gap (y₂ − y₁) between the two points form the two legs of a right triangle, and the straight-line distance between the points is the hypotenuse.

Worked example

Points (1, 2) and (4, 6).

d = √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25

Distance = 5

A second example

Points (−3, 1) and (5, 7).

d = √((5 − (−3))² + (7 − 1)²) = √(8² + 6²) = √(64 + 36) = √100

Distance = 10

Keep going

  • Distance and midpoint both start from the same two coordinate points; the midpoint calculator finds the point exactly between them instead of how far apart they are. Midpoint Calculator

Frequently Asked Questions

What is the distance formula?

The distance between two points (x₁, y₁) and (x₂, y₂) is √((x₂ − x₁)² + (y₂ − y₁)²).

Where does the distance formula come from?

It's the Pythagorean theorem applied to coordinates — the horizontal and vertical gaps between the points form the two legs of a right triangle, and the distance is the hypotenuse.

Does the distance formula work in 3D?

This version is for 2D points. In 3D, you add a third term for the z-coordinates: √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²).

How do you find the midpoint between two points?

Average the x-coordinates and average the y-coordinates: midpoint = ((x₁ + x₂) / 2, (y₁ + y₂) / 2). For (1, 2) and (4, 6), the midpoint is (2.5, 4) — a companion calculation you'll often need alongside distance.

What's a common mistake with the distance formula?

It doesn't matter which point you call (x₁, y₁) and which you call (x₂, y₂) — squaring erases the sign either way. The real mistake is stopping at the sum of squares and forgetting the final square root, or subtracting an x-value from a y-value by accident.

Related Calculators

View all calculators →

Related Terms