# Three-Dimensional Distance Calculator

URL: https://speedycalculator.com/calculators/math/3d-distance/
Last updated: 2026-10-30

> The 3D distance calculator finds the straight-line distance between two points (x₁, y₁, z₁) and (x₂, y₂, z₂) in space, with the coordinate differences and the midpoint.

## Inputs

- X₁
- Y₁
- Z₁
- X₂
- Y₂
- Z₂

## Results

- Distance D
- Δx
- Δy
- Δz
- Midpoint – x
- Midpoint – y
- Midpoint – z

## Formula

```
D = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
```

## Explanation

The 3D distance formula extends the Pythagorean theorem to space: drone flight paths, the length of a diagonal brace, distances between atoms or between objects in a 3D model.

### How to use the Three-Dimensional Distance Calculator

- **X₁**
- **Y₁**
- **Z₁**
- **X₂**
- **Y₂**
- **Z₂**

Results update as you type, and everything is calculated in your browser.

### How it works

Square the differences in each coordinate, add them and take the square root.

### Inputs explained

FieldWhat to enterX₁A numberY₁A numberZ₁A numberX₂A numberY₂A numberZ₂A number

### What each result means

- **Distance D** = sqrt(([X₂] - [X₁])^2 + ([Y₂] - [Y₁])^2 + ([Z₂] - [Z₁])^2)
- **Δx** = [X₂] - [X₁]
- **Δy** = [Y₂] - [Y₁]
- **Δz** = [Z₂] - [Z₁]
- **Midpoint – x** = ([X₁] + [X₂])÷2
- **Midpoint – y** = ([Y₁] + [Y₂])÷2
- **Midpoint – z** = ([Z₁] + [Z₂])÷2

### Example values

How the main result changes when **X₁** changes and everything else stays at the example values above:

X₁Distance D0.513.12440.7513.061131.2512.94461.512.8938212.8062

## Worked example

Inputs — X₁: 1; Y₁: 2; Z₁: 3; X₂: 4; Y₂: 6; Z₂: 15.

Results — **Distance D = 13**; Δx = 3; Δy = 4; Δz = 12; Midpoint – x = 2.5; Midpoint – y = 4; Midpoint – z = 9.

## Key terms

- **Euclidean distance**: Straight-line distance.

## FAQ

**What is the distance between (1, 2, 3) and (4, 6, 15)?**
√(9 + 16 + 144) = 13.

**Does it work with negative coordinates?**
Yes – differences are squared.

**How is it related to the 2D formula?**
It adds a (Δz)² term.

**What is the diagonal of a box l × w × h?**
√(l² + w² + h²) – the distance between opposite corners.


## Sources

- [OpenStax – Calculus Volume 3](https://openstax.org/details/books/calculus-volume-3)
- [Wolfram MathWorld – Distance](https://mathworld.wolfram.com/Distance.html)
