Slope Calculator

Find the slope (gradient) from two points or from rise and run, with the line equation, angle and percent grade.

Point 1

Point 2

Slope (m)–

Slope Calculator: Find the Slope of a Line

Slope tells you how steep a line is. In maths class it’s the “m” in y = mx + b. On a building site it’s the fall on a drainage pipe or the pitch of a roof.

On a hill it’s the gradient you see on a road sign. It’s the same idea every time: how much something goes up (or down) for each step across.

This free slope calculator works it out two ways. Enter two points to get the slope, the equation of the line in slope-intercept form, the y-intercept, the angle and the distance between the points, with the working shown.

Or enter the rise and run to get the slope as a percentage, an angle, a ratio and a roof pitch. In the UK, slope is usually called gradient, and this works as a gradient calculator too.

How to Use the Slope Calculator

  • Two points: enter the coordinates (x₁, y₁) and (x₂, y₂). Decimals and negative numbers are fine.
  • Rise and run: enter how far something goes up (rise) and how far it goes across (run), in the same units.

The result updates as you type, and the working underneath shows each step, which is handy for checking homework.

Slope Formula

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

Put simply, slope = rise ÷ run: the change in y divided by the change in x.

Example: slope from two points

For the points (1, 2) and (4, 8): m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. The line goes up 2 units for every 1 unit across.

For (−2, 3) and (4, −1): m = (−1 − 3) ÷ (4 − (−2)) = −4 ÷ 6 = −2/3. A negative slope means the line goes down from left to right.

Slope-Intercept Form (y = mx + b)

Once you have the slope, find the y-intercept b by putting one point into the equation: b = y₁ − m × x₁.

For (−2, 3) with m = −2/3: b = 3 − (−2/3 × −2) = 3 − 4/3 = 5/3, or about 1.667. So the line is y = −2/3x + 5/3.

Types of Slope

SlopeWhat the line does
Positive (m > 0)Goes up from left to right
Negative (m < 0)Goes down from left to right
Zero (m = 0)Flat, horizontal line (y = a number)
UndefinedVertical line (x = a number), because you can’t divide by zero

Slope as a Percentage, Angle and Ratio

  • Percent grade = slope × 100. A rise of 6 m over 100 m is a 6% grade.
  • Angle = arctan(slope). A slope of 1 (100%) is 45°, not 90°. A common mix-up.
  • Ratio = 1 : (run ÷ rise). A slope of 1/12 is a 1 : 12 ratio.
  • Roof pitch = slope × 12, written as “x in 12” (inches of rise per 12 inches of run).
SlopePercentAngleRatio
1/1001%0.57°1 : 100
1/205%2.86°1 : 20
1/128.33%4.76°1 : 12
1/1010%5.71°1 : 10
1/425%14.04°1 : 4
1/250%26.57°1 : 2
1100%45°1 : 1

Where Slope Is Used

  • Maths and science: straight-line graphs, rates of change and speed-time graphs.
  • Ramps: wheelchair ramps are often limited to a gentle slope such as 1 : 12. Check the building rules where you live.
  • Roofs: roof pitch is the slope of the roof, often given as “x in 12” in the US or as an angle in the UK.
  • Drainage and paving: pipes, patios and driveways need a small fall so water runs away.
  • Roads, cycling and running: a 10% hill rises 10 m for every 100 m across.

Frequently Asked Questions

How do you find the slope with two points?

Subtract the y-values, subtract the x-values in the same order, then divide: m = (y₂ − y₁) ÷ (x₂ − x₁).

What is the slope of a horizontal line?

Zero. The y-value doesn’t change, so the rise is 0.

What is the slope of a vertical line?

Undefined. The x-value doesn’t change, so you would be dividing by zero.

Is gradient the same as slope?

Yes. “Gradient” is the usual word in the UK, Ireland and Australia, and “slope” in the US. Both mean rise ÷ run.

How do I turn a slope into degrees?

Take the inverse tangent: angle = arctan(slope). For a 1 in 12 slope, arctan(1/12) = 4.76°.

Need to know where two lines cross? Enter both equations in the System of Equations Calculator to get the intersection point and a graph of the lines.

More free tools from our Math Calculators collection:

Tahir Mehmood

About the author

Tahir Mehmood

Tahir Mehmood is the founder of Digital Designs SEO LTD, a UK company, with five years of hands-on experience in SEO, content writing and web development. He builds and maintains the calculators on All in Calculators and keeps them up to date. Spotted an error? Contact us and we will fix it.

Last updated: 27 November 2026