How to find the slope of a line
The same question shows up three ways. Learn to read rise over run and you can find a slope from points, a graph or an equation.
Find the slope and equation of the line through two points.
Slope sounds like a single idea, and it is: it measures how steep a line is and which way it tilts. What makes it feel confusing is that the same question arrives in three different disguises. You might be handed two points, or a drawn graph, or an equation, and asked for the slope of the line. Learn to read one simple ratio, rise over run, and all three become the same quick job.
What slope actually measures
Slope is rate of change: how much the line climbs or falls for each step you take to the right. We write it as the letter m, and it is always the vertical change divided by the horizontal change, often said as "rise over run" and written m = Δy ÷ Δx. A slope of 2 means the line goes up 2 for every 1 across. A slope of −0.5 means it drops half a unit for every 1 across. The bigger the number ignoring its sign, the steeper the line, so a slope of −5 is steeper than one of 2; the sign on its own just tells you the direction, up or down.
This is not just a classroom idea. A common 1-in-12 maximum for wheelchair ramps is a slope of about 0.083 (1 ÷ 12), or 8.3%; a road signed as a 6% grade has a slope of 0.06; and the pitch of a roof is a slope too. Any time one thing changes steadily with another, slope is the number that describes how fast, whether that is metres of climb per kilometre of road or earnings per hour worked.
How to find the slope from two points
This is the version most people are taught. Given two points, label them (x₁, y₁) and (x₂, y₂), then:
m = (y₂ − y₁) ÷ (x₂ − x₁)
Take the points (2, 3) and (6, 11). The rise is 11 − 3 = 8, the run is 6 − 2 = 4, so the slope is 8 ÷ 4 = 2. The line climbs 2 for every 1 across. A falling line works the same way and comes out negative: for (1, 9) and (4, 3), the rise is 3 − 9 = −6 and the run is 4 − 1 = 3, so the slope is −6 ÷ 3 = −2, a line that drops 2 for every 1 across.
Does it matter which point is first?
No, as long as you are consistent. If you start the top of the fraction with y₂, you must start the bottom with x₂ too. Swap both and you get the same answer: (3 − 11) ÷ (2 − 6) = −8 ÷ −4 = 2 again. The mistake to avoid is mixing the order, subtracting the y-values one way and the x-values the other, which flips the sign and gives you the wrong line.
How to find the slope from a graph
When the line is already drawn, you do not need the formula at all, just two points you can read off cleanly where the line crosses the grid. Read the graph left to right so the run is always positive, then count: how many squares the line rises or falls between the two points (the rise, which is negative if the line is heading down), and how many squares across (the run). Divide rise by run.
For example, take a line passing through (0, 1) and (3, −2). Reading left to right, it drops 3 and moves 3 across, so the slope is −3 ÷ 3 = −1. A tip that saves errors: choose two points that are far apart and sit exactly on grid corners. Reading a slope between two points a long way apart makes a small misread matter far less than squinting at two points squeezed together.
How to find the slope from an equation
If the line is written as an equation, the slope is often sitting in plain sight. The slope-intercept form is y = mx + b, where m is the slope and b is where the line crosses the y-axis. So in y = 3x + 5, the slope is simply 3. In y = −2x + 1, it is −2.
If the equation is in a different shape, rearrange it until y is on its own. For 2y = 6x − 4, divide everything by 2 to get y = 3x − 2, so the slope is 3. Standard form, such as 4x + 2y = 8, needs one extra step: subtract to get 2y = −4x + 8, then divide by 2 for y = −2x + 4, and the slope, −2, appears. The one equation this does not work for is a vertical line like x = 5, which cannot be put in y = mx + b form at all, because its slope is undefined (see below).
The two cases that trip people up
Two lines break the simple picture, and they are worth knowing because they turn up in exams and real data alike.
A horizontal line never rises, so its rise is 0, and 0 divided by any non-zero run is 0. Its slope is exactly zero, which is correct: a flat line has no steepness.
A vertical line is the opposite, and the one that surprises people. Its run is 0, and dividing by zero is undefined, so a vertical line has no slope at all, not a slope of zero. Take the points (4, 1) and (4, 7): the run is 4 − 4 = 0, so the fraction has zero on the bottom and the slope is undefined. If your two points share the same x-value, stop: the line is vertical.
Parallel and perpendicular, in one line
Two quick rules fall straight out of slope. Lines that are parallel have the same slope. Lines that meet at a right angle, perpendicular, have slopes that multiply to −1, which makes each the negative reciprocal of the other: a line of slope 2 is perpendicular to one of slope −0.5. That rule holds for any pair of lines that are neither horizontal nor vertical; a horizontal and a vertical line are perpendicular too, but there the product rule cannot apply because one slope is undefined. That single fact answers a lot of geometry questions without any drawing.
The bottom line
Whatever form the question takes, slope is one ratio: rise over run. From two points, subtract and divide; from a graph, count the squares left to right; from an equation, read the number in front of x. Keep the subtraction order consistent, remember that a flat line is zero and a vertical line is undefined, and the rest is arithmetic. To check your working in a hurry, drop the two points straight into our slope calculator, which shows the rise, the run and the resulting slope. If you are brushing up on coordinate geometry more broadly, our explainer on the Pythagorean theorem covers the distance between those same two points, and the Pythagorean theorem calculator works it out for you.
Frequently asked questions
What is the formula for the slope of a line?
Slope is the vertical change divided by the horizontal change, written m = (y2 − y1) ÷ (x2 − x1). For the points (2, 3) and (6, 11) the rise is 8 and the run is 4, so the slope is 2. It is often said as 'rise over run'.
How do I find the slope from a graph?
Pick two points where the line crosses the grid cleanly, count the squares up or down between them (the rise) and the squares across (the run), then divide rise by run. Choose points far apart and on exact corners so a small misread matters less.
How do I find the slope from an equation?
Put the equation in the form y = mx + b, and the slope is the number m in front of x. In y = 3x + 5 the slope is 3. If the equation is in another form, rearrange it so y is alone first, then read the coefficient of x.
What is the slope of a horizontal or vertical line?
A horizontal line has a slope of zero, because it never rises. A vertical line has an undefined slope, not zero, because its run is zero and you cannot divide by zero. If two points share the same x-value, the line is vertical and the slope is undefined.
Does it matter which point I use first?
No, as long as you are consistent. Whichever point's y you put first on top, use the same point's x first on the bottom. Mixing the order, subtracting the y-values one way and the x-values the other, flips the sign and gives the wrong slope.