How to find the slope of a line
To find the slope of a line, take two points on it and divide the change in y (the rise) by the change in x (the run): slope = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 1) and (5, 4), the slope is (4 − 1) ÷ (5 − 1) = 3/4. If the equation is written as y = mx + b, the slope is m.
The slope m is the change in y, y₂ − y₁, divided by the change in x, x₂ − x₁, for any two points (x₁, y₁) and (x₂, y₂) on the line.
Updated
Concept map
7 ideas, in the order to learn them. Click one and Zidna draws and narrates an animated lesson on it.
Slope of a Line
How to find a line's slope from a graph, two points or an equation, and what zero, undefined, parallel and perpendicular slopes mean.
Rise and Run
The signed vertical change (rise) and horizontal change (run) between two points.Generate lesson2Finding the Slope of a Line
How steep a line is: its rise divided by its run between any two of its points.Builds on Rise and RunGenerate lesson3Zero and Undefined Slope
A horizontal line has slope 0; a vertical line's slope is undefined, as its run is 0.Builds on Finding the Slope of a LineGenerate lesson4Slope-Intercept Form
The equation y = mx + b of a line, in which m is the slope and b is the y-intercept.Builds on Finding the Slope of a LineGenerate lesson5Slope as a Rate of Change
How much one quantity changes per unit of another, such as miles per hour.Builds on Finding the Slope of a LineGenerate lesson6Slope From Standard Form
Finding the slope of Ax + By = C by solving for y, which gives m = −A/B.Builds on Slope-Intercept FormGenerate lesson7Parallel and Perpendicular Slopes
Parallel lines have equal slopes; perpendicular lines have slopes multiplying to −1.Builds on Slope-Intercept FormGenerate lessonKey ideas
- 01
Slope is rise over run: the change in y divided by the change in x between two points on a line, m = (y₂ − y₁) ÷ (x₂ − x₁).
- 02
A straight line has the same slope everywhere, so any two of its points give the same answer, and either point can go first if you subtract in the same order on top and bottom.
- 03
On a graph, pick two points where the line crosses grid corners, count the rise (up is positive, down is negative) and the run to the right, then divide.
- 04
In slope-intercept form, y = mx + b, the slope is m, the number multiplying x once y is alone. In standard form, Ax + By = C, the slope is −A/B, as long as B is not 0.
- 05
A positive slope rises from left to right, a negative slope falls, a horizontal line has slope 0, and a vertical line has an undefined slope because its run is 0.
- 06
Parallel lines have equal slopes. Perpendicular lines, if neither is vertical, have slopes that are negative reciprocals, such as 2 and −1/2, which multiply to −1.
- 07
Slope is a rate of change: its units are y-units per x-unit, so the slope of a distance-time graph is a speed, such as 60 miles per hour.
How do you find slope on a graph?
To find slope on a graph, pick two points on the line, count how many units the line rises between them and how many units it runs to the right, then divide the rise by the run. Count up as positive and down as negative.
- 1Find two points where the line crosses grid corners exactly, so you can read both coordinates without guessing.
- 2From the left point, count the rise: the units up (positive) or down (negative) to the height of the other point.
- 3Count the run: the units right to reach the other point.
- 4Divide: slope . Simplify the fraction.
- 5Check with another pair of points. A straight line gives the same slope every time.
Read the numbers on the axes before you count squares. If each square stands for 2 or 5 units, the number of squares is not the rise or the run.
How do you find slope with two points?
To find slope from two points, subtract the y-coordinates, subtract the x-coordinates in the same order, and divide. This is the slope formula, rise over run written with coordinates:
m equals y₂ minus y₁, divided by x₂ minus x₁: the change in y over the change in x between the points (x₁, y₁) and (x₂, y₂).
- 1Label the points and . Either point can be first.
- 2Rise: subtract the y-values, .
- 3Run: subtract the x-values in the same order, .
- 4Divide the rise by the run and simplify. A negative answer means the line falls.
For and : . Swapping the points gives , the same slope.
Put parentheses around negative coordinates before you subtract: , not .
The rise and run between two points are the legs of a right triangle, so the distance between the points is , by the Pythagorean theorem.
How do you find slope from an equation?
To find slope from an equation, solve it for y. Once it reads , the slope is , the number multiplying , and is the y-intercept, where the line crosses the y-axis. This is called slope-intercept form.
| Form | Example | Slope |
|---|---|---|
| Slope-intercept, | ||
| Point-slope, | ||
| Standard, | ||
| Horizontal, | ||
| Vertical, | undefined |
Standard form needs one more step, because the slope is not the number in front of . To find the slope of :
- 1Subtract from both sides: .
- 2Divide every term by 3: .
- 3Read the number multiplying : .
The slope is the number multiplying only when stands alone. In , divide by 2 first: , so the slope is 3, not 6.
What do positive, negative, zero and undefined slopes look like?
Read a line from left to right: a positive slope rises, a negative slope falls, a zero slope stays flat, and a vertical line has an undefined slope. The farther the slope is from 0, in either direction, the steeper the line.
| Slope | The line | Example | Why |
|---|---|---|---|
| Positive | Rises | Rise and run have the same sign | |
| Negative | Falls | Rise and run have opposite signs | |
| Zero | Horizontal | The rise is 0, and | |
| Undefined | Vertical | The run is 0, and you cannot divide by 0 |
Why a vertical line's slope is undefined: between and the rise is 4 and the run is , so the slope would be . No number times 0 makes 4, so the division has no answer. A horizontal line is the opposite case: its rise is 0, and 0 divided by any run is 0.
Slope also sets a line's angle: a line at an angle measured counterclockwise from the positive x-axis has slope , the tangent from the unit circle. A slope of 1 rises at 45°, and a slope of falls at 45°.
Zero slope and undefined slope are not the same: zero is flat, undefined is vertical.
How do you find slope from a table?
To find slope from a table of values, take any two rows and divide the change in y by the change in x. When the table describes a line, every pair of rows gives the same slope.
| x | y |
|---|---|
| 1 | 10 |
| 3 | 7 |
| 5 | 4 |
| 7 | 1 |
From the first two rows, . Each row adds 2 to and takes 3 from , so any two rows give . If two pairs of rows give different slopes, the points do not lie on one line.
Divide by the real change in . Here goes up by 2 from row to row, so the slope is , not .
What are the slopes of parallel and perpendicular lines?
Parallel lines have equal slopes. Perpendicular lines, if neither is vertical, have slopes that are negative reciprocals of each other: flip the fraction and change its sign, and the two slopes multiply to .
For example, has slope . Every line parallel to it has slope , and every line perpendicular to it has slope , because .
One exception: a horizontal line and a vertical line are perpendicular, but slope 0 and an undefined slope cannot multiply to .
What does slope mean in real life?
In real life, slope is a rate of change: how much the quantity on the y-axis changes for each one unit of the quantity on the x-axis. Its units are y-units per x-unit.
A car driving away from home on a straight highway is 150 miles from home after 3 hours and 270 miles from home after 5 hours. The slope between those two points on its distance-time graph is miles per hour: the car's average speed over those 2 hours.
Roads and ramps give slope as a percent, called the grade: the slope times 100%. A ramp that rises 1 foot over a run of 12 feet has slope , a grade of about 8.3%. A 100% grade is a slope of 1, a 45° incline, not a vertical wall.
The slope between two points is an average rate. The car's speed at a single instant, the number on its speedometer, is the slope of its distance-time graph at that one moment, which the derivative finds.
Worked examples
Slope from two points with negative coordinates
Find the slope of the line through and .
- 1Take and .
- 2Rise: .
- 3Run: .
- 4Divide and simplify: .
- 5Check in the other order: .
Answer: : the line falls 3 units for every 4 units it runs right.
Slope from a graph whose squares are not 1 unit
Find the slope of the line on the graph. Each square is 1 unit wide but 2 units tall.
- 1Read the axes first: counts by 1 per square and counts by 2 per square.
- 2Pick two points on grid corners: and .
- 3Rise: . That is 3 squares, but 6 units.
- 4Run: .
- 5Divide: .
Answer: . Counting squares alone would give , which is wrong.
Slope from standard form
Find the slope of the line .
- 1Subtract from both sides: .
- 2Divide every term by : .
- 3Read the number multiplying : .
- 4Check with the shortcut , where and : .
Answer:
Slope and y-intercept from two points
Write the equation of the line through and in slope-intercept form.
- 1Slope: .
- 2Put the slope and one point, , into : .
- 3Solve for : , so .
- 4Check the other point: , which matches .
Answer: , with slope and y-intercept .
Slope of a vertical line and a horizontal line
Find the slope of the line through and , and of the line through and .
- 1First line: the rise is and the run is .
- 2 has no value, so the slope is undefined. Both points have , so the line is the vertical line .
- 3Second line: the rise is and the run is .
- 4, so the slope is 0. Both points have , so the line is the horizontal line .
Answer: The vertical line has an undefined slope; the horizontal line has slope 0.
Slope of a perpendicular line
Find the slope of a line perpendicular to .
- 1Solve for : , so .
- 2The given line has slope .
- 3Take the negative reciprocal: the reciprocal of is , and changing its sign gives .
- 4Check: .
Answer:
Check yourself
1.What is the slope of the line through (2, 3) and (6, 11)?Show answer
2. The rise is 11 − 3 = 8 and the run is 6 − 2 = 4, so the slope is 8 ÷ 4 = 2.
2.What is the slope of the line through (−1, 4) and (3, −4)?Show answer
−2. The rise is −4 − 4 = −8 and the run is 3 − (−1) = 4, so the slope is −8 ÷ 4 = −2.
3.What is the slope of the line through (0, −2) and (5, 0)?Show answer
2/5. The rise is 0 − (−2) = 2 and the run is 5 − 0 = 5.
4.A line rises 6 units for every 4 units it runs to the right. What is its slope?Show answer
3/2, because 6/4 simplifies to 3/2.
5.What is the slope of y = −4x + 7?Show answer
−4, the number multiplying x.
6.What is the slope of y = 5 − 2x?Show answer
−2. The slope is the number multiplying x, wherever the x term is written.
7.What is the slope of 3x + 2y = 8?Show answer
−3/2. Solving for y gives y = −(3/2)x + 4.
8.What is the slope of the line y = 5?Show answer
0. The line is horizontal.
9.What is the slope of the line x = −3?Show answer
Undefined. The line is vertical, so its run is 0.
10.A line has slope 2/3. What is the slope of a line perpendicular to it?Show answer
−3/2, the negative reciprocal. Check: (2/3) × (−3/2) = −1.
Common mistakes
- Dividing the run by the rise: .Slope is rise over run. The change in y goes on top: .
- Subtracting in different orders, such as , which flips the sign.Start from the same point on top and bottom. If comes first on top, comes first on the bottom.
- Losing a sign with a negative coordinate, such as writing as .Put negative numbers in parentheses, then subtract: .
- Reading the slope of as .Solve for first: , so the slope is .
- Saying a vertical line has slope 0.A horizontal line has slope 0. A vertical line has an undefined slope, because its run is 0.
- Counting grid squares without checking what each square is worth.Read the numbers on the axes. If each square is 2 units tall, a rise of 3 squares is 6 units.
- Counting from the right-hand point to the left and calling the run positive.Start at the left point and count the run to the right, so the run is positive and the sign of the rise is the sign of the slope.
Questions students ask
Does it matter which point is (x₁, y₁)?
No. Either point can be first, as long as you use the same order on the top and the bottom of the slope formula. Swapping the points changes the sign of both the rise and the run, and the two sign changes cancel. Mixing the orders, such as y₂ − y₁ over x₁ − x₂, gives the right size with the wrong sign.
Can slope be a fraction, a decimal or bigger than 1?
Yes. A slope can be any real number, such as 3/4, −2.5 or 7. A slope above 1 or below −1 means the line is steeper than 45° when both axes use the same scale. Fractions are usually left as fractions, because a slope of 3/4 also reads as rise 3, run 4.
Is a slope of 0 the same as an undefined slope?
No. A slope of 0 belongs to a horizontal line: its rise is 0, and 0 divided by any run is 0. An undefined slope belongs to a vertical line: its run is 0, and division by 0 has no answer. Zero is a number; an undefined slope is not a number at all.
Why is slope called m?
No one knows. The earliest known use is by the Italian mathematician Vincenzo Riccati, who wrote a line as y = mx + n in 1757, and English textbooks were writing y = mx + c and y = mx + b by the 1840s. Historians of math notation say the choice may have been arbitrary. The popular story that m comes from the French word monter, to climb, has no evidence behind it.
Can you find the slope with only one point?
No. Infinitely many lines pass through a single point, each with a different slope. You also need a second point, the line's equation, or a fact such as the line being parallel or perpendicular to a line whose slope you know. The y-intercept counts as a second point: it is the point (0, b).
Does slope have units?
Yes, whenever the axes measure quantities with units. The units of slope are the y-axis units per x-axis unit: a graph of miles against hours has a slope in miles per hour, and a graph of cost against tickets has a slope in dollars per ticket. On a plain x-y grid, slope is just a number.
How do you find the slope of a curve or a tangent line?
A curve has no single slope, because its steepness changes from point to point. Its slope at one point is the slope of the tangent line there, the straight line that runs in the same direction as the curve at that point. Calculus finds it with the derivative: for example, the slope of y = x² at x = 3 is 6.
Is slope the same as gradient?
Yes, for a straight line. Gradient is the usual word for slope in British and Australian schools, and both mean rise over run, the change in y divided by the change in x.
Is slope y over x?
Slope is the change in y over the change in x, (y₂ − y₁) ÷ (x₂ − x₁), not one point's y divided by its x. The two agree only for a line through the origin, such as y = 3x, where every point except (0, 0) gives y ÷ x = 3. On y = 2x + 4, the point (1, 6) gives y ÷ x = 6, but the slope is 2. It is never x over y: the change in y always goes on top.
Sources
Keep going
All math topicsCalculus
What is a derivative?
A derivative is the slope of a curve at a single point: how fast the function's output is changing at that exact input. Draw a line through two points on the curve and slide one point toward the other; the slope the line settles on is the derivative. For f(x) = x², the derivative is 2x, so the slope is 2 at x = 1.
Algebra
The quadratic formula, explained visually
The quadratic formula, x = (−b ± √(b² − 4ac)) / 2a, gives the solutions of any quadratic equation ax² + bx + c = 0 with a ≠ 0. The real solutions are where the parabola y = ax² + bx + c meets the x-axis. For x² − 2x − 3 = 0, a = 1, b = −2 and c = −3, so x = (2 ± √16) / 2: x = 3 or x = −1.
Geometry
The Pythagorean theorem, explained visually
The Pythagorean theorem says that in a right triangle, the square of the hypotenuse (the side across from the right angle) equals the sum of the squares of the other two sides: a² + b² = c². For legs 3 and 4, the hypotenuse is 5, because 9 + 16 = 25.