Skip to content
One hour with George, then a written plan the next working day. Book yours.

Horizontal lines, slope and equations

A horizontal line runs straight across a graph at one fixed height. Every point on it has the same y-value, so its equation is y = b, its slope is 0, and it crosses the y-axis at the single point (0, b). A vertical line is the opposite case: its equation is x = a and its slope is undefined.

For students and parents planning test prep or coursework: one hour with George Li, one to one by video, is $180, $200 or $160, by subject. You leave with a written plan within one working day.

Book your first session
Horizontal, vertical and slanted lines compared on four points of each
LineEquation formTwo sample pointsRise over runSlope
Horizontaly = b(-3, 5) and (8, 5)0 over 110
Verticalx = a(4, -2) and (4, 6)8 over 0undefined
Risingy = mx + b with m > 0(0, 1) and (2, 5)4 over 22
Fallingy = mx + b with m < 0(0, 4) and (3, 1)-3 over 3-1

Slope is rise over run. In a horizontal line the rise is always 0, and in a vertical line the run is always 0, which would put a zero in the denominator.

Our own comparison table using the slope formula (change in y over change in x) and the textbook's descriptions of horizontal and vertical lines

Why is the slope of a horizontal line zero?

Slope compares how far a line rises to how far it runs. Moving along a horizontal line, you travel left or right and never up or down, so the rise is 0 for any run. Take the points (minus 3, 5) and (8, 5). The change in y is 5 minus 5, which is 0, and the change in x is 8 minus (minus 3), which is 11. Zero divided by 11 is 0. The slope is 0 for every pair of points on the line.

Do not confuse a slope of 0 with an undefined slope. A division with 0 on top has a clean answer. A division with 0 on the bottom has no answer, and that is the vertical line. A quick memory aid is that a flat road has no steepness at all, while a wall is too steep to measure.

What is the equation of a horizontal line?

Start from the slope-intercept form y = mx + b and set m equal to 0. The mx term vanishes and what remains is y = b. The b is the point where the line crosses the y-axis, and it is also the one height shared by all points of the line. The equation does not contain x, which says that x can be anything while y stays put.

To write the equation from a point, read off the y-coordinate. A horizontal line through (7, minus 3) is y = minus 3. If a problem gives two points with the same y-coordinate, such as (minus 3, 5) and (8, 5), the line is y = 5 without any further work, and the segment between them has length 11.

Worked example. A horizontal line passes through (2, 9). A second horizontal line is 6 units below it. Write both equations, and find where the lower line meets the line x = 5 and the line y = 2x minus 3.

  1. The first line is y = 9, since a horizontal line keeps the y-coordinate of its point.
  2. The second line is 6 units lower, so y = 3.
  3. With x = 5 the lower line meets at the point (5, 3).
  4. With y = 2x minus 3, put y = 3 in: 3 = 2x minus 3, so x = 3. The meeting point is (3, 3).

Answer: y = 9 and y = 3, meeting x = 5 at (5, 3) and the slanted line at (3, 3). Check: 2 times 3 minus 3 is 3.

How are horizontal lines parallel and how far apart are they?

Two horizontal lines are always parallel, since both have slope 0. The distance between y = 9 and y = 3 is the difference of the constants, 6 units, measured along any vertical line. A horizontal line is perpendicular to every vertical line. Its perpendicular slope would be the negative reciprocal of 0, which does not exist, and that is the reason the pair is handled as a special case.

Where do horizontal lines appear in graphs of functions?

A horizontal line is the graph of a constant function, a function whose output is the same for every input. In that role it is a linear function with slope 0. The same line also tests functions. A function is one-to-one when no horizontal line meets its graph in two places, the horizontal line test. The parabola y = x squared fails it, since the line y = 4 meets it at x = 2 and x = minus 2. The line y = 2x passes it.

Horizontal lines also mark asymptotes of some graphs, and an inequality such as y is at least 3 shades the region on or above the line y = 3.

What mistakes should you watch for?

  • Writing the equation of a horizontal line as x = b. That is a vertical line.
  • Saying the slope is undefined when it is 0, or the reverse.
  • Forgetting that the equation has no x term. y = 4 is already complete.
  • Using the x-coordinate of a point to write a horizontal line through it.
  • Calling the line "no slope". Say that its slope is zero.

Where does this show up?

The published content of both exams covers it. The SAT® exam math content lists linear equations in two variables and linear functions, and the ACT® test description lists linear relationships under both Algebra and Functions. A tutor can drill the special cases, horizontal, vertical and parallel lines, until they stop costing points. See the high school courses page, the packages, or book a first session. For a function that is not a line, read vertex form versus standard form.

Common questions

What slope does a horizontal line have?

Zero, because the change in y between any two points is 0.

What is the equation of a horizontal line?

y = b, where b is the shared y-value. The line y = 3 is horizontal at height 3.

How is a horizontal line different from a vertical line?

A horizontal line has slope 0 and the equation y = b. A vertical line has an undefined slope and the equation x = a.

What is the horizontal line test?

A function is one-to-one when no horizontal line meets its graph more than once.

Sources