Slope Calculator (Free Step-by-Step Tool)

AlgebraFreeNo sign-up

A slope calculator divides the rise by the run: m = (y₂ − y₁) / (x₂ − x₁). For the points (1, 2) and (4, 8), the rise is 8 − 2 = 6 and the run is 4 − 1 = 3, so the slope is 6 ÷ 3 = 2. The line is y = 2x. It climbs at about 63.43°, which is a 200% grade.

Slope calculator: what do you know?
Point 1
Point 2
Coordinates can be whole numbers, decimals or fractions such as 3/4.
Try:
Slope
m = 2/3≈ 0.6667rises left to right

The slope of the line through (−3, 1) and (3, 5) is 4 / 6 = 2/3. Its equation is y = (2/3)x + 3.

Rise (Δy)4
Run (Δx)6
Slope m2/3
Decimal≈ 0.6667
Angle≈ 33.69°
Percent grade≈ 66.67%
Parallel slope2/3
Perpendicular slope−3/2

Equation of the line

Slope-intercept formy = (2/3)x + 3
Point-slope formy − 1 = (2/3)(x + 3)
Standard form2x − 3y = −9
y-intercept3 (0, 3)
x-intercept−9/2 (−9/2, 0)

Distance and midpoint

Distance√52 = 2√13 ≈ 7.2111
Midpoint(0, 3)
Perpendicular bisectory = −(3/2)x + 3
−444xyrun = 6rise = 4(−3, 1)(3, 5)Green: the line. Gold: rise and run. Blue dashed: the perpendicular bisector through the midpoint.
Show steps
  1. Label the points: (x₁, y₁) = (−3, 1) and (x₂, y₂) = (3, 5).
  2. Rise = y₂ − y₁ = 5 − 1 = 4. Run = x₂ − x₁ = 3 − (−3) = 6.
  3. Slope m = rise ÷ run = 4 ÷ 6 = 2/3 (simplified by dividing top and bottom by 2), or about 0.6667. Positive: the line rises from left to right.
  4. y-intercept: b = y₁ − m×x₁ = 1 − (2/3) × (−3) = 3. So the slope-intercept form is y = (2/3)x + 3.
  5. Point-slope form with point 1: y − y₁ = m(x − x₁) gives y − 1 = (2/3)(x + 3).
  6. Distance = √(run² + rise²) = √(6² + 4²) = √52 = 2√13 ≈ 7.2111. Midpoint = average of the coordinates = (0, 3).
  7. Angle with the x-axis: θ = arctan(m) = arctan(2/3) ≈ 33.69°. Percent grade: m × 100 ≈ 66.67% (rise per 100 units of run).
  8. Parallel lines have the same slope, 2/3. Perpendicular lines have the negative reciprocal: −1 ÷ (2/3) = −3/2. Check: (2/3) × (−3/2) = −1.

Slope Calculator (Free Step-by-Step Tool)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the slope calculator

  1. Pick what you know: Two points, an Equation of the line, a Point & slope, or a rise, run, percent grade, angle or roof pitch (Grade & angle).
  2. Type the numbers. Coordinates can be whole numbers, decimals or fractions such as 3/4. The answer updates as you type.
  3. Read the slope as a fraction and a decimal, then the angle, percent grade, parallel and perpendicular slopes, the equation in three forms and both intercepts. For two points you also get the distance, the midpoint and the perpendicular bisector.
  4. Check the graph, which shows the rise and run, and open Show steps for the full working.

The slope formula

m = (y₂ − y₁) / (x₂ − x₁) = rise / run. Here (x₁, y₁) and (x₂, y₂) are two points on the line, the rise Δy is the vertical change and the run Δx is the horizontal change. The slope tells you how much y changes when x goes up by 1. You can subtract in either order, as long as you use the same order on top and bottom.

Slope Line Example
Positive Rises from left to right (1, 2) to (4, 8): m = 2
Negative Falls from left to right (−2, 5) to (6, −1): m = −3/4
Zero Horizontal, y = b (−4, 2) to (5, 2): m = 0
Undefined Vertical, x = a (3, −1) to (3, 7): the run is 0

A vertical line has an undefined slope because the run is 0, and you cannot divide by 0. A horizontal line has a slope of 0 because the rise is 0. “Zero slope” and “no slope” are not the same thing.

Worked examples

Example 1: slope and equation from two points

For (−3, 1) and (3, 5): rise = 5 − 1 = 4 and run = 3 − (−3) = 6, so m = 4/6 = 2/3. The y-intercept is b = 1 − (2/3)(−3) = 1 + 2 = 3. Slope-intercept form: y = (2/3)x + 3. Point-slope form: y − 1 = (2/3)(x + 3). The angle is arctan(2/3) ≈ 33.69°.

Example 2: slope from an equation

For 2x + 3y = 12, solve for y: 3y = −2x + 12, so y = −(2/3)x + 4. The slope is −2/3 and the y-intercept is 4. The shortcut for Ax + By = C is m = −A/B = −2/3.

Example 3: a perpendicular line through a point

Find the line through (2, −1) that is perpendicular to y = (2/3)x + 3. The perpendicular slope is the negative reciprocal, −3/2. Then −1 = (−3/2)(2) + b gives b = 2, so the line is y = −(3/2)x + 2.

Finding slope from an equation

  • Slope-intercept form y = mx + b: the slope is the number in front of x. In y = −4x + 7, m = −4.
  • Standard form Ax + By = C: m = −A/B. In 5x − 2y = 10, m = −5/(−2) = 5/2.
  • Point-slope form y − y₁ = m(x − x₁): the slope is the number in front of the bracket. In y − 2 = 3(x + 1), m = 3.
  • x = a is vertical (undefined slope) and y = b is horizontal (slope 0).

Parallel and perpendicular slopes

Parallel lines have equal slopes. Perpendicular lines have slopes that are negative reciprocals, so their product is −1: a line with slope 2/3 is perpendicular to any line with slope −3/2, because (2/3) × (−3/2) = −1. The one exception is a horizontal line and a vertical line, which are perpendicular even though the vertical slope is undefined.

Slope as percent grade, angle and pitch

Roads, ramps and roofs describe slope in other units. All of them come from m = rise ÷ run:

  • Percent grade = m × 100. A road that rises 5 ft over 100 ft has a 5% grade.
  • Angle θ = arctan(m). A slope of 1 is 45°, so a 100% grade is 45°, not 90°.
  • Roof pitch = rise per 12 of run = 12 × m. A 4/12 roof has slope 1/3.
  • Ratio 1 : n, where n is the run for one unit of rise. The ADA Standards limit the running slope of ramp runs to 1:12 (about 8.33%), so a ramp that rises 2 ft needs at least 24 ft of run.
Slope m Percent grade Angle Roof pitch Ratio
0.05 5% 2.86° 0.6 in 12 1 : 20
1/12 8.33% 4.76° 1 in 12 1 : 12
1/4 25% 14.04° 3 in 12 1 : 4
1/3 33.33% 18.43° 4 in 12 1 : 3
1/2 50% 26.57° 6 in 12 1 : 2
1 100% 45° 12 in 12 1 : 1
2 200% 63.43° 24 in 12 1 : 0.5

Distance and midpoint between the two points

The same rise and run give the length of the segment by the Pythagorean theorem: d = √(run² + rise²). For (−3, 1) and (3, 5), d = √(36 + 16) = √52 = 2√13 ≈ 7.211. The midpoint averages the coordinates: ((−3 + 3)/2, (1 + 5)/2) = (0, 3).

Common mistakes to avoid

  • Mixing the order. (5 − 1)/(−3 − 3) gives −2/3 instead of 2/3. Subtract in the same order on top and bottom.
  • Run over rise. The change in y goes on top.
  • Losing a negative sign. 3 − (−3) is 6, not 0.
  • Calling a vertical line “slope 0”. Vertical is undefined; horizontal is 0.
  • Reading the slope from standard form directly. In 2x + 3y = 12, the slope is −2/3, not 2.
  • Treating percent grade as degrees. A 10% grade is only about 5.71°.

Using the calculator for homework

Work the problem by hand first, then enter the same numbers and compare. If your answer differs, open the steps and find the first line that does not match. Before you trust any answer, estimate: if the line goes up from left to right, the slope must be positive. Keep fractions exact until the last step, and round only the decimal and the angle.

Sources

Slope practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. What is the slope of the line through (2, 3) and (5, 9)?

Found a mistake? Let us know!

2. What is the slope of the line through (−1, 2) and (3, −4)?

Found a mistake? Let us know!

3. What is the slope of the line through (4, 1) and (4, 9)?

Found a mistake? Let us know!

4. What is the slope of the line 3x + 4y = 8?

Found a mistake? Let us know!

5. A line has slope 2/5. What is the slope of a line perpendicular to it?

Found a mistake? Let us know!

6. Which equation is the line through (1, −2) with slope 3?

Found a mistake? Let us know!

7. A road rises 30 m over a horizontal distance of 600 m. What is its percent grade?

Found a mistake? Let us know!

8. What angle does a line with slope 1 make with the x-axis?

Found a mistake? Let us know!

9. A ramp must rise 3 ft. With a slope of 1:12, how long must the run be?

Found a mistake? Let us know!

10. What is the distance between (0, 0) and (6, 8), and the midpoint?

Found a mistake? Let us know!

Frequently asked questions

How do you calculate slope with two points?

Subtract the y-coordinates and the x-coordinates in the same order, then divide: m = (y₂ − y₁)/(x₂ − x₁). For (1, 2) and (4, 8), m = (8 − 2)/(4 − 1) = 6/3 = 2.

Is slope rise over run?

Yes. Rise is the vertical change (Δy) and run is the horizontal change (Δx). A line that goes up 3 units for every 4 units across has a slope of 3/4.

How do you calculate slope percentage?

Multiply the slope by 100. A rise of 5 ft over a run of 100 ft is 5/100 = 0.05, which is a 5% grade.

How do you calculate the slope angle in degrees?

Take the inverse tangent of the slope: θ = arctan(m). A slope of 1 gives 45°, a slope of 2 gives about 63.43°, and a slope of 1/12 gives about 4.76°.

How do you calculate the slope of a ramp?

Divide the height by the horizontal length, in the same units. A ramp that rises 2 ft over 24 ft has a slope of 2/24 = 1/12, about 8.33%, which is the 1:12 maximum in the ADA Standards for ramp runs.

How do you calculate slope in Excel?

Put the x-values in one range and the y-values in another, then use =SLOPE(known_y's, known_x's). With x-values in A1:A2 and y-values in B1:B2, type =SLOPE(B1:B2, A1:A2). Note that the y-values come first.

Related calculators

More algebra calculators

Browse all 206 calculators

Related to This Article

What people say about "Slope Calculator: Two Points, Equation, Grade & Angle"?

No one replied yet.

Leave a Reply