All calculators

Education

Distance Formula Calculator

Enter the coordinates of two points and we compute the straight-line distance between them. The result shows the horizontal and vertical changes, the squared differences, and the final distance, with the exact radical form when it lands on one.

Coordinates

Enter two points (x₁, y₁) and (x₂, y₂).

e.g. 1

e.g. 2

e.g. 4

e.g. 6

Step by step

  1. 1. Identify the coordinates. x₁ = 1, y₁ = 2, x₂ = 4, y₂ = 6.
  2. 2. Subtract x coordinates. Δx = 41 = 3.
  3. 3. Subtract y coordinates. Δy = 62 = 4.
  4. 4. Square both differences. Δx² = 9, Δy² = 16.
  5. 5. Add the squared differences. 9 + 16 = 25.
  6. 6. Take the square root. d = √25 = 5.
Distance

d =

5

From (1, 2) to (4, 6)

Point 1(1, 2)
Point 2(4, 6)
Δx (x₂ − x₁)3
Δy (y₂ − y₁)4
Δx² + Δy²25
d (distance)5

The distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²) is the Pythagorean theorem applied to the right triangle whose legs are the horizontal and vertical changes between the two points.

Was this helpful?

Examples

(1, 2) and (4, 6)

d = 5

(0, 0) and (3, 4)

d = 5

(−2, 3) and (4, −5)

d = 10

(0, 0) and (1, 1)

d = √2 ≈ 1.4142

How it works

For any two points (x₁, y₁) and (x₂, y₂) on a coordinate plane, the distance between them is:

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

The horizontal change x₂ − x₁ and the vertical change y₂ − y₁ are the two legs of a right triangle whose hypotenuse is the distance you want. That is why this formula is just the Pythagorean theorem applied to coordinates.

Read the guide: Distance Formula explains why the formula works (it is the Pythagorean theorem in coordinate dressing) and walks through three examples with positive, negative, and decimal coordinates.

Frequently asked questions

The distance formula is d = √((x₂ − x₁)² + (y₂ − y₁)²). It returns the straight-line distance between two points (x₁, y₁) and (x₂, y₂) in a 2D coordinate plane. The formula comes directly from the Pythagorean theorem applied to the right triangle formed by the horizontal and vertical changes between the points.

Subtract the x-coordinates to get the horizontal change. Subtract the y-coordinates to get the vertical change. Square both differences, add the squares together, and take the square root. The result is the distance.

(x₁, y₁) and (x₂, y₂) are the two points you want to measure between. The numbered subscripts just label which point is which. The formula gives the same answer regardless of which point you call point 1 and which you call point 2, because the differences get squared.

No. Distance is always zero or positive. The formula squares the differences before taking the square root, which removes any negative sign. A distance of zero only happens when both points are the same.

Yes. Negative coordinates are fine on either or both points. The formula computes (x₂ − x₁) and (y₂ − y₁) correctly regardless of sign, and the squaring step handles the rest.

Yes. The distance formula is the Pythagorean theorem in disguise. The horizontal change (x₂ − x₁) and vertical change (y₂ − y₁) form the two legs of a right triangle, and the distance between the points is the hypotenuse. So d² = (x₂ − x₁)² + (y₂ − y₁)² is just a² + b² = c² with different labels.

Yes. The four coordinate fields accept decimals and negative numbers. The result is computed in full floating-point precision; the displayed value is rounded for readability, and when the answer is a clean integer or has a simple radical form, that exact form is shown alongside the decimal.