Slope Calculator

Find the slope of a line from two points or an equation. You get the slope as a fraction and a decimal, the line equation, the angle, the percent grade and a graph you can drag.

Point 1
Point 2

Whole numbers, decimals, fractions (3/4) and mixed numbers (1 1/2) all work.

Try:

Graph of the line

Drag a point to move it

Graph of the line with its rise and run
  • Line
  • Rise (Δy)
  • Run (Δx)

What is slope?

Slope is a number that tells you how steep a straight line is and which way it goes.

Read a line from left to right. If it climbs, its slope is positive. If it drops, its slope is negative. The steeper the line, the bigger the number, whether it is positive or negative. A flat line has a slope of 0.

The slope compares two changes between any two points on the line: how far it moves up or down (the rise) and how far it moves left to right (the run). A slope of 3 means the line goes up 3 units for every 1 unit it moves to the right.

In the US the symbol for slope is m. In the UK and Australia the same idea is usually called the gradient. A straight line has the same slope everywhere, so it does not matter which two points you pick.

Three lines from the origin with slopes of 0.25, 1 and 3 gentle, m = 0.25 m = 1 steep, m = 3
All three lines start at the same point. The bigger the slope, the faster the line climbs.

The slope formula

To find the slope between two points, divide the change in y by the change in x.

m = riserun= y₂ − y₁x₂ − x₁
(x₁, y₁)
The first point on the line.
(x₂, y₂)
The second point on the line.
Rise, Δy
The vertical change, y₂ − y₁. Δ (delta) means "change in."
Run, Δx
The horizontal change, x₂ − x₁.

Subtract in the same order on the top and the bottom. If you start with y₂ on top, start with x₂ on the bottom. Mixing the order flips the sign and gives the wrong answer.

Rise and run between two points form a right triangle under the line (x₁, y₁) (x₂, y₂) run = x₂ − x₁ rise = y₂ − y₁
The rise and the run are the two legs of a right triangle drawn under the line.

Types of slope

Every straight line has one of four kinds of slope. Pick a type, or move the slider to tilt the line and watch it change.

Line through the origin at the chosen angle

Positive slope

Slope
Percent grade
Rule
Equation looks like
Real-world picture

How to calculate slope: step-by-step example

Here is the full working for the points A(3, 6) and B(8, 2).

  1. Label the points.Either point can be first. Here A is point 1 and B is point 2.
    x₁ = 3, y₁ = 6 x₂ = 8, y₂ = 2
  2. Find the rise.Subtract the y-values.
    Δy = 2 − 6 = −4
  3. Find the run.Subtract the x-values in the same order.
    Δx = 8 − 3 = 5
  4. Divide rise by run.
    m = −4 / 5 = −0.8
  5. Check the answer makes sense.The slope is negative, so the line should fall from left to right. It does: it drops 4 units for every 5 units it moves right.
Line through A(3, 6) and B(8, 2) with a run of 5 and a rise of negative 4 3 8 6 2 A(3, 6) B(8, 2) run = 5 rise = −4
A(3, 6) and B(8, 2): the line falls 4 units over a run of 5, so m = −4/5.

Finding slope from a line equation

If you already have the equation of the line, you do not need two points. How you read the slope depends on the form.

Slope-intercept form

y = mx + b

The slope is the number in front of x, and b is where the line crosses the y-axis. In y = 3x − 5, the slope is 3.

Slope-intercept form calculator

Standard form

Ax + By = C

Solve for y and the slope comes out as m = −A/B. In 2x + 3y = 6, the slope is −2/3. If B is 0 the line is vertical. Use the Equation tab above to do this for any line.

Standard form calculator

Point-slope form

y − y₁ = m(x − x₁)

The slope is the number in front of the brackets. In y − 4 = 2(x + 1), the slope is 2 and the line passes through (−1, 4).

Point-slope form calculator

Slope, angle and percent grade

The same steepness can be written three ways. Math class uses slope, road signs and ramps use percent grade, and surveyors often use the angle.

  • Angle = arctan(m)
  • Percent grade = m × 100
  • m = tan(angle)

Percent grade and angle are easy to mix up. A 100% grade is a 45° angle, not a vertical wall. To convert between them for a ramp, roof or driveway, use the slope percentage calculator.

Common slopes with their angle, percent grade and rise-to-run ratio
Slope (m)AngleGradeRise : run
00°0%0 : 1
1/12 ≈ 0.08334.76°8.33%1 : 12
0.15.71°10%1 : 10
0.2514.04°25%1 : 4
0.526.57°50%1 : 2
145°100%1 : 1
1.732160°173.21%1.732 : 1
Undefined90°Undefined1 : 0

Practical applications of slope

Slope shows up any time one thing changes at a steady rate compared with another. Pick an example and move the slider to see the numbers change.

Diagram for the selected example

Slope examples

One worked pair of points for each type of slope. For more, see the slope examples page.

Rise, run, slope and line equation for four pairs of points
TypePoint 1Point 2Rise (Δy)Run (Δx)Slope (m)Equation
Positive(1, 2)(4, 8)8 − 2 = 64 − 1 = 36/3 = 2y = 2x
Negative(−1, 5)(3, −3)−3 − 5 = −83 − (−1) = 4−8/4 = −2y = −2x + 3
Fraction(−4, 5)(2, 1)1 − 5 = −42 − (−4) = 6−4/6 = −2/3y = −(2/3)x + 7/3
Zero(−4, 7)(6, 7)7 − 7 = 06 − (−4) = 100/10 = 0y = 7
Undefined(5, −2)(5, 6)6 − (−2) = 85 − 5 = 08/0, undefinedx = 5

Common mistakes to avoid

  • Putting x on topSlope is change in y over change in x. Flip it and you get a different line.
  • Switching the order halfwayUsing y₂ − y₁ with x₁ − x₂ flips the sign of the answer.
  • Dropping a negative signSubtracting a negative adds: 5 − (−3) = 8. Write the brackets in.
  • Calling a vertical line zero slopeHorizontal lines have slope 0. Vertical lines have an undefined slope.

Explore more coordinate geometry calculators

Tools for line equations, distance, midpoints and data trends, all with step-by-step answers.

Showing all 12 calculators

Worksheets and practice problems

Work a few problems by hand, then check each answer with the calculator above.

Slope worksheets

Printable sheets for finding slope from two points, from graphs and from equations.

Browse worksheets

Practice problems

Problems on positive, negative, zero and undefined slope, with the answers worked out.

Start practicing

Maintained by the SlopeCalculator.cc Editorial Team · Updated

Frequently asked questions

What is slope in math?

Slope, written as m, measures how steep a line is and which way it goes. It is the vertical change (rise) divided by the horizontal change (run) between any two points on the line.

How do you find the slope from two points?

Subtract the y-values to get the rise, subtract the x-values in the same order to get the run, then divide: m = (y₂ − y₁) / (x₂ − x₁). For (2, 3) and (6, 11), m = 8 / 4 = 2.

What is the slope formula?

The slope formula is m = (y₂ − y₁) / (x₂ − x₁), where (x₁, y₁) and (x₂, y₂) are two points on the line and x₂ is not equal to x₁.

What does a negative slope mean?

A negative slope means the line falls as you move from left to right. As x increases, y decreases.

What does a zero slope mean?

A zero slope means the line is horizontal. Every point has the same y-value, so the rise is 0 and m = 0. Its equation looks like y = 4.

Why is the slope of a vertical line undefined?

Every point on a vertical line has the same x-value, so the run is 0. The slope formula would divide by 0, which has no answer, so the slope is undefined. Its equation looks like x = 3.

How do you find the slope from an equation?

In slope-intercept form y = mx + b, the slope is the number in front of x. In standard form Ax + By = C, the slope is m = −A/B, as long as B is not 0.

Is slope the same as gradient?

Yes. In a two-dimensional graph, slope and gradient mean the same thing: rise over run. Gradient is the common term in the UK and Australia. Slope is the usual term in the US.

How do I convert slope to an angle or a percent?

For the angle, take the inverse tangent: angle = arctan(m). For percent grade, multiply by 100. A slope of 0.5 is about 26.57° and a 50% grade.

Can I enter fractions or negative numbers?

Yes. The calculator accepts whole numbers, decimals, fractions like 3/4, mixed numbers like 1 1/2 and negative values. Results stay exact as fractions where possible, with the decimal next to them.

References

Sources for the definitions, formulas and ramp figures on this page.

  1. Khan Academy. Slope. Algebra 1: Linear equations and graphs.
  2. Lumen Learning. 3.4: Slope of a Line. Elementary Algebra.
  3. LibreTexts Mathematics. 13.2.1: Finding the Slope of a Line. Developmental Math (NROC).
  4. U.S. Access Board. Guide to the ADA Standards, Chapter 4: Ramps and Curb Ramps. Sections 405.2 (running slope) and 405.6 (rise).