Distance & Midpoint Calculator

Distance, midpoint and slope between two points (x₁,y₁) and (x₂,y₂).

x₁
y₁
x₂
y₂
Distance
Midpoint
Slope
Δx (run)
Δy (rise)

Distance uses the Pythagorean formula. A vertical line (same x) has an undefined slope.

Three facts about two points

Give the calculator two points and it returns the straight-line distance between them, the midpoint that sits exactly between, and the slope of the line that joins them.

d = √((x₂−x₁)² + (y₂−y₁)²) · midpoint = ((x₁+x₂)/2, (y₁+y₂)/2)

The distance formula is the Pythagorean theorem in disguise: the horizontal and vertical gaps are the two legs, and the distance is the hypotenuse between the points.

Worked example

From (0, 0) to (3, 4) the distance is exactly 5, the midpoint is (1.5, 2) and the slope is 4⁄3 ≈ 1.333 — the familiar 3-4-5 right triangle in disguise.

From geometry to the real world

Distance and midpoint calculations underpin mapping, computer graphics, navigation and design. Anywhere positions are given as coordinates, these formulas turn them into lengths and centre points you can actually use.

Quick checks

  • Distance is never negative. Squaring removes the direction.
  • Midpoint lies between. Its coordinates sit between the two points’.
  • Vertical means undefined. Equal x-values give no finite slope.

Frequently asked questions

How is the distance found?
With the distance formula, which is the Pythagorean theorem applied to the horizontal and vertical gaps: distance = √((x₂ − x₁)² + (y₂ − y₁)²).
What is the midpoint?
The point exactly halfway between the two, found by averaging the coordinates: ((x₁ + x₂)/2, (y₁ + y₂)/2).
When is the slope undefined?
When the two points share the same x-value, the line is vertical and its slope is undefined — you cannot divide by a zero horizontal change.
Does the order of the points matter?
Not for distance or midpoint, which are symmetric. Slope is also the same either way, since both the rise and the run flip sign together.