No ads, no sign-upChecked 2026-08-24

Distance Between Two Points

Result

5.000000

Result: 5.000000

Subtract the coordinates, square both gaps, add them and take the square root. From (0, 0) to (3, 4) that is √(9 + 16) = 5. The order of the two points does not matter, because squaring removes the sign, and identical points give zero.

The numbers at a glance

Held fixed: x₁ (first point) 0.0000, y₁ (first point) 0.0000, x₂ (second point) 3.0000.

y₂ (second point)Result
0.00003.000000
1.00003.162278
2.00003.605551
3.00004.242641
4.0000Your value5.000000
5.00005.830952
6.00006.708204
7.00007.615773
8.00008.544004

Worked examples

Case 1
x₁ (first point)
0
y₁ (first point)
0
x₂ (second point)
3
y₂ (second point)
4

5.000000

Open with these values
Case 2
x₁ (first point)
1
y₁ (first point)
1
x₂ (second point)
4
y₂ (second point)
5

5.000000

Open with these values
Case 3
x₁ (first point)
-2
y₁ (first point)
-3
x₂ (second point)
1
y₂ (second point)
1

5.000000

Open with these values

How it's calculated

d = √((x₂ − x₁)² + (y₂ − y₁)²)

  1. StepEnter the coordinates of the first point, then of the second.
  2. StepThe horizontal gap Δx and the vertical gap Δy are the two legs.
  3. ResultThe distance is the hypotenuse: √(Δx² + Δy²).

Reference table

x₁, y₁, x₂, y₂Δx, ΔyDistance
2, 2, 2, 20, 00.000000
0, 0, 3, 43, 45.000000
1, 1, 4, 53, 45.000000
-2, -3, 1, 13, 45.000000
0, 0, 0, 70, 77.000000

Questions

How do I calculate the distance between two points?

Use the distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). Subtract the x-coordinates and the y-coordinates, square each difference, add them and take the square root. For (0, 0) and (3, 4) that is √(9 + 16) = √25 = 5.

Why is this the Pythagorean theorem?

The horizontal gap Δx and the vertical gap Δy are the two legs of a right triangle, and the distance is its hypotenuse. Pythagoras says hypotenuse² = leg² + leg², which is exactly the distance formula.

Does the order of the two points matter?

No. Swapping the points flips the sign of Δx and Δy, but each difference is squared and squaring removes the sign. The distance stays identical.

Can I use negative or zero coordinates?

Yes, in any quadrant. For (−2, −3) and (1, 1) the gaps are Δx = 3 and Δy = 4, giving a distance of 5. Two identical points give a distance of zero.

Where is the 2D distance formula used?

Anywhere a straight-line gap on a flat plane matters: distances on a map or screen, collision and proximity checks in games, hit-testing in graphics, and nearest-neighbour work in data.

Sources and last check

  1. mathworld.wolfram.com

Information, not professional advice.