Slope calculator
The slope of a line through two points is the change in y divided by the change in x: m = (y₂ − y₁) / (x₂ − x₁). Enter two points below to get the slope, the y-intercept and the line's equation in slope-intercept form, with every step of the working shown.
m = 3; y = 3x − 1
Step by step
- Write the slope formula
- Put in the points
and .
- Work out the rise and the run
Rise , run .
- Simplify
- Find the y-intercept b
Use with the first point and solve for .
- Write the line equation
How the slope calculator works
Slope measures how steep a line is: how many units it rises (or falls) for each unit you move right. Between any two points, the calculator finds the rise () and the run () and divides them. That’s the whole slope formula.
Next it finds where the line crosses the y-axis. Put the slope and one of your points into and solve for . With and , you have the equation of the line.
What the answer tells you
- Positive slope: the line goes up from left to right.
- Negative slope: the line goes down from left to right.
- Zero slope: a horizontal line, .
- Undefined slope: a vertical line, . The run is zero and you can’t divide by zero.
Common mistakes
- Mixing the order: if you start with on top, you must start with underneath.
- Run over rise: slope is rise over run, never the other way around.
- Sign errors with negatives: , not .
Want the method in more depth, including slope from a graph and from an equation? Read how to find slope.
Worked example: a negative slope
Points and :
- Rise:
- Run:
- Using : , so
- Equation:
Where slope shows up
Slope is a rate of change, so it appears well beyond algebra class. A road that climbs 5 m over 100 m has a grade of , or a slope of . On a distance-time graph, the slope is speed. On a cost graph, it’s the price per item. Whenever a question asks “how much does one thing change when the other goes up by one?”, it’s asking for a slope.
Tips for entering points
You can type whole numbers, decimals or fractions such as 1/2, and negative numbers with a minus sign. The order of the two points doesn’t matter.
Frequently asked questions
What is the formula for slope?
Slope : the change in divided by the change in between two points on the line.
What does an undefined slope mean?
The line is vertical. Both points have the same , so the run is , and division by zero is undefined. The equation is , where is that shared value.
Does it matter which point I call the first point?
No. Swapping the points changes the sign of both the top and the bottom, so the slope stays the same.
How do I get the equation of the line from the slope?
Substitute the slope and one point into , solve for , then write . The calculator does this for you.