Geometry Tutorials

Distance and Midpoint Formula: Complete Guide with Examples

By Published May 8, 2026

The distance formula and midpoint formula are two of the most-used results in coordinate geometry. They take two points (x₁, y₁) and (x₂, y₂) and instantly give you (a) how far apart they are, and (b) the exact center of the segment connecting them. This guide derives both from scratch, shows worked examples, and extends to 3D.

The Two Formulas

Distance Formula

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

Midpoint Formula

M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

Where Does the Distance Formula Come From?

It’s literally the Pythagorean theorem (a² + b² = c²) applied to coordinates. Take two points (x₁, y₁) and (x₂, y₂):

  • Horizontal distance (the “leg”) = |x₂ − x₁|
  • Vertical distance (the “leg”) = |y₂ − y₁|
  • Straight-line distance (the “hypotenuse”) = √((x₂ − x₁)² + (y₂ − y₁)²)

That’s it. Memorize the Pythagorean theorem and you’ve memorized the distance formula. The squaring also means the order of subtraction doesn’t matter (negative squared = positive).

Where Does the Midpoint Formula Come From?

The midpoint is the average of the two endpoints — coordinate by coordinate. The x of the middle is the average of the two x-values; the y of the middle is the average of the two y-values:

  • x_mid = (x₁ + x₂) / 2
  • y_mid = (y₁ + y₂) / 2

That’s the same as taking the arithmetic mean of two numbers — applied separately to x and y.

5 Worked Examples

Example 1: Basic — points (1, 2) and (4, 6)

Distance: d = √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5
Midpoint: M = ((1 + 4)/2, (2 + 6)/2) = (2.5, 4)

Example 2: With negative coordinates — (−3, 5) and (4, −1)

Distance: d = √((4 − (−3))² + (−1 − 5)²) = √(7² + (−6)²) = √(49 + 36) = √85 ≈ 9.22
Midpoint: M = ((−3 + 4)/2, (5 + (−1))/2) = (0.5, 2)

Example 3: A horizontal line — (3, 7) and (10, 7)

Same y means y₂ − y₁ = 0:
d = √((10 − 3)² + 0²) = √49 = 7 (just |x₂ − x₁|)
M = (6.5, 7)

Example 4: Find a missing endpoint given midpoint

“Midpoint of segment is (4, 6) and one endpoint is (1, 2). Find the other.”
M_x = (x₁ + x₂)/2 → 4 = (1 + x₂)/2 → x₂ = 7
M_y = (y₁ + y₂)/2 → 6 = (2 + y₂)/2 → y₂ = 10
Other endpoint: (7, 10)

Example 5: Verify a triangle is equilateral

Vertices A(0, 0), B(4, 0), C(2, 2√3 ≈ 3.464). Find all three sides:
AB = √((4−0)² + (0−0)²) = 4
BC = √((2−4)² + (3.464−0)²) = √(4 + 12) = √16 = 4
CA = √((0−2)² + (0−3.464)²) = √(4 + 12) = √16 = 4
All three = 4 ✓ → equilateral triangle.

3D Extension

For 3D points (x₁, y₁, z₁) and (x₂, y₂, z₂):

  • 3D Distance: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)
  • 3D Midpoint: M = ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2)

Same idea, just one more dimension. Example: P(1, 2, 3) and Q(4, 6, 8). Distance = √(9 + 16 + 25) = √50 ≈ 7.07; midpoint = (2.5, 4, 5.5).

Common Mistakes

  • Forgetting to square: distance is √((Δx)² + (Δy)²), NOT |Δx| + |Δy| (that’s “taxicab” distance, different formula).
  • Sign errors: use parentheses around negative values when squaring. (−6)² = 36, NOT −36.
  • Adding instead of averaging for midpoint: M_x = (x₁ + x₂) / 2, not (x₁ + x₂).
  • Mixing x and y: compute Δx and Δy separately, then square each. Don’t try to compute one combined value.

For instant calculation use our Distance and Midpoint Calculator. For the related Section Formula (dividing a segment in any ratio, not just 1:1), see our Section Formula Calculator.

FAQ

Are these formulas in the SAT/ACT/Class 10? Yes — both formulas are core curriculum in nearly every secondary geometry course worldwide. They’re heavily tested in the SAT Math, ACT, and India’s Class 10 board exams.

What if the points are in polar coordinates? Convert to rectangular first: x = r·cos(θ), y = r·sin(θ). Then apply the formulas as above. There’s a polar-distance formula but it’s messier.

Why is distance always positive? Squaring forces the differences to be positive (or zero), and the square root of a non-negative number is non-negative. Distance can never be negative — it’s a length, a magnitude.

#algebra #formula reference #pythagorean theorem #worked examples
← Previous
All Polygon Angle Formulas Explained: Interior + Exterior
Next →
Surface Area and Volume Formulas for All 3D Shapes