Distance Formula Calculator

ALGEBRA
ddistance = 5
Point 1
Point 2
Distance
Δx
Δy
Δz
Midpoint

Straight-line distance between two points

The distance formula is the Pythagorean theorem in disguise: it finds the straight-line gap between two points from their coordinates. This calculator handles both 2D and 3D — leave the z values at zero for a flat plane, or fill them in for space — and also returns the midpoint.

The formula

In 2D, distance = the square root of ((x₂ – x₁) squared + (y₂ – y₁) squared). In 3D, add the z term: distance = square root of (Δx squared + Δy squared + Δz squared). The differences Δx, Δy and Δz are just the leg lengths of a right triangle (or box), and the distance is its hypotenuse (or diagonal).

Why it works

Each coordinate difference is one perpendicular leg. Squaring, summing and rooting them is exactly the Pythagorean theorem extended to as many dimensions as you have, which is why the same pattern keeps appearing.

Related algebra tools

For the point halfway along, use the midpoint calculator; for the steepness of the connecting line, the slope calculator.

Worked example

From (1, 2) to (4, 6): Δx = 3 and Δy = 4, so the distance is the square root of (9 + 16) = the square root of 25 = 5 — the classic 3-4-5 right triangle.

FAQ

Do I have to use z?

No — leave both z values at zero and the tool computes the ordinary 2D distance. The z term simply vanishes.

Is distance ever negative?

Never. Squaring the differences removes any sign, so distance is always zero or positive regardless of point order.

Related reference chart: Coordinate Plane Reference
Spotted an error or have a suggestion for this calculator? Let us know →
Scroll to Top

The calculators and tools on Formula Factory are provided for general guidance and informational purposes only. Results are estimates based on standard formulas and the values you enter — they do not constitute professional engineering, electrical, or architectural advice. Always verify calculations with a qualified professional before making decisions for any safety-critical, code-compliance, or commercial application. Formula Factory makes no representations or warranties as to the accuracy or completeness of any result, and accepts no liability for errors, omissions, or any outcomes arising from reliance on this information.