Skip to main content

Calcu.fit

Slope Calculator: Find the Slope, Angle, Grade, and Line Equation

Use this free slope calculator to find the slope of a line from two points. It also shows the angle, the percent grade, the distance and midpoint between the points, and the equation of the line. You can convert between slope, angle, grade, and ratio such as 1:12. Step-by-step working is included. No signup needed.

How to Use This Slope Calculator

From two points:

  1. Enter the first point (x₁, y₁).
  2. Enter the second point (x₂, y₂).
  3. Click Calculate.

From rise and run:

  1. Enter the rise (the vertical change) and the run (the horizontal change).
  2. Click Calculate.

From an angle, a percent grade, or a ratio:

  1. Choose the form you know (angle, percent, or ratio such as 1:12).
  2. Enter the value, and the calculator converts it to the others.

What You’ll See in Your Results

  • The slope (m) as a fraction and a decimal
  • The rise and the run
  • The angle of the line from the horizontal, in degrees
  • The percent grade
  • The distance and the midpoint between the two points
  • The equation of the line, in slope-intercept form (y = mx + b), when it exists
  • Steps using your numbers
  • A message for horizontal (slope 0) and vertical (undefined slope) lines

What Is Slope?

Slope measures how steep a line is. It tells you how much the line goes up or down (the rise) for each step across (the run).

Slope = Rise ÷ Run = (y₂ − y₁) ÷ (x₂ − x₁)

It is usually written as m.

SlopeWhat the line looks like
Positive (m > 0)Goes up from left to right
Negative (m < 0)Goes down from left to right
Zero (m = 0)Horizontal, flat
UndefinedVertical, since the run is 0

A larger absolute value of m means a steeper line.

Slope Formulas

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

Angle from the horizontal: θ = arctan(m)

Slope from an angle: m = tan(θ)

Percent grade: Grade = m × 100%

Distance between the points: d = √[(x₂ − x₁)² + (y₂ − y₁)²]

Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)

Slope-intercept form: y = mx + b, where b = y₁ − m × x₁

Point-slope form: y − y₁ = m(x − x₁)

Standard form: Ax + By = C, with slope −A ÷ B

Parallel lines: have the same slope

Perpendicular lines: have slopes whose product is −1, so m₂ = −1 ÷ m₁

Slope Calculator Examples

All answers are rounded for display.

Example 1: A Positive Slope

Points (1, 2) and (4, 8).

  • Rise = 8 − 2 = 6, and run = 4 − 1 = 3
  • m = 6 ÷ 3 = 2
  • Angle = arctan(2) ≈ 63.43°
  • Percent grade = 200%
  • Distance = √(3² + 6²) = √45 ≈ 6.708
  • Midpoint = (2.5, 5)
  • Equation: b = 2 − 2(1) = 0, so y = 2x

Example 2: A Negative Slope

Points (−2, 5) and (3, −5).

  • Rise = −5 − 5 = −10, and run = 3 − (−2) = 5
  • m = −10 ÷ 5 = −2
  • Angle ≈ −63.43° (the line goes down to the right)
  • Distance = √(5² + 10²) = √125 ≈ 11.18
  • Midpoint = (0.5, 0)
  • Equation: b = 5 − (−2)(−2) = 1, so y = −2x + 1

Example 3: A Horizontal Line

Points (2, 3) and (6, 3).

  • Rise = 0, and run = 4
  • m = 0 ÷ 4 = 0
  • Equation: y = 3

Example 4: A Vertical Line

Points (4, 1) and (4, 7).

  • Rise = 6, and run = 0
  • m = 6 ÷ 0 = undefined (you cannot divide by zero)
  • Equation: x = 4

A vertical line has no slope-intercept form.

Example 5: A Fractional Slope

Points (0, 0) and (5, 3).

  • m = 3 ÷ 5 = 0.6
  • Angle = arctan(0.6) ≈ 30.96°
  • Percent grade = 60%
  • Equation: y = 0.6x

Example 6: A Line That Does Not Pass Through the Origin

Points (−3, −2) and (1, 4).

  • m = (4 − (−2)) ÷ (1 − (−3)) = 6 ÷ 4 = 1.5
  • b = −2 − 1.5(−3) = −2 + 4.5 = 2.5
  • Equation: y = 1.5x + 2.5

Example 7: A Slope of −1

Points (1, 3) and (5, −1).

  • m = (−1 − 3) ÷ (5 − 1) = −4 ÷ 4 = −1
  • Angle = −45°
  • Equation: y = −x + 4

Example 8: Slope from an Equation

  • y = 3x − 7 has slope 3 and y-intercept −7.
  • 2x + 4y = 8: solve for y: y = −0.5x + 2, so the slope is −0.5. You can also use −A ÷ B = −2 ÷ 4 = −0.5.

Example 9: Point-Slope Form

A line has slope 3 and passes through (2, −1).

  • y − (−1) = 3(x − 2)
  • y + 1 = 3x − 6
  • y = 3x − 7

Example 10: Finding a Missing Coordinate

A line with slope 2 passes through (1, 3). Find y when x = 5.

  • y − 3 = 2(5 − 1) = 8
  • y = 11

Example 11: Parallel and Perpendicular Lines

Take the line y = 2x + 3 (slope 2).

  • A parallel line has slope 2.
  • A perpendicular line has slope −1 ÷ 2 = −0.5.
  • A line through (1, 1) that is perpendicular to it: b = 1 − (−0.5)(1) = 1.5, so y = −0.5x + 1.5.

Example 12: Angle to Slope

  • tan 45° = 1
  • tan 30° ≈ 0.5774
  • tan 60° ≈ 1.7321

Example 13: Percent Grade

A road rises 6 m over a horizontal distance of 100 m.

  • Slope = 6 ÷ 100 = 0.06
  • Percent grade = 6%
  • Angle = arctan(0.06) ≈ 3.43°

Example 14: A Hill

A hill rises 150 m over a horizontal distance of 2,000 m.

  • Slope = 150 ÷ 2,000 = 0.075
  • Percent grade = 7.5%
  • Angle ≈ 4.29°

Example 15: A Ramp (1:12)

A ramp with a ratio of 1:12 rises 1 unit for every 12 units of run.

  • Slope = 1 ÷ 12 ≈ 0.0833
  • Percent grade ≈ 8.33%
  • Angle ≈ 4.76°
  • For a rise of 30 inches, the run is 30 × 12 = 360 inches (30 feet).

A 1:12 slope is a common maximum for accessible ramps in some regions, such as in U.S. guidance. Local rules differ, so check your own building code.

Example 16: Roof Pitch

Roof pitch is often written as rise per 12 units of run.

  • 6:12 → slope = 0.5, angle ≈ 26.57°
  • 8:12 → slope ≈ 0.667, angle ≈ 33.69°

Slope, Angle, and Percent Grade Table

Percent gradeSlope (decimal)Angle
5%0.052.86°
8%0.084.57°
10%0.105.71°
15%0.158.53°
25%0.2514.04°
50%0.5026.57°
100%1.0045°

Percent grade and angle are not the same. A 100% grade is a 45° line, not a 90° line. A vertical line has an infinite grade.

How to Read Slope on a Graph

  • Choose two points on the line.
  • Count how far you go up (rise) and across (run) between them.
  • Divide the rise by the run.
  • If you go down, the rise is negative.
  • If you go left, the run is negative, so keep track of the direction.

The slope is the same for any two points on the same straight line.

Where Slope Is Used

  • School math: graphs, linear equations, and trigonometry
  • Construction: ramps, stairs, roof pitch, and drainage
  • Roads and railways: grade, which describes how steep they are
  • Land and hiking: how steep a hill or a path is
  • Science and data: the rate of change, such as speed from a distance-time graph
  • Business and statistics: trends, and the slope of a best-fit line

Common Mistakes

  • Mixing up the order. If you use (y₂ − y₁), you must use (x₂ − x₁) in the same order.
  • Dividing run by rise. Slope is rise ÷ run, not the other way.
  • Dropping a negative sign. Careful with negative coordinates, such as 5 − (−5) = 10.
  • Treating a vertical line as slope 0. A vertical line has an undefined slope, and a horizontal line has slope 0.
  • Confusing percent grade with degrees. A 10% grade is about 5.71°, not 10°.
  • Using the wrong units. Rise and run must use the same unit.
  • Rounding too early. Keep full precision until the end.

Tips for Using a Slope Calculator

  • Write down the points as (x, y) and check which is which.
  • Make a quick sketch to see if the slope should be positive, negative, zero, or undefined.
  • Check the answer with another way: substitute a point into y = mx + b.
  • For parallel and perpendicular lines, use the slope rules.
  • Use the same unit for rise and run.
  • For real projects, check the required slope in your local building code and ask a professional.

Slope Calculator vs. Other Tools

  • Scientific Calculator: trig, powers, roots, and logs.
  • Triangle Calculator: solve any triangle.
  • Quadratic Formula Calculator: solve ax² + bx + c = 0.
  • Fraction Calculator: add, subtract, multiply, and divide fractions.
  • Percent Error Calculator: how far a measurement is from the accepted value.

Frequently Asked Questions (FAQ)

How do I find the slope of a line?

Divide the change in y by the change in x between two points: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 8), the slope is (8 − 2) ÷ (4 − 1) = 2.

m = (y₂ − y₁) ÷ (x₂ − x₁), also written as rise over run.

The line goes down as you move from left to right. For example, the slope between (−2, 5) and (3, −5) is −2.

Zero. For example, the line through (2, 3) and (6, 3) has slope 0, and its equation is y = 3.

It is undefined, since the run is 0 and you cannot divide by zero. The equation of the line is x = a number, such as x = 4.

Find the slope m, then find b = y₁ − m × x₁, and write y = mx + b. For (1, 2) and (4, 8), the equation is y = 2x.

Use the arctangent: angle = arctan(m). A slope of 1 is 45°, and a slope of 0.6 is about 30.96°.

Multiply the slope by 100. A slope of 0.06 is a 6% grade.

 Percent grade is rise ÷ run × 100, while degrees measure the angle. A 100% grade is 45°, and a 10% grade is about 5.71°.

 Parallel lines have the same slope. Perpendicular lines have slopes that multiply to −1, so the perpendicular slope of 2 is −1/2.

If the equation is y = mx + b, the slope is m. For Ax + By = C, the slope is −A ÷ B.

Yes. It is free, with no registration and no limits.

It uses the standard formulas and the numbers you enter. Fractions are exact, and decimals and angles are rounded for display.

Disclaimer

This calculator is for general and educational use. Results are rounded for display. For building, ramps, roofs, roads, drainage, or any work that affects safety, check your local building codes and consult a qualified professional. Follow your teacher’s rules on the form of the answer.