Slope calculator with steps
A slope calculator finds how steep a line is from two points on it. Slope is rise over run: the change in y divided by the change in x. Type two points into the calculator below and it gives the slope as an exact fraction, the equation of the line in slope-intercept form, and every step of the working.
The slope calculator is part of our Midpoint and Distance Calculator, so the same two points also give you the midpoint and the distance between them. There is nothing to switch: the slope is always in the answer, in the row labelled Gradient, which is the UK word for slope.
Midpoint and Distance Calculator
Find the midpoint, distance and gradient between two points
How to use the slope calculator
- Open the calculator with the button above. It starts on the points A (1, 2) and B (7, 5).
- In the Points section, type the x and y coordinates of A, then of B. Negative numbers and decimals both work.
- Or drag A and B around the coordinate plot. They snap to the grid, and the arrow keys move a point once you have selected it.
- Read the answer. Gradient is the slope, Line is the equation of the line through both points, and Midpoint and Distance come free.
- Read the working beside the plot. It shows the run, the rise, the division and the line, so you can copy the method, not just the answer.
To practise, open Practice and help. It sets random questions on pairs of points, some asking for the slope to 2 decimal places, with hints and a worked solution for each.
The slope formula: rise over run
The slope of a line, usually written m, is how far y goes up for every 1 that x goes across. For two points (x₁, y₁) and (x₂, y₂), the slope formula is:
The rise is the change in y, also written Δy. The run is the change in x, written Δx. A slope of 1/2 means the line climbs 1 unit for every 2 units it moves right. It does not matter which point you call the first, as long as you subtract in the same order on the top and the bottom.
Here x and y are the two coordinates. From A to B the run is 7 − 1 = 6 and the rise is 5 − 2 = 3, so the slope is 3/6 = 1/2. The calculator draws the same right-angled triangle on its plot, with the run and the rise labelled.
How to find the slope from two points
Do it by hand when you need to show working, then check it in the calculator.
- Label the points (x₁, y₁) and (x₂, y₂).
- Work out the rise: y₂ − y₁.
- Work out the run: x₂ − x₁, in the same order.
- Divide the rise by the run and simplify the fraction.
Example 1: a negative slope
Find the slope of the line through (−3, 4) and (5, −2).
The slope is −3/4: the line falls 3 units for every 4 it moves right. In the calculator, type −3 and 4 for A, and 5 and −2 for B. It shows the gradient −3/4 and the line y = −3/4x + 7/4.
Example 2: decimal coordinates
Find the slope of the line through (0.5, 1.2) and (2, 4.2).
The slope is 2. The calculator works in exact fractions, even from decimals, so it gives exactly 2 and the line y = 2x + 1/5, where 1/5 is 0.2.
Now try one yourself. Find the slope of the line on the grid, then press Mark to check it in our Graphing Functions course.
Compute the slope through two plotted points, typed as a fraction or decimal.
Press Mark to have your answer marked in the Graphing Functions course.
Positive, negative, zero and undefined slope
The sign of the slope tells you which way the line goes, reading from left to right.
| Slope | What the line does | Example points | What the calculator shows |
|---|---|---|---|
| Positive | Rises | (1, 2) and (7, 5) | Gradient 1/2 |
| Negative | Falls | (−3, 4) and (5, −2) | Gradient −3/4 |
| Zero | Horizontal | (−4, 3) and (6, 3) | Gradient 0, line y = 3 |
| Undefined | Vertical | (2, −1) and (2, 6) | Gradient undefined, line x = 2 |
A vertical line has a run of 0, and you cannot divide by 0, so its slope is undefined. It is not zero and it is not infinity. If you type the same point twice, the working says there is no line through just one point, so there is no slope either.
Slope intercept form calculator: y = mx + b from two points
Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept, the value of y where the line crosses the y-axis. UK textbooks write it y = mx + c. The calculator's Line row gives the equation in this form, so it also works as a slope intercept form calculator, or a slope and y-intercept calculator.
To find b by hand, put the slope and either point into y = mx + b and solve. For example 1, the slope is −3/4 and one point is (−3, 4):
So the line is y = −3/4x + 7/4, which matches the calculator. It crosses the y-axis at 1.75.
Point slope form
Point-slope form, y − y₁ = m(x − x₁), uses the slope and one point, with no need to find b. With the slope 1/2 and the point (1, 2), it is y − 2 = 1/2(x − 1). Expand the bracket and tidy up and you get y = 1/2x + 3/2, the line the calculator gives for its starting points. The calculator always shows slope-intercept form, so for point-slope form put its gradient and either of your points into the formula. Our point-slope form guide covers it in full.
Finding the slope from an equation
The calculator takes points, not equations. If your line is already in the form y = mx + b, the slope is the number in front of x. If it is in standard form, Ax + By = C, rearrange for y and the slope is −A/B.
For 2x + 3y = 12 the slope is −2/3. To check that in the calculator, find two points on the line. Putting x = 0 gives y = 4, and putting y = 0 gives x = 6. Type (0, 4) and (6, 0): the gradient is −2/3.
What the slope means: rate of change
In a real problem the slope is a rate of change: how much one quantity changes for each unit of the other. Its units are the y units per x unit, such as metres per second or dollars per month.
Example 3: a burning candle
A candle is 24 cm tall after burning for 2 hours, and 15 cm tall after 5 hours. Write the facts as points (time, height): (2, 24) and (5, 15).
The slope is −3 cm per hour: the candle gets 3 cm shorter every hour. Type the two points into the calculator and its line is y = −3x + 30. The y-intercept means the candle was 30 cm tall when it was lit. Setting y = 0 gives x = 10, so it burns out after 10 hours.
Here x is the time in hours and y is the height in centimetres. The line falls from left to right, which is what a negative slope looks like.
Slope as a percentage, an angle or a ratio
Road signs, roofers and ramp designers often give a slope in other forms. The calculator gives the slope as a number, and this table turns it into the others.
| Form | From the slope m | For a slope of 1/2 |
|---|---|---|
| Percentage grade | m × 100 | 50% |
| Angle with the horizontal | tan⁻¹(m) | 26.57° |
| Ratio, rise to run | 1 : 1/m | 1:2 |
| Roof pitch, rise per 12 of run | 12m in 12 | 6 in 12 |
A slope percentage calculator does the first row. A 10% grade means a rise of 10 for every 100 across, which is a slope of 0.1 and an angle of about 5.71°. A percentage is not an angle: a 100% grade is a slope of 1, which is 45°, not 90°. For the angle, press tan⁻¹ on any calculator in degree mode, or use the Trigonometry Calculator.
Ramp slope and the ADA 1:12 rule
In the US, the 2010 ADA Standards limit the running slope of a ramp to 1:12. That is a slope of 1/12, about 8.33% or 4.76°. Each run of a ramp can rise 30 inches at most, so a 30 inch rise needs at least 30 × 12 = 360 inches, or 30 feet, of run.
To check a ramp in the calculator, type its foot as (0, 0) and its top as (run, rise), with both in the same units. A run of 360 and a rise of 30 gives a gradient of exactly 1/12. Anything steeper, such as a rise of 30 over a run of 300, gives 1/10 and fails.
Common mistakes
- Subtracting in different orders. (y₂ − y₁) over (x₁ − x₂) flips the sign. Start from the same point on the top and the bottom.
- Putting x on top. Slope is the change in y over the change in x, rise over run, never run over rise.
- Losing a negative. 5 − (−3) is 8, not 2. Put brackets round negative coordinates before you subtract.
- Calling a vertical line's slope 0. A horizontal line has slope 0. A vertical line has an undefined slope.
- Mixing units. A ramp measured in feet one way and inches the other gives a slope 12 times too big or too small. Convert first.
- Reading a percentage grade as an angle. A 10% slope is about 5.71°, not 10°.
Practise slope in a short timed paper
Slope and straight lines run through Pre-Algebra & Algebra 1 and Geometry, Algebra 2 & SAT Math, and through GCSE Maths Higher in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks. The papers mix topics, so slope will not come up in every one, but they show whether the method has stuck. For a full grounding in lines and graphs, the Graphing Functions course starts from the coordinate plane.
Common questions
How do you find the slope of a line?
What is the slope of a horizontal line and a vertical line?
Is slope the same as gradient?
What is a 10% slope?
Is slope the same as rate of change?
Can a slope be a fraction?
What is the slope in y = mx + b?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Midpoint and Distance Calculator
Find the midpoint, distance and gradient between two points
Open the tool - Learn it
Graphing Functions
Graphing made easier: the patterns in numbers and functions used across STEM
Start the course - Test it
Pre-Algebra & Algebra 1
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper