Distance Between Two Parallel Lines

#Distance Between Two Parallel Lines
TL;DR
The distance between two parallel lines is the length of the perpendicular between them, and it is the same everywhere. For ax+by+c1=0ax + by + c_1 = 0 and ax+by+c2=0ax + by + c_2 = 0 it equals ∣c2−c1∣÷a2+b2|c_2 - c_1| \div \sqrt{a^2 + b^2}.
Mythri K M·reviewed byMadhukar VLast updated on December 2, 202612 min read

Key Points

  • Formula: d=∣c2−c1∣a2+b2d = \dfrac{|c_2 - c_1|}{\sqrt{a^2 + b^2}}, after both equations have the same aa and bb.
  • Slope form: for y=mx+c1y = mx + c_1 and y=mx+c2y = mx + c_2, d=∣c2−c1∣1+m2d = \dfrac{|c_2 - c_1|}{\sqrt{1 + m^2}}.
  • Vertical lines x=h1x = h_1 and x=h2x = h_2 are ∣h2−h1∣|h_2 - h_1| apart.
  • A line at a given distance always has two answers, one on each side.

How Far Apart Are Two Rails That Never Meet?

Rails run side by side for miles, and one fixed gap decides whether a train stays on. Measure it anywhere along a straight stretch, square across the track, and you get the same number.

  • On standard-gauge track the gap is 1,435 mm between the inner faces of the rails, wherever you measure.
  • Because the gap never changes, it has one value, and coordinate geometry finds it from the two equations alone.
the distance between two parallel lines is the same perpendicular gap wherever it is measured
A grid with the parallel lines 3x + 4y + 7 = 0 and 3x + 4y − 3 = 0 and three green perpendicular segments between them, each labelled 2.

What Is the Distance Between Two Parallel Lines?

The distance between two parallel lines is the perpendicular distance from any point on one line to the other line.

  • Parallel lines keep a constant gap on a flat plane, so every point gives the same answer.
  • It is a special case of the distance between two lines: crossing lines have distance 0, and lines in 3D can also be skew.

What Is the Formula for the Distance Between Two Parallel Lines?

Write both lines with identical coefficients of xx and yy, then divide the difference of the constants by a2+b2\sqrt{a^2 + b^2}.

ax+by+c1=0andax+by+c2=0⇒d=∣c2−c1∣a2+b2ax + by + c_1 = 0 \quad \text{and} \quad ax + by + c_2 = 0 \qquad \Rightarrow \qquad d = \frac{|c_2 - c_1|}{\sqrt{a^2 + b^2}}
  • a,ba, b are the coefficients of xx and yy; they must be the same in both equations.
  • c1,c2c_1, c_2 are the two constants, and a2+b2\sqrt{a^2 + b^2} is the scale factor of the equations.

Where does the formula come from?

  • Pick any point (x0,y0)(x_0, y_0) on the first line, so ax0+by0=−c1a x_0 + b y_0 = -c_1.
  • The distance of a point from a line to the second line is
∣ax0+by0+c2∣a2+b2=∣−c1+c2∣a2+b2\frac{|a x_0 + b y_0 + c_2|}{\sqrt{a^2 + b^2}} = \frac{|-c_1 + c_2|}{\sqrt{a^2 + b^2}}
  • x0x_0 and y0y_0 vanish: every point gives the same answer, which confirms the constant gap.

How Do You Calculate the Distance Between Two Parallel Lines?

First check the lines are parallel, then use three steps. a1x+b1y+c1=0a_1 x + b_1 y + c_1 = 0 and a2x+b2y+c2=0a_2 x + b_2 y + c_2 = 0 are parallel and different when a1a2=b1b2≠c1c2\frac{a_1}{a_2} = \frac{b_1}{b_2} \ne \frac{c_1}{c_2}; if all three ratios match, it is the same line.

  1. Make the coefficients of xx and yy identical; scale one line if you must.
  2. Read off c1c_1 and c2c_2.
  3. Divide ∣c2−c1∣|c_2 - c_1| by a2+b2\sqrt{a^2 + b^2} to get dd.

Why Must the Coefficients Match Before You Use the Formula?

The formula compares the two constants, and constants on different scales cannot be compared.

  • 2x+3y+5=02x + 3y + 5 = 0 and 4x+6y−7=04x + 6y - 7 = 0 are parallel, but the second is scaled by 2, so 5 and −7-7 cannot be compared.
  • Scale it to 2x+3y−3.5=02x + 3y - 3.5 = 0: d=∣−3.5−5∣13=8.513≈2.36d = \dfrac{|-3.5 - 5|}{\sqrt{13}} = \dfrac{8.5}{\sqrt{13}} \approx 2.36.
  • Dividing by a2+b2\sqrt{a^2 + b^2} is the other half: without it, scaling an equation would change the answer.

How Do You Find the Distance When Lines Are in Slope-Intercept Form?

For y=mx+c1y = mx + c_1 and y=mx+c2y = mx + c_2 (same slope mm), divide the difference of the intercepts by 1+m2\sqrt{1 + m^2}:

d=∣c2−c1∣1+m2d = \frac{|c_2 - c_1|}{\sqrt{1 + m^2}}

This is the same formula: y=mx+cy = mx + c becomes mx−y+c=0mx - y + c = 0, so a=ma = m, b=−1b = -1 and a2+b2=m2+1\sqrt{a^2 + b^2} = \sqrt{m^2 + 1}.

Why it works: tilt the vertical gap

  • At any xx, the lines are ∣c2−c1∣|c_2 - c_1| apart vertically, but that segment is slanted to them.
  • The perpendicular, the vertical segment and the lower line form a right triangle with the vertical as hypotenuse.
  • The angle θ\theta between them has tan⁡θ=m\tan\theta = m, so cos⁡θ=11+m2\cos\theta = \frac{1}{\sqrt{1 + m^2}} and d=∣c2−c1∣cos⁡θd = |c_2 - c_1| \cos\theta.
  • For y=2x+5y = 2x + 5 and y=2x−3y = 2x - 3: gap 8, θ≈63.4°\theta \approx 63.4°, so d=85≈3.58d = \frac{8}{\sqrt{5}} \approx 3.58.
  • The vertical gap is the distance only for horizontal lines, where m=0m = 0.
the perpendicular distance is the vertical gap multiplied by cos θ, where tan θ is the slope
A grid with y = 2x + 5 and y = 2x − 3. A purple vertical segment of length 8 joins them at x = −1, a green perpendicular d ≈ 3.58 leaves its top end, and the angle θ ≈ 63.4° between them is marked.

In the coordinate lab above:

  • Press "Parallel": y=12xy = \frac{1}{2}x and y=12x+2.5y = \frac{1}{2}x + 2.5 are 2.51.25=5≈2.24\frac{2.5}{\sqrt{1.25}} = \sqrt{5} \approx 2.24 apart.
  • Drag both orange handles up one square: the distance grows to 3.51.25≈3.13\frac{3.5}{\sqrt{1.25}} \approx 3.13.
  • Move only one handle and the lines cross: the distance is 0.

Try It Yourself

Use the coordinate lab to see Distance Between Two Parallel Lines at work: drag, change the numbers and watch what happens.

What Are the Properties of the Distance Between Two Parallel Lines?

The distance is constant, perpendicular, positive for distinct lines, and the same whichever line you call first.

  • Constant and perpendicular: the same everywhere, never along a slant.
  • Zero only for identical lines, when all three coefficients are in the same ratio.
  • Order does not matter, because ∣c2−c1∣=∣c1−c2∣|c_2 - c_1| = |c_1 - c_2|.

Edge cases and connections

  • Vertical lines x=h1x = h_1 and x=h2x = h_2: no slope, but a=1a = 1, b=0b = 0 gives d=∣h2−h1∣d = |h_2 - h_1|.
  • Parallelogram area: a side along one line times dd. The distance is the height.

Examples of Distance Between Two Parallel Lines

Example 1

Find the distance between 3x + 4y + 7 = 0 and 3x + 4y − 3 = 0.

  1. The coefficients match: a=3a = 3, b=4b = 4, c1=7c_1 = 7, c2=−3c_2 = -3.
  2. d=∣−3−7∣9+16=105d = \dfrac{|-3 - 7|}{\sqrt{9 + 16}} = \dfrac{10}{5}.

The distance is 2 units.

Example 2

Find the distance between x + 2y + 3 = 0 and 2x + 4y + 1 = 0.

  1. Grabbing the constants gives 25≈0.89\frac{2}{\sqrt{5}} \approx 0.89. Wrong: the coefficients 1,21, 2 and 2,42, 4 differ.
  2. Divide the second by 2: x+2y+12=0x + 2y + \frac{1}{2} = 0.
  3. d=∣12−3∣5=525d = \dfrac{\left|\frac{1}{2} - 3\right|}{\sqrt{5}} = \dfrac{5}{2\sqrt{5}}.

The distance is 52≈1.12\frac{\sqrt{5}}{2} \approx 1.12 units.

Example 3

Find the distance between x = −2 and x = 3.5.

  1. Vertical lines have no slope, so write x+2=0x + 2 = 0 and x−3.5=0x - 3.5 = 0: a=1a = 1, b=0b = 0.
  2. d=∣−3.5−2∣1=5.5d = \dfrac{|-3.5 - 2|}{1} = 5.5.

The distance is 5.5 units, the horizontal gap.

two vertical lines are 5.5 units apart, the difference of their x-values
A grid with the vertical lines x = −2 in blue and x = 3.5 in orange, joined by a green double arrow labelled d = 5.5.

Example 4

A line parallel to 6x − 8y + 1 = 0 passes through (2, 1). How far apart are the two lines?

  1. A parallel line is 6x−8y+c2=06x - 8y + c_2 = 0. Substitute (2, 1): 12−8+c2=012 - 8 + c_2 = 0, so c2=−4c_2 = -4.
  2. d=∣−4−1∣36+64=510d = \dfrac{|-4 - 1|}{\sqrt{36 + 64}} = \dfrac{5}{10}.

The lines are 12\frac{1}{2} unit apart.

Example 5

Find the lines parallel to 3x − 4y + 2 = 0 at a distance of 3 from it.

  1. Any parallel line is 3x−4y+c=03x - 4y + c = 0.
  2. ∣c−2∣5=3\dfrac{|c - 2|}{5} = 3, so ∣c−2∣=15|c - 2| = 15, giving c=17c = 17 or c=−13c = -13.

Two lines, 3x−4y+17=03x - 4y + 17 = 0 and 3x−4y−13=03x - 4y - 13 = 0, one on each side: the absolute value produces both.

two lines lie at distance 3 from the given line, one on each side
A grid with the navy line 3x − 4y + 2 = 0 between the orange line 3x − 4y + 17 = 0 and the green line 3x − 4y − 13 = 0, with a dashed perpendicular of 3 to each side from one point.

Where Do Students Trip Up on This?

Each slip skips one check from the method above.

Mistake 1: Using the formula before matching the coefficients

Where it slips in: The equations are multiples of each other, such as x+2yx + 2y and 2x+4y2x + 4y.

Don't do this: Read c1c_1 and c2c_2 off equations whose aa and bb differ.

The correct way: Scale one equation until both share aa and bb, as in Example 2, before anything else.

Mistake 2: Stopping at the difference of the intercepts

Where it slips in: Slope form, remembering "subtract the c's" but not the denominator: 8 for y=2x+5y = 2x + 5 and y=2x−3y = 2x - 3.

Don't do this: Report the vertical gap as the distance for a sloping line.

The correct way: Divide by 1+m2\sqrt{1 + m^2}. The vertical gap is the distance only for horizontal lines.

Mistake 3: Measuring between two chosen points

Where it slips in: Picking a point on each line and using the distance between two points.

Don't do this: Use (−1,−1)(-1, -1) on 3x+4y+7=03x + 4y + 7 = 0 and (1,0)(1, 0) on 3x+4y−3=03x + 4y - 3 = 0, and report 5≈2.24\sqrt{5} \approx 2.24.

The correct way: Two chosen points almost always give a slanted link, longer than the true gap of 2.

the link between two chosen points is longer than the perpendicular gap of 2
The parallel lines 3x + 4y + 7 = 0 and 3x + 4y − 3 = 0 with a dashed purple link from (−1, −1) to (1, 0) marked wrong as 2.24, and a green perpendicular from (−1, −1) marked right as 2.

Where Is the Distance Between Parallel Lines Used?

"The fixed gap that keeps things from touching."

The constant-gap idea runs through anything built on parallel guides.

  • Railways. The 1,435 mm gauge is checked square across the track; a slanted measure reads larger.
  • Roads. Lane width is the perpendicular gap between markings, even on a road running diagonally across a map grid.
  • Circuit boards. Parallel copper tracks need a minimum spacing so signals do not jump across.
  • Manufacturing. A part passes if its edge stays between two parallel tolerance lines.
railway rails are parallel lines a fixed 1,435 mm apart on standard-gauge track
Two navy rails on orange sleepers, with a green double arrow between them at a right angle to the rails labelled 1,435 mm.

In 3D, the same reasoning gives the distance between parallel planes.

Conclusion

  • The distance between two parallel lines is ∣c2−c1∣a2+b2\frac{|c_2 - c_1|}{\sqrt{a^2 + b^2}}, the constant perpendicular gap.
  • Check the lines are parallel, then match aa and bb before reading the constants.
  • In slope form use ∣c2−c1∣1+m2\frac{|c_2 - c_1|}{\sqrt{1 + m^2}}, the vertical gap times cos⁡θ\cos\theta; lines at a given distance come in pairs.

A Practical Next Step

Practice these problems to solidify your understanding.

  1. Find the distance between 5x+12y−4=05x + 12y - 4 = 0 and 10x+24y+18=010x + 24y + 18 = 0.
  2. Find the distance between y=−3x+2y = -3x + 2 and y=−3x−8y = -3x - 8.

Answer to Question 1: rewrite the second as 5x+12y+9=05x + 12y + 9 = 0, so d=∣9−(−4)∣13=1d = \frac{|9 - (-4)|}{13} = 1.

Answer to Question 2: ∣−8−2∣1+9=1010=10≈3.16\frac{|-8 - 2|}{\sqrt{1 + 9}} = \frac{10}{\sqrt{10}} = \sqrt{10} \approx 3.16.

If Question 1 came out as 2213\frac{22}{13}, go back to Mistake 1.

To build this skill with a teacher, explore Bhanzu's geometry tutor, a high school math tutor, ongoing math tutoring or math classes online.

Want a live Bhanzu trainer to walk your child through lines and coordinate geometry? Book a free demo class, online globally, or in person at our McKinney, TX center.

Read More

Research Behind This Article

  1. OpenStax, Precalculus 2e, Section 2.1: Linear Functions (parallel lines and slope). openstax.org
  2. Euclid, Elements, Book I (the parallel postulate and the properties of parallel lines), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu
  3. OpenStax, Calculus Volume 3, Section 2.5: Equations of Lines and Planes in Space (distances between parallel lines and planes). openstax.org
  4. Euclid, Elements, Book I, Proposition 47 (the right-triangle relation behind the slope-form derivation), with commentary by D. E. Joyce, Clark University. mathcs.clarku.edu

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

Can the distance between two parallel lines be zero?
Only if they are the same line, when all three coefficients are in the same ratio. Otherwise the gap is a fixed positive number.
Does the formula for the distance between two parallel lines work in 3D?
No. For parallel lines in space with direction b⃗\vec{b}, the distance is ∣(a⃗2−a⃗1)×b⃗∣∣b⃗∣\frac{|(\vec{a}_2 - \vec{a}_1) \times \vec{b}|}{|\vec{b}|}.
What does a system of two parallel lines tell you?
The system has no solution. The lines never meet, so no point satisfies both equations.
✍️ Written By
Mythri K M
Mythri K M
Subject Matter Expert
Mythri K M is a mathematics educator and curriculum designer with a Master's degree in Mathematics and over 10 years of teaching experience. She has taught and written on topics ranging from Algebra, Geometry and Trigonometry to Calculus, Number Theory and mathematical reasoning, with a particular interest in how children develop mathematical thinking. As a teacher and parent, she believes learning works best when it is curious and joyful rather than stressful, and she shares ideas and activities that help students build confidence and support parents along the way.
🔬 Reviewed By
Madhukar V
Math Columnist & Analyst
Book a FREE Demo ClassBook Now →