Distance Between Two Points Calculator
The straight-line distance between two points on a plane, their midpoint and the slope of the line joining them — the distance formula from Pythagoras.
Drop a right triangle between the points: the legs are the differences in x and y, so the distance is √((x₂ − x₁)² + (y₂ − y₁)²).
How the distance between two points calculator works
Drop a right triangle between the points: the legs are the differences in x and y, so the distance is √((x₂ − x₁)² + (y₂ − y₁)²). The midpoint averages the coordinates.
Formula: d = √((x₂ − x₁)² + (y₂ − y₁)²); midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Worked examples
| Inputs | Distance | Note |
|---|---|---|
| (1, 1) to (4, 5) | 5 | a 3-4-5 triangle: 5 |
| (0, 0) to (1, 1) | 1.414214 | √2 |
FAQFrequently asked questions
Where does the distance formula come from?
Pythagoras: the horizontal and vertical differences are the legs of a right triangle and the distance is the hypotenuse.
Does it work in three dimensions?
Yes — add (z₂ − z₁)² under the root.
Is the distance ever negative?
No; it is a length. The differences Δx and Δy can be negative.
What is the midpoint used for?
Bisecting a segment, finding a circle's centre from a diameter, averaging two positions.
Can I use it on a map?
For short distances on a flat grid, yes. Over the Earth's surface use the haversine formula with latitude and longitude instead.
Where these figures come from
- NIST Digital Library of Mathematical Functions — reference definitions for elementary and special functions
- Wolfram MathWorld — definitions and formulas for every topic on this page
- NIST/SEMATECH e-Handbook of Statistical Methods — the statistical formulas (mean, variance, z, confidence intervals, sample size)
- Australian Curriculum (ACARA) — Mathematics — the terms and methods taught in Australian schools
Last checked: September 2026. Formulas are fixed by mathematics and do not change with tax years or regulations.