Distance Between Two Points Calculator
Enter the coordinates of two points to find the straight-line distance between them.
Check the active inputs and the formula domain. Blank, malformed or out-of-range values clear every result.
Approximate results show up to 12 significant digits. Decimal fields use a dot, up to 12 digits on each side, an exponent from −24 to 24 and absolute values up to 10¹². Rational intermediate numerators and denominators are limited to 512 bits. Integer and scientific-notation exceptions are specified below. d=√((x₂−x₁)²+(y₂−y₁)²).
How the distance formula works
The distance between two points (x1, y1) and (x2, y2) is found with the distance formula: d = √((x2−x1)² + (y2−y1)²) — which is just the Pythagorean theorem applied to the horizontal and vertical gaps between the points.
The horizontal gap (x2−x1) and vertical gap (y2−y1) form the two legs of a right triangle, and the straight-line distance between the points is the hypotenuse of that triangle.
Frequently asked questions
Does it matter which point I call point 1 or point 2?
No — the distance formula squares the differences, so the result is the same regardless of which point you label first.
How is this related to the Pythagorean theorem?
The distance formula is a direct application of a² + b² = c²: the x-difference and y-difference between the points are the two legs (a and b), and the distance is the hypotenuse (c).
Can this be extended to three dimensions?
Yes — for points (x1,y1,z1) and (x2,y2,z2) in 3D space, the formula extends to d = √((x2−x1)² + (y2−y1)² + (z2−z1)²).
How we verified this calculator
The calculator is checked against 5 reference cases computed independently of its code. Last passed: .
| # | Inputs | Expected result |
|---|---|---|
| 1 |
x₂ = 1
y₂ = 2
|
Distance: 0
|
| 2 |
x₁ = 0.1
y₁ = 0.1
x₂ = 0.4
y₂ = 0.5
|
Distance: 0.5
|
| 3 |
x₁ = -3
y₁ = -4
x₂ = 0
y₂ = 0
|
Distance: 5
|
| 4 |
x₁ = 100000000000
y₁ = 100000000000
x₂ = 100000000003
y₂ = 100000000004
|
Distance: 5
|
| 5 |
m = 1
n = 3
|
Division point: (1.75, 3)
|