Distance formula calculator

Distance between two points.

Distance

5

√(9 + 16)

Midpoint
Change in x, y
Slope

Runs in your browser. Nothing uploaded.

How to find the distance between two points

  1. Enter the two points (x₁, y₁) and (x₂, y₂). Add z values for 3D.
  2. Read the distance with the working: √((x₂ − x₁)² + (y₂ − y₁)²).
  3. The midpoint and the slope are shown too.

Example

From (0, 0) to (3, 4): the differences are 3 and 4, so d = √(9 + 16) = √25 = 5. That 3-4-5 right triangle is the classic example.

Distance and midpoint together

The midpoint is the average of the coordinates, ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2), and it is exactly half the distance from each end. Use the midpoint calculator when the middle point is what you need.

Where it’s used

The distance formula gives the straight-line length between two points on a grid: the length of a diagonal in a floor plan, the distance between two pixels in an image, or how far apart two points on a graph are. In 3D it measures the diagonal of a box: for a 3 × 4 × 12 box it is √(9 + 16 + 144) = 13.