Slope Calculator

Last updated October 2026

This slope calculator finds the slope of a line from two points, from a point and a slope, from an equation, or from a rise and a run. It also converts between slope, percent grade, degrees and a 1 : n ratio, and finds a missing coordinate. Every answer comes with a graph, a step-by-step solution and a check of the result, and no signup is needed.

Calculation

Slope from two points

Press Enter to calculate

Formula

How to Use This Slope Calculator

  1. Pick a tab. Two points gives the slope and the full line equation, Point and slope builds the equation from one point, From equation reads the slope from y = mx + b or Ax + By = C, and Rise and run is for ramps, roofs and roads.
  2. Convert grade switches between slope, percent grade, degrees and a 1 : n ratio. Missing point finds x₂ or y₂ when you know the slope.
  3. Type your numbers. Whole numbers, decimals and fractions such as 1/2 all work. In the Missing point tab you can type a slope as a percent, such as 12%.
  4. Click Calculate or press Enter. The Step-by-Step Solution box opens directly under the inputs, with a graph of the line.
  5. Follow the numbered steps and the Check your answer line, then use Copy result or Download PDF to keep the working.
  6. Click Reset to clear the inputs and start again.

Slopes that are whole numbers or fractions are found exactly, so 6 over 4 is shown as 3/2 and not as a rounded decimal. Angles and some distances are rounded to 10 significant digits and marked with the ≈ sign.

What the Step-by-Step Solution Shows

After you press Calculate, the answer box shows the method as well as the number.

What Is Slope?

Slope tells you how steep a line is and which way it leans. You find it by comparing how far the line moves up or down, the rise, with how far it moves across, the run. A line that rises 3 units while running 4 units has a slope of 3/4.

Different fields use different words for the same idea. Maths classes say slope or gradient, builders say pitch, and road engineers say grade. The slope is also the rate of change: the slope of a distance-time graph is speed, and the slope of a cost graph is the price per unit.

Slope Formula

m = rise / run = (y₂ − y₁) / (x₂ − x₁)

Types of Slope

SlopeWhat the line doesExample
Positive (m > 0)Rises from left to righty = 2x + 1
Negative (m < 0)Falls from left to righty = −x + 4
Zero (m = 0)Flat, a horizontal liney = 3
UndefinedStraight up and down, a vertical linex = 5

How to Find the Slope of a Line

  1. Pick two different points on the line and label them (x₁, y₁) and (x₂, y₂).
  2. Find the rise by subtracting the y values: y₂ − y₁.
  3. Find the run by subtracting the x values in the same order: x₂ − x₁.
  4. Divide the rise by the run, and simplify the fraction.
  5. Check the sign. If the line rises to the right the slope must be positive, and if it falls the slope must be negative.

If the run is 0, the line is vertical and the slope is undefined. If the rise is 0, the line is horizontal and the slope is 0.

Slope From an Equation

When a line is written in 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 standard form, Ax + By = C, solve for y to get y = (−A/B)x + C/B, so the slope is −A/B.

y = mx + b (slope m, y-intercept b) Ax + By = C so m = −A / B y − y₁ = m(x − x₁) (point-slope form)

Example: 3x + 4y = 12. Here A = 3 and B = 4, so the slope is −3/4. Solving for y gives y = −(3/4)x + 3, so the y-intercept is 3 and the x-intercept is 4.

Parallel and Perpendicular Lines

Slope, Percent Grade, Degrees and Ratio

Slope can be written four ways. Roads and ramps use a percent or a 1 : n ratio, and surveying uses degrees. They all describe the same steepness.

percent grade = 100 × slope angle in degrees = tan−1(slope) ratio 1 : n with n = 1 / slope
Ratio (rise : run)SlopePercent gradeAngle
1 : 200.055%2.86°
1 : 120.08338.33%4.76°
1 : 100.110%5.71°
1 : 80.12512.5%7.13°
1 : 60.166716.67%9.46°
1 : 40.2525%14.04°
1 : 20.550%26.57°
1 : 11100%45°

Degrees to percentage: percent = 100 × tan(angle). Percentage to degrees: angle = tan−1(percent / 100). Note that 100% is 45 degrees, not 90 degrees, and a vertical line has an infinite grade. The Convert grade tab does either conversion for you.

Ramp, Roof and Road Slopes

Worked Examples, Step by Step

Example 1: Slope between two points

Find the slope of the line through (1, 2) and (4, 8).

  1. Rise: 8 − 2 = 6
  2. Run: 4 − 1 = 3
  3. Slope: 6 / 3 = 2
  4. y-intercept: b = 2 − 2 × 1 = 0, so the line is y = 2x
m = 2, line y = 2x

Example 2: A negative slope

Find the slope through (−2, 5) and (4, −1).

  1. Rise: −1 − 5 = −6
  2. Run: 4 − (−2) = 6
  3. Slope: −6 / 6 = −1
  4. The line falls at 45 degrees. Its equation is y = −x + 3.
m = −1, line y = −x + 3

Example 3: A wheelchair ramp

A doorway is 30 inches above the ground and the ramp is 360 inches long on the ground. Is it a 1:12 ramp?

  1. Slope = rise / run = 30 / 360 = 1/12
  2. Percent grade = 100 × 1/12 = 8.33%
  3. Angle = tan−1(1/12) = 4.76 degrees
Slope 1/12, grade 8.33%, ratio 1 : 12

Example 4: Percent grade to degrees

A road sign shows an 8% grade. What is the angle?

  1. Slope = 8 / 100 = 0.08
  2. Angle = tan−1(0.08) = 4.57 degrees
  3. Ratio = 1 / 0.08 = 12.5, so it is a 1 : 12.5 slope
8% = 4.57 degrees = 1 : 12.5

Common Mistakes When Finding Slope

Limits and Rounding

Inputs can have up to 15 digits and a power of 10 from −100 to 100. Slopes, intercepts and equations are worked out exactly with fractions. Angles come from the inverse tangent and are rounded to 10 significant digits. Distances that are not whole numbers are shown as a rounded decimal. The equation box accepts linear equations in x and y only, without brackets.

Frequently Asked Questions

What is slope?
Slope is a number that measures how steep a line is. It is the rise (vertical change) divided by the run (horizontal change). A slope of 2 means the line goes up 2 units for every 1 unit it moves to the right.
What is the slope formula?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁). Subtract the y values for the rise, subtract the x values for the run in the same order, then divide.
How do I find the slope of a line from two points?
Write the points as (x₁, y₁) and (x₂, y₂), subtract to get the rise and the run, then divide. For (1, 2) and (4, 8) the rise is 6, the run is 3, and the slope is 2. The Two points tab shows each step.
What does a negative, zero or undefined slope mean?
A negative slope falls from left to right. A slope of 0 is a flat, horizontal line. An undefined slope belongs to a vertical line, because the run is 0 and you cannot divide by 0.
How do I convert slope to percent grade?
Multiply the slope by 100. A slope of 0.08 is an 8% grade, and a rise of 1 over a run of 12 is 8.33%. Use the Convert grade tab to switch between slope, percent, degrees and ratio.
How do I convert degrees to percentage?
Take the tangent of the angle and multiply by 100. For 10 degrees, tan(10°) is about 0.1763, so the grade is about 17.63%. To go from percent to degrees, divide by 100 and take the inverse tangent.
What does a 1:12 slope mean?
A 1:12 slope rises 1 unit for every 12 units of run. That is a slope of 1/12, a grade of 8.33% and an angle of about 4.76 degrees. It is the usual maximum for wheelchair ramps.
How do I find the slope from an equation?
If the equation is in the form y = mx + b, the slope is the number in front of x. For Ax + By = C, the slope is −A / B. The From equation tab accepts both forms.
How do I find the slope of a parallel or perpendicular line?
A parallel line has the same slope. A perpendicular line has the negative reciprocal slope, so a slope of 2 becomes −1/2. The From equation tab shows both.
Is slope the same as gradient?
Yes. Slope and gradient mean the same thing for a straight line. Gradient is more common in the UK, and slope is more common in the US. Roads and ramps often use the word grade for the same value written as a percent.

Related Calculators

Author

StepSolvers Team

StepSolvers is a free collection of step-by-step math calculators. The StepSolvers team builds every calculator to show its full working, not just the final answer, so you can follow each step and learn the method. About StepSolvers