Zero Slope
A horizontal line has a zero slope. Slope is the rise divided by the run, and on a horizontal line the rise is zero. Zero divided by any nonzero number is zero, so the slope is a real number and that number is 0. Its equation looks like y = a number.
What a zero slope means on a line
Slope measures how much a line climbs for each step you take sideways. Take two points, subtract to get the rise and the run, and divide.
slope = (y2 − y1) ÷ (x2 − x1)
On a horizontal line the height stays put. Take (1, 5) and (6, 5): the rise is 5 − 5 = 0, and the run is 6 − 1 = 5. The division is 0 ÷ 5, which is 0. The slope is zero.
The same thing happens on any flat line. Walk along it in either direction and the y value does not move, so the rise comes out at zero and the slope comes out at zero with it. Those lines are the ones written as y = a number: y = 5, y = −2, y = 0. The x-axis itself is one of them.
Read plainly, a slope of zero says the line is going nowhere upward or downward. It is flat.
Why zero is an answer, not a missing one
This is the part that trips people up, and it is worth slowing down for. The word zero makes it sound as though something is absent, as though the line failed to have a slope. That is not what is happening.
0 ÷ 5 is a normal division with a normal result. Ask it the way division is meant to be asked: what number times 5 gives 0? The answer is 0, and nothing else fits. So the calculation finishes, and it finishes with a number.
Zero on top is fine, as long as the bottom is not zero too. Zero on the bottom is the problem. 0 ÷ 5 = 0 because the rise is zero and the run is not. 5 ÷ 0 has no answer at all, because the run is zero. Those are opposite situations that both contain the word zero, which is most of why this topic feels slippery.
Two distinct points that give a nonzero rise and a run of zero lie on a vertical line, and its slope is undefined rather than zero. A horizontal line has a slope and that slope is 0. A vertical line does not have one. Flat and upright are opposites, not two versions of the same idea, and the two answers could hardly be further apart.
It helps to hold on to one sentence: zero is a value, undefined is the absence of a value. A bank balance of zero is still a balance. Having no bank account is a different situation.
Writing the equation of a horizontal line
A horizontal line is written as y = a number, and the number is the height every point on it shares. A horizontal line through (1, 5) is y = 5. So is a horizontal line through (400, 5). The x coordinate does not enter the equation, because x is free to be anything.
That form hides the slope, which is why some people doubt it has one. You can bring it back into view by writing the missing term in:
y = 5 is the same line as y = 0x + 5
Now it sits comfortably in slope intercept form, y = mx + b, with m = 0 and b = 5. Whatever x does, 0x contributes nothing, and y stays at 5. Unlike a vertical line, a horizontal line fits that form without any trouble.
The same holds if a question hands you a point and asks for the equation through it. In point-slope form, y − y1 = m(x − x1), putting m = 0 wipes out the whole right-hand side and leaves y − y1 = 0, which rearranges to y = y1. The form agrees with the shortcut: read the y coordinate off the point and you have the line.
Reading a slope written as 0 over 7
Slopes often arrive as a fraction rather than a finished number, and homework questions lean on that. If you have worked out a slope of 0/7, you have a horizontal line, and the slope is simply 0. The same goes for 0/3, 0/12, or zero over any other nonzero number. What decides it is the zero on top.
Do check you have not written the fraction upside down, because the reversed version means the opposite line. Compare the two:
| You wrote | It means | The line is |
|---|---|---|
| 0/7 | 0, a real slope | Horizontal |
| 7/0 | Undefined, no slope exists | Vertical |
Two answers as different as they come, and the only thing separating them on the page is which side of the bar the zero sits on. When you get a fraction out, look at the bottom first.
“No slope” points at the other line
Sooner or later a textbook or a teacher will say “no slope”, and few phrases in this topic cause as much trouble. Heard quickly it sounds like “a slope of nothing”, which sounds like zero, which sounds like a flat line. That reading is the one to be careful with.
In ordinary use, “no slope” means undefined, so it describes a vertical line, not a flat one. The intended sense is “there is no slope here to give you”, not “the slope has the value zero”.
This is not a made-up worry. A student on r/askmath posted the exact situation: homework asked for a line with an undefined slope, with “no slope” written beside it in brackets, and the student had taken the two phrases to mean different lines, x = 1 and y = 1. Their teacher said the two phrases meant the same thing. The answers agreed with the teacher on the maths, while being blunt about the wording. One put it this way: no mathematician would use the phrase, since either the slope is undefined, because the line is vertical, or it is defined and has some value, which could be 0.
The practical version: write zero, not “no slope”. If a flat line is what you mean, say the slope is 0, or say the line is horizontal. Both are unambiguous. Save yourself the phrase that half your readers will take the other way, and if a question puts it in front of you, read it as undefined.
Three ways to spot a zero slope
You will meet this as a graph, as a pair of points, or as an equation. One idea covers all three: look for which value refuses to change. If y is stuck, the slope is zero. If x is stuck, the slope is undefined.
- From a graph. The line runs flat, left to right, parallel to the x-axis. It does not lean either way.
- From two points. The y coordinates match: (1, 5) and (6, 5), or (−40, 2) and (3, 2). Matching y values give a rise of zero, and the run does not matter as long as the points are genuinely different.
- From an equation. There is a y and a number, and no x in sight: y = 5, y = −2. Anything of the form y = a number lies flat.
This is worth double-checking each time, because the two cases get swapped more often than you would expect, including by people who feel sure. If you are unsure, rebuild it from the equation: y = 5 pins the height at 5, and a line that cannot change height has nowhere to go but sideways.
Two things follow from all this and are worth having ready. Horizontal lines are parallel to each other, since they share a slope of 0, so y = 5 and y = −2 run alongside without ever meeting.
Perpendicular is the more interesting one, because it is where a rule people lean on quietly stops working. Perpendicular lines are usually described as having slopes that multiply to −1: a slope of 2 pairs with −1/2, and 2 × (−1/2) = −1. A horizontal line and a vertical line are perpendicular as plainly as any pair you can draw, and yet the multiplication cannot even be attempted, because undefined is not a number you can multiply by.
The rule is narrower than it sounds. It applies to two lines that both have slopes. Careful statements of it set this pair aside, and answers on Mathematics Stack Exchange do the same, one of them writing “horizontal and vertical lines aside” before quoting the −1 result. The pair is still perpendicular. It is the shortcut that does not reach them.
Outside the classroom the same reading applies. A flat stretch on a graph says the quantity is holding steady: a parked car on a distance-time graph, a saved amount that is not growing, a level floor. Wherever a line goes flat, whatever it is tracking has stopped changing.
Frequently asked questions
Is a slope of 0 vertical or horizontal?
Horizontal. A slope of 0 means the line does not climb or fall, so it lies flat and runs parallel to the x-axis.
Vertical lines are the other case, and their slope is undefined rather than zero. A quick way to keep them straight: y = 5 is flat, x = 5 is upright.
Is a zero slope the same as an undefined slope?
No, they are opposites. A zero slope belongs to a horizontal line and is a real answer: the rise is 0, so 0 divided by the run gives 0.
An undefined slope belongs to a vertical line, where the run is 0 and the division has no answer at all. Zero is a value; undefined is the absence of one.
What is the slope of the x-axis?
Zero. The x-axis is the horizontal line y = 0, so it sits at the same height everywhere and its slope is 0 like any other flat line.
The y-axis is the opposite case. It is the vertical line x = 0, and its slope is undefined.
Does y = 0 have a zero slope, or does the 0 mean something else?
It has a zero slope, but not because of the 0 in the equation. That 0 is the height of the line, not its slope.
This catches people out, so it is worth separating: y = 0 and y = 17 both have a slope of 0, because both are flat. The number after the equals sign tells you where the line sits, not how steeply it climbs.
How do you write the equation of a line with a zero slope?
As y = a number, where the number is the height every point on the line shares. A horizontal line through (4, 3) is y = 3, and the 4 plays no part.
If the question wants slope intercept form, write it as y = 0x + 3, which is the same line with the slope made visible. Both are correct, and the second one shows your working.
Can a line with a zero slope be graphed?
Yes, and it is one of the easier lines to draw. Find the number on the y-axis, put your pencil there, and rule a straight line across the page in both directions.
There is no need to work out a second point, because the height does not change. For y = 3, mark 3 on the y-axis and go straight across.
Are two horizontal lines parallel?
Yes. Parallel lines are lines with the same slope, and horizontal lines share a slope of 0, so any two of them are parallel and will not meet.
A line perpendicular to a horizontal one is vertical. That is the one pairing where the usual rule of flipping the slope and changing its sign gives nothing useful, since flipping 0 is not something you can do.
Why does the perpendicular slope rule not work for a horizontal line?
Because the rule quietly assumes both lines have a slope. Perpendicular lines are normally described as having slopes that multiply to −1, so 2 pairs with −1/2. A horizontal line has a slope of 0, and the line perpendicular to it is vertical, whose slope is undefined, so there is no second number to multiply by and nothing to flip.
The two lines are still perpendicular. It is the shortcut that does not stretch to them, which is why careful versions of the rule exclude horizontal and vertical lines. In practice, if a question asks for the line perpendicular to y = 5 through a point, the answer is the vertical line x = that point’s x coordinate.
What does a zero slope mean outside a maths question?
That nothing is changing. On a distance-time graph a flat line is a car sitting still. On a savings chart it is money that is not growing. On a temperature reading it is a steady temperature.
Slope is a rate of change, so a slope of 0 is the rate of change being zero. The quantity is holding where it is.