Horizontal Line - Definition, Equation, and Slope

#Geometry
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 $\mathbf{0}$, and it intersects the y-axis at the single point $(0, b)$.
BT
Bhanzu TeamLast updated on May 19, 20265 min read

What Is a Horizontal Line?

A horizontal line is a straight line that:

  • Runs parallel to the x-axis on the coordinate plane.

  • Has every point at the same y-coordinate.

  • Does not rise or fall as $x$ changes.

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:

  • $y = 3$ — horizontal line passing through every point with y-coordinate 3.

  • $y = -5$ — horizontal line passing through every point with y-coordinate $-5$.

  • $y = 0$ — the x-axis itself (a special horizontal line).

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 $(x_1, y_1)$ and $(x_2, y_2)$:

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

For a horizontal line, every point has the same y-coordinate, so $y_2 - y_1 = 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.

Learn more: Slope of a Line

Properties of a Horizontal Line

  • Slope = 0. Flat — no rise.

  • Equation form $y = b$, no $x$.

  • Y-intercept at $(0, b)$. No x-intercept unless the line is $y = 0$ (which is the x-axis itself).

  • Parallel to every other horizontal line — two horizontal lines never intersect (unless they're the same line).

  • Perpendicular to every vertical line — horizontal and vertical lines always meet at right angles.

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 $(x_0, y_0)$ is simply $|y_0 - b|$ — the vertical distance.

Distance $= |7 - 2| = 5$ units.

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

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

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

  • Position-vs-time graph with a horizontal line: an object at rest (no movement).

  • Temperature-vs-time with a horizontal line: a system at thermal equilibrium.

  • Salary-vs-year: a salary that doesn't change (no raises).

  • Equation of latitude on a globe — each line of latitude is horizontal relative to the equator.

  • Spirit-level construction — a level surface in carpentry, masonry, and surveying is literally a horizontal line in 2D cross-section.

  • Statistical control charts — the upper and lower control limits in quality control are horizontal lines.

The concept of a horizontal reference line dates back to the earliest applied geometry — Eratosthenes in 240 BCE used a horizontal sundial reference to compute Earth's circumference. Modern analytic-geometry treatment of horizontal lines comes from René Descartes's 1637 La Géométrie.

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 $5/0$).

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, $y$ = constant). Slope undefined = vertical (runs up-down, $x$ = constant). Memorise the pair as "zero is flat; undefined is vertical."

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

The fix: Horizontal lines have $y$ = constant. Vertical lines have $x$ = 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. The two are very different.

Key Takeaways

  • A horizontal line runs parallel to the x-axis with every point at the same y-coordinate.

  • Equation form: $y = b$ where $b$ is a constant.

  • Slope = 0, not undefined (undefined is for vertical lines).

  • Y-intercept is $(0, b)$; no x-intercept unless $b = 0$.

  • Perpendicular to vertical lines ($x = a$); parallel to other horizontal lines.

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$.

Was this article helpful?

Your feedback helps us write better content

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). Example: $y = 3$, $y = -7$, $y = 0$ (the x-axis).
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 $(x_0, y_0)$, the horizontal line through it has equation $y = y_0$.
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 / \text{nonzero} = 0$. Undefined happens when you divide by zero (the vertical-line case).
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →