Skip to content
Online Calculator & Converter

Slope Calculator

Choose how you know the line, then enter the values.

Use the same unit for every value.

Slope

Enter values to see the result.

What slope tells you

Slope measures steepness: how much a line rises for each unit it moves horizontally. It is used in algebra for straight-line equations and in practice for ramps, roofs, driveways, drainage and road grades.

Formulas

  • Slope: m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run.
  • Percent grade: m × 100.
  • Angle: θ = arctan(m), in degrees.
  • Distance: √(rise² + run²) (Pythagorean theorem).
  • Y-intercept: b = y₁ − m x₁, giving y = mx + b.

Worked examples

Two points: (1, 2) and (5, 10)

  1. Rise = 10 − 2 = 8; run = 5 − 1 = 4.
  2. m = 8 ÷ 4 = 2; grade = 200%; angle = arctan(2) ≈ 63.43°.
  3. b = 2 − 2 × 1 = 0, so the line is y = 2x. Distance = √(64 + 16) ≈ 8.944.

Wheelchair ramp, 1 in rise per 12 in run

  1. m = 1 ÷ 12 ≈ 0.08333.
  2. Grade ≈ 8.33%; angle = arctan(0.08333) ≈ 4.76°.

A 1:12 ratio is the maximum running slope for ramps in the 2010 ADA Standards for Accessible Design (section 405.2). Check the rules that apply to your location before building.

Interpreting results

A positive slope rises left to right; a negative slope falls; zero is flat. Percent grade is common for roads and site work, angle in degrees for surveying, and roof pitch is usually written as rise per 12 units of run (a 6/12 roof has slope 0.5, about 26.57°).

Common mistakes

  • Subtracting the coordinates in a different order on the top and bottom of the fraction, which flips the sign.
  • Mistaking percent grade for degrees. A 10% grade is only about 5.71°.
  • Measuring the sloped length instead of the horizontal run.

Assumptions

The calculator assumes a straight line and consistent units. For converting measurements first, use the length converter. For the area under a sloped roof section, see the area calculator.

Frequently asked questions

What is the difference between slope, grade and angle?

Slope is rise ÷ run as a ratio or decimal. Percent grade is that slope × 100. The angle is the inverse tangent of the slope. A 1-in-12 ramp has slope 0.0833, a grade of 8.33% and an angle of about 4.76°.

Why is the slope of a vertical line undefined?

The run is zero, and dividing by zero has no value. The line's angle is 90°.

Is a 100% grade a vertical wall?

No. A 100% grade means rise equals run, which is a 45° angle. A vertical wall would have an infinite grade.