Loading calculator...
- Finds the distance between two points in 2D or 3D.
- Gives the exact answer in radical form, such as 6√2, and as a decimal.
- Also shows Δx, Δy, the midpoint and the slope.
- Shows each step of the distance formula.
How to use the distance formula calculator
Choose 2D or 3D
Use 3D when your points have a z coordinate.
Enter point 1
Its x₁ and y₁ (and z₁) values.
Enter point 2
Its x₂ and y₂ (and z₂) values.
Read the distance
See the decimal and exact form with the working.
The distance formula
The distance formula comes from the Pythagorean theorem. The horizontal and vertical gaps between the points are the two legs of a right triangle, and the distance is its hypotenuse.
Distance formulas
2D: d = √((x₂ − x₁)² + (y₂ − y₁)²)
3D: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
Example 1: (1, 2) and (4, 6)
A 3-4-5 triangle.
- Δx, Δy 3, 4
- Square and add 9 + 16 = 25
- Distance √25 = 5
Example 2: exact radical answers
When the result is not a whole number.
- (1, 2) to (2, 3) √2 ≈ 1.414214
- (0, 0) to (6, 6) 6√2 ≈ 8.485281
Example 3: 3D distance
(1, 2, 3) and (4, 6, 15)
- Δx, Δy, Δz 3, 4, 12
- Square and add 9 + 16 + 144 = 169
- Distance 13
Where the distance formula is used
Geometry homework
Find side lengths and check shapes on a grid.
Maps and games
Measure straight-line distance between coordinates.
Physics
Find displacement between two positions.
3D design
Measure between points in space.
Find the middle of a segment with the midpoint calculator, the steepness with the slope calculator, or triangle sides with the Pythagorean theorem calculator.
Distance formula calculator FAQ
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²). It gives the straight-line distance between two points.
How is the distance formula related to Pythagoras?
The differences in x and y are the legs of a right triangle, and the distance is the hypotenuse, so a² + b² = c².
Can the distance be negative?
No. Squaring removes negative signs, so distance is always 0 or more.
How do you find distance in 3D?
Add the squared z difference: d = √(Δx² + Δy² + Δz²).
What is the distance between (1, 2) and (4, 6)?
It is 5, because √(3² + 4²) = √25 = 5.
Does the order of the points matter?
No. Swapping the points changes the signs of the differences, but their squares stay the same.