Horizontal Line Equation — Definition, Formula & Examples
Horizontal Line Equation
y = b, where b is the y-intercept.
Movie Clip (with narration)
![]() Horizontal Line: how to find the equation (1.43M) |
See also
Equation of a line, zero slope, slope-intercept, point-slope, standard form, two intercept, vertical line equation
Key Formula
y=b
Where:
- y = The y-coordinate of every point on the line
- b = The y-intercept — the constant value where the line crosses the y-axis
Worked Example
Problem: Write the equation of the horizontal line that passes through the point (4, 3).
Step 1: Identify the y-coordinate of the given point. The point is (4, 3), so the y-coordinate is 3.
y-coordinate=3
Step 2: Recall that a horizontal line has the same y-value at every point. Since the line passes through y = 3, every point on the line also has y = 3.
y=3
Step 3: Verify with the slope. A horizontal line has a slope of 0. Using slope-intercept form y = mx + b with m = 0 and b = 3 gives the same result.
y=0x+3=3
Answer: The equation of the horizontal line through (4, 3) is y = 3.
Another Example
This example starts from two points, showing how to confirm a line is horizontal by computing the slope first, and how the equation works with a negative y-intercept.
Problem: Find the equation of the horizontal line that passes through both (−2, −5) and (7, −5).
Step 1: Calculate the slope between the two points using the slope formula.
m=7−(−2)−5−(−5)=90=0
Step 2: A slope of 0 confirms the line is horizontal. Both points share the y-coordinate −5.
y-coordinate=−5
Step 3: Write the equation. Every point on this line has y = −5, regardless of the x-value.
y=−5
Answer: The equation is y = −5.
Frequently Asked Questions
What is the slope of a horizontal line?
The slope of every horizontal line is 0. Because the line does not rise or fall, the change in y (the "rise") is always 0, making the slope formula evaluate to 0 no matter what the run is.
Why does a horizontal line equation have no x-variable?
A horizontal line has the same y-value at every point, so y does not depend on x at all. Plugging slope m = 0 into the slope-intercept form y = mx + b eliminates the x-term, leaving just y = b.
What is the difference between a horizontal line and a vertical line equation?
A horizontal line is written y = b and has a slope of 0. A vertical line is written x = a and has an undefined slope. In a horizontal line, y is constant; in a vertical line, x is constant. A horizontal line is a function, but a vertical line is not.
Horizontal Line Equation vs. Vertical Line Equation
| Horizontal Line Equation | Vertical Line Equation | |
|---|---|---|
| Formula | y = b | x = a |
| Slope | 0 (zero slope) | Undefined |
| Constant coordinate | y-coordinate is the same for all points | x-coordinate is the same for all points |
| Crosses which axis | Crosses the y-axis at (0, b) | Crosses the x-axis at (a, 0) |
| Is it a function? | Yes — passes the vertical line test | No — fails the vertical line test |
Why It Matters
Horizontal line equations appear frequently when graphing linear equations and identifying slopes. You will need to recognize them in coordinate geometry, when solving systems of equations (a horizontal line can intersect a curve), and when reading real-world graphs where a flat segment indicates no change over time. Understanding this simple equation also reinforces the concept that slope equals zero when there is no vertical change.
Common Mistakes
Mistake: Writing a horizontal line as x = b instead of y = b.
Correction: The equation x = b describes a vertical line, not a horizontal one. Remember: horizontal lines lock the y-value, so the equation is y = b.
Mistake: Thinking a horizontal line has no slope or an undefined slope.
Correction: A horizontal line has a slope of exactly 0. It is the vertical line that has an undefined slope. Zero slope means the line is flat — it exists but equals zero.
Related Terms
- y-intercept — The constant b in the equation y = b
- Zero Slope — Horizontal lines always have zero slope
- Vertical Line Equation — Counterpart equation x = a for vertical lines
- Slope-Intercept Equation of a Line — General form y = mx + b reduces to y = b when m = 0
- Equation of a Line — Broader topic covering all linear equation forms
- Point-Slope Equation of a Line — Alternative line form that simplifies for horizontal lines
- Standard Form for the Equation of a Line — Horizontal line in standard form is 0x + 1y = b
- Two Intercept Form for the Equation of a Line — Does not apply to horizontal lines unless b ≠ 0

