Quick Answer
The distance formula is d = √((x₂ − x₁)² + (y₂ − y₁)²). For the points (1, 2) and (4, 6), the differences are 3 and 4, so d = √(9 + 16) = √25 = 5. In 3D, add (z₂ − z₁)² under the square root.
Embed this calculator
Adjust the size if needed, then copy the code below into your page or blog. The calculator will load in an iframe and stay updated automatically.
Table of Contents
- Distance Formula Calculator
- Quick Answer
- Related Calculators
- How This Distance Formula Calculator Works
- How to Use the Distance Formula Calculator
- Core Formulas
- Key Terms
- Worked Example
- Real-Life Examples
- Distance Formula vs Pythagorean Theorem
- Common Distances
- Tips for Using the Formula
- Common Mistakes to Avoid
- Frequently Asked Questions
- References & Sources
How This Distance Formula Calculator Works
Choose 2D or 3D and enter the coordinates of two points. The calculator finds how far apart they are in a straight line. It shows the exact square root form, the decimal answer, the midpoint and each step.
Quick explanation: the distance formula is the Pythagorean theorem applied to coordinates.
- Δx and Δy: the horizontal and vertical gaps between the points.
- Exact form: the answer as a square root, before rounding.
- Midpoint: the point exactly halfway between them.
How to Use the Distance Formula Calculator
- Choose 2D for points on a flat graph, or 3D for points in space.
- Enter the coordinates of the first point.
- Enter the coordinates of the second point.
- Press Calculate.
- Read the distance, exact form and midpoint, then check the steps.
Core Formulas
- 2D distance: d = √((x₂ − x₁)² + (y₂ − y₁)²)
- 3D distance: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)
- Midpoint (2D): ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
Key Terms
- Coordinate: a number that gives a point’s position along an axis.
- Δ (delta): the change in a value, such as Δx = x₂ − x₁.
- Midpoint: the point exactly halfway between two points.
- Euclidean distance: the straight-line distance between two points.
Worked Example
Find the distance between (−2, 3) and (4, −5).
- Δx = 4 − (−2) = 6, Δy = −5 − 3 = −8
- d = √(6² + (−8)²) = √(36 + 64) = √100
- d = 10
- Midpoint = (1, −1)
Real-Life Examples
- A map grid: a park at (2, 1) km and a school at (7, 13) km are √(25 + 144) = 13 km apart in a straight line.
- A video game: a player at (10, 4) and an enemy at (13, 8) are 5 units apart, which can decide whether they are in range.
- A room in 3D: the corner-to-corner distance in a 12 × 9 × 8 ft room is √(144 + 81 + 64) = 17 ft.
- Geometry homework: checking that a triangle’s sides from its corner points are 3, 4 and 5 shows it is a right triangle.
Distance Formula vs Pythagorean Theorem
- Pythagorean theorem: a² + b² = c² for the sides of a right triangle.
- Distance formula: the same idea, using Δx and Δy as the two shorter sides and the distance as the long side.
- When to use which: use the distance formula when you have coordinates, and the theorem when you have side lengths.
Common Distances
| Point 1 | Point 2 | Distance |
|---|---|---|
| (0, 0) | (3, 4) | 5 |
| (1, 2) | (4, 6) | 5 |
| (0, 0) | (5, 12) | 13 |
| (-2, 3) | (4, -5) | 10 |
| (0, 0) | (1, 1) | 1.4142 |
| (2, 2) | (5, 5) | 4.2426 |
| (0, 0, 0) | (1, 2, 2) | 3 |
| (1, 1, 1) | (4, 5, 13) | 13 |
Tips for Using the Formula
- Order does not matter: squaring removes any minus sign.
- Watch negatives: subtracting a negative is the same as adding.
- Straight line only: it gives the shortest path, not a route along roads.
- Same units: both points must use the same scale.
Common Mistakes to Avoid
- Forgetting to square. Square each difference before adding.
- Adding the differences first. (3 + 4)² is not 3² + 4².
- Losing a minus sign. 4 − (−2) = 6, not 2.
- Forgetting the square root. √25 = 5, not 25.
- Mixing up x and y. Keep each pair of coordinates together.
Frequently Asked Questions
d = √((x₂ − x₁)² + (y₂ − y₁)²). It gives the straight-line distance between two points.
Subtract the x values and the y values, square both, add them, and take the square root.
No. Squaring makes every part positive, so distance is zero or more.
Add the squared change in z under the square root as well.
It is the Pythagorean theorem written with coordinates.
5, because √(3² + 4²) = √25.
Average the x values and the y values: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
No. You get the same distance either way.
Look for square factors. √50 = √(25 × 2) = 5√2, which is about 7.071.
Only on a flat grid. For places on Earth, the curve of the planet matters, so use a great-circle distance tool.
Use (0, 0) as one point. The distance is √(x² + y²).
It measures how similar two data points are, for example in nearest-neighbor methods.
References & Sources
| Source | Used For | Link |
|---|---|---|
| Wikipedia, Euclidean distance | The distance formula in 2D and 3D. | https://en.wikipedia.org/wiki/Euclidean_distance |
| Wikipedia, Pythagorean theorem | The basis of the formula. | https://en.wikipedia.org/wiki/Pythagorean_theorem |