webby.tools

Distance Between Two Points Calculator

Enter the coordinates of two points and find the straight-line distance between them, with step-by-step work and a plotted diagram.

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

The Distance Formula

The distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is found using the Pythagorean theorem. The horizontal difference is $(x_2 - x_1)$ and the vertical difference is $(y_2 - y_1)$ — these form the legs of a right triangle, with the distance as the hypotenuse.

$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$

Step-by-Step Example

Find the distance between $(1, 2)$ and $(4, 6)$.

Step 1 — Write the formula:

$$d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$

Step 2 — Substitute the coordinates:

$$d = \sqrt{(4 - 1)^2 + (6 - 2)^2}$$

Step 3 — Subtract inside the parentheses:

$$d = \sqrt{3^2 + 4^2}$$

Step 4 — Square each difference:

$$d = \sqrt{9 + 16}$$

Step 5 — Add and take the square root:

$$d = \sqrt{25} = 5$$

Where Does the Formula Come From?

Draw a right triangle with the two points at two corners and a right angle at the third corner $(x_2, y_1)$. The legs have lengths $|x_2 - x_1|$ and $|y_2 - y_1|$. By the Pythagorean theorem, the hypotenuse (our distance) satisfies:

$$d^2 = (x_2 - x_1)^2 + (y_2 - y_1)^2$$

Taking the square root gives the distance formula.

Special Cases

Situation Distance
Both points are the same $d = 0$
Same y-coordinate (horizontal line) $d = |x_2 - x_1|$
Same x-coordinate (vertical line) $d = |y_2 - y_1|$

Frequently Asked Questions

Does it matter which point is (x₁, y₁) and which is (x₂, y₂)?

No — distance is symmetric. Swapping the labels gives the same result because the differences are squared, making any negative values positive.

Can I use this for 3D points?

For three-dimensional distance, add a third term: $d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2}$.

What is the midpoint between two points?

The midpoint is the point exactly halfway between them: $M = \left(\frac{x_1+x_2}{2},\ \frac{y_1+y_2}{2}\right)$.

This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.