+Calculator+

Distance Formula Calculator

Find the distance between two points in 2D or 3D space, or sum a polyline path. Built on the Pythagorean theorem.

Choose a mode

Point 1 (x1, y1)

Point 2 (x2, y2)

Distance

5

2D space

dx

3

dy

4

Frequently Asked Questions about the Distance Formula Calculator

What is the distance formula?
It comes from the Pythagorean theorem: d = sqrt((x2 - x1)^2 + (y2 - y1)^2). The difference in x and y form the legs of a right triangle, and the distance is the hypotenuse.
How do you extend the formula to 3D?
Add a z-axis term: d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2). The same Pythagorean idea, applied twice.
What does polyline mode calculate?
It sums the straight-line distances between consecutive points, giving the total path length through every vertex in order.
Does the order of the two points matter?
No. The differences are squared, so reversing the points gives the same distance.
Can the result be negative?
No. Squaring removes signs and the square root returns a non-negative number, so distance is always zero or positive.