The Slope Formula: Rise Over Run, Explained With Examples
The slope formula is m = (y₂ − y₁) / (x₂ − x₁), which is just rise over run: the vertical change between two points divided by the horizontal change. This guide defines the points, works a full example, and covers all four slope cases.

The slope of a line through two points is
m = (y₂ − y₁) / (x₂ − x₁), which is rise over run. Pick any two points on the line, subtract the y-values for the top of the fraction and the x-values for the bottom, then divide. That single quotient is the slope, writtenm.
If you just want the number, our slope calculator gets the slope, intercept, and line equation instantly from two points. Everything below explains what that number means and how to compute it by hand.
What the slope formula says
The slope formula takes two points and turns them into one number that describes how the line tilts. The two points are named with subscripts, point one and point two, and the result is the slope.
The order of the points does not matter, as long as you keep it consistent. If you put the second point's y-value first in the numerator, put its x-value first in the denominator too. The result tells you how steep the line is and which way it tilts.
Rise over run, concretely
Slope is a ratio of two changes. The rise is the vertical change, how far up or down you move. The run is the horizontal change, how far left or right you move.
Picture a line climbing from the lower-left to the upper-right of a grid. Start at one point and walk to a second point further along. If you go up six squares while you move three squares to the right, divide the climb by the sideways step to get the slope. That slope says how far the line climbs for every single unit you move right, and a steeper slope climbs faster per sideways step.
A full worked example
Take the line through two given points and find its slope step by step. First label the points, then find the rise, then the run, then divide.
Swapping the points gives the same answer. Reverse which point you call first and both the top and bottom of the fraction flip sign. The two negatives cancel, so the slope is unchanged.
The four cases
Every slope falls into one of four categories, decided by the signs of the rise and run. A line can go uphill, downhill, stay flat, or run straight up.
The vertical case is the one to watch. When the two x-values match, the run is zero and you would be dividing by zero, which has no value. So a vertical line has undefined slope, not zero. A horizontal line, where the rise is zero, has slope exactly zero. They are opposites, not the same thing.
From slope to the line equation
Once you have the slope, you can write the equation of the line. Two forms do the job, and which one you reach for depends on what you already know.
Slope-intercept form uses the slope and the y-intercept, the y-value where the line crosses the vertical axis. Point-slope form needs only the slope and any one point, which is usually the faster route from two points because you already have both.
To find the point exactly halfway between your two endpoints instead, reach for the midpoint calculator, which works from the same two-point setup as slope.
Slope is one number that carries both steepness and direction. Subtract the y-values, subtract the x-values, divide, and read the sign. When you want the slope, intercept, and full equation worked out from two points, use the slope calculator.
Common questions
The line falls as you read it left to right. Every unit you move right, the line drops by the absolute value of the slope, so a more negative slope falls faster.
A horizontal line has a slope of zero, because the rise is zero and zero divided by any nonzero run is zero. A vertical line has undefined slope, because the run is zero and dividing by zero is not allowed. They are opposites, not the same value.
Slope is the tangent of the angle the line makes with the horizontal, m = tan(θ). A unit slope corresponds to a forty-five-degree angle, and larger slopes mean steeper angles approaching vertical, where the slope becomes undefined.


