Distance Formula Calculator - 2D and 3D Distance Between Two Points
Math Calculators
Calculate the distance between two points in 2D or 3D space using the distance formula. Shows the substituted formula with step-by-step work.
Point 1
Point 2
Distance
5
| Element | x / x₁ | y / y₁ | x₂ | y₂ |
|---|---|---|---|---|
| P₁ | 0 | 0 | ||
| P₂ | 3 | 4 |
How to use this tool
- Choose 2D or 3D. Select whether you want to calculate distance in a 2D plane or 3D space.
- Enter the coordinates. Type the x, y (and z) coordinates for both points.
- Read the result. The distance, formula, midpoint, and component differences are shown instantly.
Distance formula in 2D
The distance between two points (x₁, y₁) and (x₂, y₂) in a plane is: d = √((x₂ − x₁)² + (y₂ − y₁)²). This is the Pythagorean theorem applied to the horizontal and vertical differences.
Distance formula in 3D
In three-dimensional space, add the z-axis difference: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). This extends naturally from the 2D formula.
Midpoint formula
The midpoint between two points is the average of their coordinates: M = ((x₁+x₂)/2, (y₁+y₂)/2) in 2D, with (z₁+z₂)/2 added in 3D.
Frequently asked questions
What is the distance formula?
The 2D distance formula is d = √((x₂−x₁)² + (y₂−y₁)²), derived from the Pythagorean theorem. The 3D version adds a third term: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²).
What is Euclidean distance?
Euclidean distance is the straight-line (shortest) distance between two points. It is what this calculator computes.
How do I find the midpoint?
The midpoint in 2D is ((x₁+x₂)/2, (y₁+y₂)/2). In 3D, add (z₁+z₂)/2 for the z coordinate.
Related tools
- Midpoint / Distance CalculatorFind the halfway coordinate for the same pair of 2D endpoints.
- Slope CalculatorCalculate rise, run, slope, and line equation from the two points.
- Haversine CalculatorUse latitude and longitude for great-circle distance on Earth instead of flat coordinates.
- Length ConverterConvert the resulting distance into the unit required by the next calculation.