Slope Calculator

Enter two points to get the slope of the line through them: m = rise ÷ run, as a decimal and a fraction, together with the angle, the percent grade, the equation y = mx + b, the distance between the points and the midpoint. A small graph shows the line with its rise and run.

Runs in your browser — nothing is uploadedUseful for:School studentsUniversity studentsAt work

The converter below turns one way of describing steepness into the others: percent grade for roads and ramps, degrees, a 1 : n ratio and roof pitch in inches of rise per 12 inches of run.

How to use it

  1. Enter the coordinates of two points: x₁, y₁ and x₂, y₂.
  2. Read the slope, angle, grade and equation; the graph changes as you type.
  3. To convert a steepness, choose what you know: percent, degrees, ratio or roof pitch.
  4. Enter the value to see it in every other form.

Common uses

  • Homework on linear functions, gradients and equations of lines.
  • Checking the grade of a road, a ramp or a driveway.
  • Working out the pitch and the angle of a roof.
  • Planning drainage, paths and other gentle slopes.

Examples

InputResult
(1, 2) and (4, 8)m = 2, angle 63.43°, y = 2x + 0
(0, 3) and (4, 1)m = −1/2 = −0.5, y = −0.5x + 3
10% grade5.71°, 1 : 10, pitch 1.2/12
Roof pitch 6/1250% grade, 26.57°

Frequently asked questions

How do you find the slope from two points?

Divide the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 8), m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. A positive slope rises from left to right, a negative one falls.

What is a percent grade?

The rise for every 100 units of horizontal distance. A 10% grade rises 10 m over 100 m, an angle of about 5.71°. A 100% grade is 45°, not a vertical wall.

What is roof pitch?

The rise of a roof for every 12 units of run, written like 6/12 or 6:12. A 6/12 roof rises 6 inches for every 12 inches across, which is a 50% grade or about 26.6°.

What happens with a vertical line?

When both points have the same x, the run is zero and the slope is undefined. The equation of the line is then x = constant, and its angle is 90°.