Distance Between Two Points Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter the coordinates of two points (leave z at 0 for points in a plane) to get the distance between them.
Result
Distance
Δx = x₂ − x₁
- Δy = y₂ − y₁
- Δz = z₂ − z₁
- Midpoint x
- Midpoint y
- Midpoint z
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Point 1: x₁: enter a number.
- Point 1: y₁: enter a number.
- Point 1: z₁ (0 for 2D): enter a number.
- Point 2: x₂: enter a number.
- Point 2: y₂: enter a number.
- Point 2: z₂ (0 for 2D): enter a number.
- Read the result: Distance; the panel also shows Δx = x₂ − x₁, Δy = y₂ − y₁, Δz = z₂ − z₁, Midpoint x, Midpoint y and Midpoint z.
How this calculator works
The distance formula comes from the Pythagorean theorem: d = √((x₂ − x₁)² + (y₂ − y₁)²) in the plane, and d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²) in space.
The midpoint is the average of the coordinates: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2, (z₁ + z₂) ÷ 2). The distance is in the same unit as the coordinates.
The formula
| Symbol | Meaning |
|---|---|
| Point 1: x₁ | |
| Point 1: y₁ | |
| Point 1: z₁ (0 for 2D) | |
| Point 2: x₂ | |
| Point 2: y₂ | |
| Point 2: z₂ (0 for 2D) | |
| Distance |
Worked example
| Point 1: x₁ | 1 |
|---|---|
| Point 1: y₁ | 2 |
| Point 1: z₁ (0 for 2D) | 0 |
| Point 2: x₂ | 4 |
| Point 2: y₂ | 6 |
| Point 2: z₂ (0 for 2D) | 0 |
| Δx = x₂ − x₁ | 3 |
|---|---|
| Δy = y₂ − y₁ | 4 |
| Δz = z₂ − z₁ | 0 |
| Midpoint x | 2.5 |
| Midpoint y | 4 |
| Midpoint z | 0 |
Distance 5
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the distance between (1, 2) and (4, 6)?
√(3² + 4²) = √25 = 5.
Does the order of the points matter?
No. The differences are squared, so swapping the points gives the same distance.
How do you find the distance in 3D?
Add the squared z difference under the square root: from (0, 0, 0) to (1, 2, 2) the distance is √9 = 3.