Distance & Midpoint Calculator (Two Points)

The distance between two points on a graph comes from the Pythagorean theorem, and the midpoint is simply the average of their coordinates. This distance and midpoint calculator takes two points (x₁, y₁) and (x₂, y₂) and returns the straight-line distance, the midpoint and the slope of the line through them.

calculated
calculated
calculated
calculated
Type in any field to change it. Press × on a value to calculate that field instead.

How to use the distance and midpoint calculator

Enter the coordinates of the two points. The calculator returns the straight-line (Euclidean) distance between them, the midpoint, and the slope of the line joining them. Any of the inputs can be solved for instead — for example, clear y₂ and enter a distance to find where the second point must lie.

Distance and midpoint formulas

d = √((x₂ − x₁)² + (y₂ − y₁)²)  ·  M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)  ·  m = (y₂ − y₁) ÷ (x₂ − x₁)

Example

Points (1, 2) and (7, 10):

  • Δx = 7 − 1 = 6, Δy = 10 − 2 = 8
  • Distance = √(6² + 8²) = √100 = 10
  • Midpoint = ((1 + 7) ÷ 2, (2 + 10) ÷ 2) = (4, 6)
  • Slope = 8 ÷ 6 = 1.3333

Worked distances and midpoints

Point 1 Point 2 Distance Midpoint Slope
(0, 0) (3, 4) 5 (1.5, 2) 1.333
(1, 2) (7, 10) 10 (4, 6) 1.333
(-3, 5) (4, -2) 9.899 (0.5, 1.5) -1
(2, -1) (-6, 3) 8.944 (-2, 1) -0.5
(0, 0) (5, 12) 13 (2.5, 6) 2.4
(-4, -4) (4, 4) 11.31 (0, 0) 1
(1.5, 2.5) (4, 8) 6.042 (2.75, 5.25) 2.2

Notes

  • Distance is always positive and does not depend on which point you call “1”.
  • A vertical line (x₁ = x₂) has an undefined slope; the distance and midpoint are still valid.
  • For the full equation of the line, use the slope calculator.

Frequently asked questions

What is the distance formula?

d = √((x₂ − x₁)² + (y₂ − y₁)²). It is the Pythagorean theorem applied to the horizontal and vertical differences between the two points.

What is the midpoint formula?

The midpoint is ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) — the average of the x-coordinates and the average of the y-coordinates.

How do I find a missing endpoint from the midpoint?

Rearrange the midpoint formula — x₂ = 2xₘ − x₁ and y₂ = 2yₘ − y₁. In this calculator, clear x₂ and y₂ and enter the midpoint instead.

How do I find the distance between two points in 3D?

Add the z term — d = √(Δx² + Δy² + Δz²). The vector calculator gives the magnitude of a 3D difference vector directly.

Embed this calculator

Free to use on your website or blog. Copy this code: