Mathwords logoMathwords

Horizontal Line Equation — Definition, Formula & Examples

Horizontal Line Equation

y = b, where b is the y-intercept.

 

Movie Clip (with narration)

Eqn of a Horizontal Line
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=by = b
Where:
  • yy = The y-coordinate of every point on the line
  • bb = 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=3y\text{-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=3y = 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=3y = 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=5(5)7(2)=09=0m = \frac{-5 - (-5)}{7 - (-2)} = \frac{0}{9} = 0
Step 2: A slope of 0 confirms the line is horizontal. Both points share the y-coordinate −5.
y-coordinate=5y\text{-coordinate} = -5
Step 3: Write the equation. Every point on this line has y = −5, regardless of the x-value.
y=5y = -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 EquationVertical Line Equation
Formulay = bx = a
Slope0 (zero slope)Undefined
Constant coordinatey-coordinate is the same for all pointsx-coordinate is the same for all points
Crosses which axisCrosses the y-axis at (0, b)Crosses the x-axis at (a, 0)
Is it a function?Yes — passes the vertical line testNo — 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