Slope of a line
Slope measures how steep a line is: the change in y divided by the change in x between any two points. The formula is m = (y₂ − y₁) / (x₂ − x₁). A positive slope rises left to right, a negative slope falls, a slope of 0 is horizontal and a vertical line has undefined slope.
y=m x+1
The slope formula
Pick two points on the line, (x₁, y₁) and (x₂, y₂). Slope is “rise over run”:
m = (y₂ − y₁) / (x₂ − x₁)
The order of the points does not matter as long as you subtract in the same order on top and bottom. For (1, 3) and (4, 9): m = (9 − 3) / (4 − 1) = 6 / 3 = 2.
Reading slope from a graph
- Find two points where the line crosses grid intersections exactly.
- Count the vertical change (rise). Up is positive, down is negative.
- Count the horizontal change (run) from left to right.
- Divide rise by run and simplify the fraction.
The four kinds of slope
| Positive (m > 0) | Line rises from left to right |
|---|---|
| Negative (m < 0) | Line falls from left to right |
| Zero (m = 0) | Horizontal line, y = constant |
| Undefined | Vertical line, x = constant (run is 0) |
Parallel lines have equal slopes. Perpendicular lines have slopes whose product is −1, such as 2 and −½.
Try it on the graph
The graph above uses a slider: y = m x + 1 with m = 2. Open it in the calculator and drag the slider to watch the line tilt. Negative values of m make it fall; m = 0 flattens it.
Frequently asked questions
What is the slope of a horizontal line?
Zero. The y-value never changes, so the rise is 0 for any run.
Why is the slope of a vertical line undefined?
The run is 0, and dividing by zero is undefined.
Is slope the same as rate of change?
Yes, for a straight line. Slope is the constant rate of change of y with respect to x. For curves, the derivative gives the slope at each point.