What Is the Distance Calculator?
This calculator finds the straight-line (Euclidean) distance between two points on a flat, two-dimensional coordinate plane. Given the coordinates of point A, \((x_1, y_1)\), and point B, \((x_2, y_2)\), it returns the shortest distance separating them — the length of the line segment that joins them. It works with any real numbers, including negative coordinates and decimals.
How to Use It
Enter the X and Y coordinates of your first point, then the X and Y coordinates of your second point. Click calculate to instantly see the distance, along with the horizontal change (\(\Delta x\)) and vertical change (\(\Delta y\)) used in the computation. The result is expressed in the same units as your coordinates.
The Formula Explained
The distance formula is a direct application of the Pythagorean theorem. The horizontal leg of a right triangle is \(\Delta x = x_2 - x_1\) and the vertical leg is \(\Delta y = y_2 - y_1\). The distance is the hypotenuse:
$$d = \sqrt{\left(x_2 - x_1\right)^2 + \left(y_2 - y_1\right)^2}$$
Because the differences are squared, the order in which you subtract the points does not affect the result.
Worked Example
Suppose point A is \((1, 2)\) and point B is \((4, 6)\). Then \(\Delta x = 4 - 1 = 3\) and \(\Delta y = 6 - 2 = 4\). Squaring and adding: $$3^2 + 4^2 = 9 + 16 = 25.$$ Taking the square root gives \(d = \sqrt{25} = 5\). So the two points are 5 units apart — a classic 3-4-5 right triangle.
FAQ
Does the order of the points matter? No. Squaring each difference removes the sign, so (A to B) equals (B to A).
Can I use negative coordinates? Yes. Negative values are handled correctly; only the differences and their squares affect the answer.
What units does the result use? The distance is in whatever unit your coordinates are measured in — meters, pixels, miles, or unitless grid squares.