Distance Formula Calculator
A distance formula calculator is a geometric tool used to find the Euclidean distance between two coordinate pairs on a Cartesian plane. It applies the Pythagorean theorem-based distance formula to compute the straight-line distance using the horizontal and vertical differences between the points. The tool delivers the final value in simplified radical form for mathematical precision, as well as decimal approximations for practical measurement. Students, land surveyors, and designers use it to map coordinates and verify dimensions.
Enter the coordinates of two points and we compute the straight-line distance between them. The result shows the horizontal and vertical changes, the squared differences, and the final distance, with the exact radical form when it lands on one.
Quick Answer
Calculate the straight-line distance between two points in a two-dimensional coordinate plane. Enter the coordinates of both points to see decimal and exact radical answers.
Coordinates
Enter two points (x₁, y₁) and (x₂, y₂).
e.g. 1
e.g. 2
e.g. 4
e.g. 6
Step by step
- 1. Identify the coordinates. x₁ = 1, y₁ = 2, x₂ = 4, y₂ = 6.
- 2. Subtract x coordinates. Δx = 4 − 1 = 3.
- 3. Subtract y coordinates. Δy = 6 − 2 = 4.
- 4. Square both differences. Δx² = 9, Δy² = 16.
- 5. Add the squared differences. 9 + 16 = 25.
- 6. Take the square root. d = √25 = 5.
d =
5
From (1, 2) to (4, 6)
The distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²) is the Pythagorean theorem applied to the right triangle whose legs are the horizontal and vertical changes between the two points.
Examples
(1, 2) and (4, 6)
d = 5
(0, 0) and (3, 4)
d = 5
(−2, 3) and (4, −5)
d = 10
(0, 0) and (1, 1)
d = √2 ≈ 1.4142
How it works
Formula · d = sqrt((x2 - x1)^2 + (y2 - y1)^2). This is c = sqrt(a^2 + b^2) with the two legs written as coordinate differences.
For any two points (x₁, y₁) and (x₂, y₂) on a coordinate plane, the distance between them is:
Distance · d = √((x₂ − x₁)² + (y₂ − y₁)²)
The horizontal change x₂ − x₁ and the vertical change y₂ − y₁ are the two legs of a right triangle whose hypotenuse is the distance you want. That is why this formula is just the Pythagorean theorem applied to coordinates.
What is the distance formula?
The distance formula is an algebraic tool used to find the shortest, straight-line distance between two points in a two-dimensional Cartesian coordinate system. It translates geometric length into numerical form using the coordinates of the endpoints.
How to find the distance between two points step-by-step
To calculate the distance between Point 1 (x₁, y₁) and Point 2 (x₂, y₂):
- Subtract x₁ from x₂ to find the horizontal distance (the "run").
- Subtract y₁ from y₂ to find the vertical distance (the "rise").
- Square both differences separately to make them positive numbers.
- Add the two squared values together.
- Take the square root of that sum to find the final distance.
The distance formula is the Pythagorean theorem
Not a resemblance, and not an application of a related idea. The two are the same statement written in different notation. Plot any two points, draw a horizontal line from one and a vertical line from the other, and they meet at a right angle. The horizontal leg is |x₂ − x₁|, the vertical leg is |y₂ − y₁|, and the straight line between your two points is the hypotenuse. Solving a² + b² = c² for c gives the distance formula, character for character. Anyone who can do one can already do the other.
The diagram shows a coordinate plane with the x-axis and y-axis drawn. Two points are marked, (1, 2) and (4, 6). A dashed horizontal leg runs from the first point across to x equals 4, a length of 3. A dashed vertical leg runs up from there to y equals 6, a length of 4. A small square marks the right angle where the two legs meet. The solid line joining the two points is the hypotenuse of that triangle. Because 3 squared plus 4 squared is 25, the distance is the square root of 25, which is 5.
Working a distance out by hand
The same pair of points, done longhand. The order of the two points never matters, because both differences get squared and squaring destroys the sign.
- Take the horizontal difference. 4 − 1 = 3.
- Take the vertical difference. 6 − 2 = 4.
- Square both and add them. 3² = 9, 4² = 16, and 9 + 16 = 25.
- Take the square root. √25 = 5, so the distance is exactly 5 units.
A whole number came out only because the legs were 3 and 4, one of the rare pairs that produces one. Most coordinate pairs do not, which is why the calculator also reports the exact radical form alongside the decimal.
Edge cases, and what the answer means
- The same point twice. Both differences are zero, so the distance is zero. That is a real answer, not an error.
- Negative coordinates. They work exactly like positive ones. From (−2, −3) to (1, 1) the differences are 3 and 4 again, giving 5 again. The common slip is dropping a minus sign while subtracting, not the squaring.
- Exact versus decimal. When the sum of squares is a whole number, the calculator shows the simplified radical as well as the decimal. From (0, 0) to (2, 3) the sum is 13, which has no square factor, so the exact answer stays √13 and the decimal 3.6056 is a rounding of it. From (0, 0) to (2, 2) the sum is 8, which does factor, so the exact answer tidies to 2√2.
- Two dimensions only. This calculator works in the plane. A third coordinate would need a third squared difference under the same root, and this tool does not accept one.
If what you actually have is a triangle rather than a pair of points, the right triangle calculator solves the whole shape, angles included, from any two known parts. This page answers one narrower question: how far apart two coordinates are.
Your coordinates stay in the page
Every coordinate you enter is processed by this page in your browser. The points and the distance are not sent to a server, not stored after you close the tab, and not visible to anyone else. There is no account and nothing to sign up for.
Worked example: Finding distance with negative coordinates
Let's find the distance between the points (−2, 3) and (4, −5):
- Label coordinates: x₁ = -2, y₁ = 3, x₂ = 4, y₂ = -5
- Find horizontal change: x₂ − x₁ = 4 − (−2) = 6
- Find vertical change: y₂ − y₁ = −5 − 3 = −8
- Square the changes: 6² = 36, and (−8)² = 64
- Sum the squares: 36 + 64 = 100
- Take the square root: √100 = 10
The distance between the two points is exactly 10.
Common mistakes when using the distance formula
- Incorrect handling of negative signs: Forgetting that subtracting a negative number results in addition, for instance writing
4 − (−2)as4 − 2 = 2instead of4 + 2 = 6. - Mixing up coordinates: Matching an x-coordinate with a y-coordinate during subtraction (e.g. computing
x₂ − y₁instead ofx₂ − x₁). - Forgetting the square root: Adding the squared differences and leaving the sum as the final answer without applying the final square root step.
- Adding before squaring: Summing the differences and then squaring the result, which yields the incorrect math
(x₂ - x₁ + y₂ - y₁)².
Related Calculators
More tools from Education



