Distance Between Two Parallel Lines

Perpendicular distance for ax + by + c = 0 form lines

Reviewed by [email protected], Geometry Calculator Developer & Online Math Educator Last updated May 14, 2026

Two parallel lines have the same direction but never meet. The perpendicular distance between them is constant everywhere along their length, so there is a single formula that captures it. The key requirement: write both lines in the form ax + by + c = 0 with the same a and b — only the constant term c differs.

The Formulas

Name Formula Notes
Standard Form (2D) d = |c₁ − c₂| / √(a² + b²) Lines: ax + by + c₁ = 0 and ax + by + c₂ = 0. Same a and b — that is what makes them parallel.
Slope-Intercept Form d = |b₁ − b₂| / √(1 + m²) For y = mx + b₁ and y = mx + b₂. The slopes m must match. Derived from the standard form with a = m, b = −1.
Point-to-Line Distance d = |ax₀ + by₀ + c| / √(a² + b²) Distance from point (x₀, y₀) to line ax + by + c = 0. The parallel-line formula is just point-to-line applied to any point on one line, computed against the other.
Vector Form d = |⃗AB · ⃗n̂| ⃗AB connects a point on line 1 to a point on line 2; ⃗n̂ is the unit normal to either line. Generalizes to 3D.
Parallel Lines Test a₁/a₂ = b₁/b₂ ≠ c₁/c₂ For a₁x + b₁y + c₁ = 0 and a₂x + b₂y + c₂ = 0. If all three ratios are equal, the lines are identical (not just parallel).
Skew Lines in 3D d = |(⃗a₂ − ⃗a₁) · (⃗b₁ × ⃗b₂)| / |⃗b₁ × ⃗b₂| When two lines in 3D are parallel but not coplanar (skew). Cross product of direction vectors gives the common perpendicular; project the connecting vector onto it.
Parallel Planes d = |D₁ − D₂| / √(A² + B² + C²) For Ax + By + Cz + D₁ = 0 and Ax + By + Cz + D₂ = 0. Direct 3D analog of the 2D formula.

Worked Examples

Example 1: Distance between 3x + 4y + 5 = 0 and 3x + 4y − 7 = 0

  1. a = 3, b = 4. c₁ = 5, c₂ = −7.
  2. |c₁ − c₂| = |5 − (−7)| = |12| = 12
  3. √(a² + b²) = √(9 + 16) = √25 = 5
  4. d = 12 / 5 = 2.4 units

Example 2: Distance between y = 2x + 3 and y = 2x − 4 (slope form)

  1. Rewrite: 2x − y + 3 = 0 and 2x − y − 4 = 0
  2. a = 2, b = −1. c₁ = 3, c₂ = −4.
  3. d = |3 − (−4)| / √(4 + 1) = 7 / √5 ≈ 3.13

Example 3: Find c if the line 3x − 4y + c = 0 is at distance 4 from 3x − 4y + 1 = 0

  1. Setup: d = |c − 1| / √(9 + 16) = |c − 1| / 5
  2. |c − 1| / 5 = 4 → |c − 1| = 20
  3. c − 1 = ±20 → c = 21 or c = −19

Skip the manual calculation

Plug in your numbers and get instant step-by-step results.

Use Distance Calculator See All Geometry Formulas