Horizontal Line - Definition, Equation, and Slope

Book A Free Math Class

Horizontal Line - Definition, Equation, and Slope

TL;DR

A horizontal line is a straight line that runs parallel to the x-axis. Its equation has the form y=b (where b is a constant), its slope is exactly 0, and it intersects the y-axis at the single point (0,b).

What Is a Horizontal Line?

A horizontal line is a straight line that:

If you walked along a horizontal line, your height (y-coordinate) wouldn't change — only your left-right position (x-coordinate) would.

The Equation of a Horizontal Line

A horizontal line has the equation:

y=b

where b is a constant — the line's y-coordinate. Examples:

There's no x in the equation because the line's position doesn't depend on x.

The Slope of a Horizontal Line

The slope of a horizontal line is zero.

The slope formula between two points (x1,y1) and (x2,y2):

m = \frac{y_2 - y_1}{x_2 - x_1}

For a horizontal line, every point has the same y-coordinate, so y2−y1=0. The numerator is zero, so:

m = \frac{0}{x_2 - x_1} = 0

A slope of 0 means "no vertical change per unit horizontal change" — the line is flat.

Properties of a Horizontal Line

Horizontal Line vs Vertical Line

Feature Horizontal Line Vertical Line
Equation form y=b x=a
Slope 0 Undefined
Parallel to x-axis y-axis
Y-intercept (0,b) None (unless a=0)
X-intercept None (unless b=0) (a,0)
Memory aid y = constant, runs left-right x = constant, runs up-down

Three Worked Examples — Quick, Standard, Stretch

Quick — Identify the Line

Identify the line y=4.

A horizontal line passing through every point with y-coordinate 4. Slope = 0. Y-intercept = (0,4).

Standard — Find the Equation from a Graph

A line passes through the points (2,5) and (7,5). Find its equation.

Both points have y-coordinate 5, so the line is horizontal. Equation: y=5.

Verify the slope: m=(5−5)/(7−2)=0/5=0 ✓.

Stretch — Distance from a Horizontal Line

Find the distance from the point (3,7) to the horizontal line y=2.

For a horizontal line y=b, the distance from any point (x0,y0) is simply |y0−b| — the vertical distance.

Distance = |7−2|=5 units.

Where Do Horizontal Lines Appear? (The Real-World)

"A horizontal line on a graph is a story of constancy."

Horizontal lines describe quantities that don't change over time or position:

A Worked Example

Find the slope of the line passing through (4,7) and (9,7).

The intuitive (wrong) approach. A student computes (7−7)/(9−4)=0/5 and writes the slope as "undefined" (confusing 0/5 with undefined).

Why it fails. 0/5=0 — zero divided by a non-zero number is zero. Undefined is when you divide by zero — the situation for vertical lines, not horizontal ones.

The correct method. m=(7−7)/(9−4)=0/5=0. The line is horizontal.

What Are the Most Common Mistakes With Horizontal Lines?

Mistake 1: Confusing "slope 0" with "slope undefined"

The fix: Slope 0 = horizontal (runs left-right). Slope undefined = vertical (runs up-down).

Mistake 2: Writing the equation as x=b instead of y=b

The fix: Horizontal lines have y = constant. The variable that's missing tells you the direction: no x → horizontal, no y → vertical.

Mistake 3: Saying a horizontal line has no slope

The fix: A horizontal line has a slope — it's 0. No slope (or undefined slope) is the vertical-line case.

Key Takeaways

A Practical Next Step

Try these three before moving on to slopes of general lines.

  1. Write the equation of the horizontal line passing through (2,−3).
  2. Is y=5 horizontal, vertical, or neither?
  3. Find the distance from (6,4) to the horizontal line y=−2.

Frequently Asked Questions

What is a horizontal line? A straight line parallel to the x-axis. Its equation is y=b (a constant), its slope is 0, and every point on it shares the same y-coordinate.

What is the slope of a horizontal line? Exactly 0. The line doesn't rise or fall as x changes — no vertical change per unit horizontal change.

What is the equation of a horizontal line? y=b, where b is a constant (the line's y-coordinate).

How is a horizontal line different from a vertical line? Horizontal: equation y=b, slope 0, runs left-right. Vertical: equation x=a, slope undefined, runs up-down. They're perpendicular to each other.

Can a horizontal line pass through any point? Yes — for any point (x0,y0), the horizontal line through it has equation y=y0.

Why is the slope of a horizontal line 0 and not undefined? The slope formula is rise/run. For a horizontal line, the rise (change in y) is 0, and the run is non-zero. 0/nonzero=0. Undefined happens when you divide by zero (the vertical-line case).