Calculate slope from two points, rise and run, or angle and grade, and find the line equation and roof pitch in feet or metric units.

Slope Calculator

Two Points
Rise / Run
Angle & Grade

Enter two points to find the slope and line equation.

Enter all four coordinates. x₁ and x₂ must differ.
Enter both rise and run. Run cannot be zero.
Enter a valid value.
Show how this is calculated ▾
⧉ Copy result

Slope Formula

The slope calculator uses the slope as the central value, then converts that slope to angle, grade, roof pitch, and a line equation when enough information is provided.

m = (y_2 - y_1) / (x_2 - x_1)
b = y_1 - m*x_1
y = m*x + b
m = rise / run
angle = arctan(m)
grade = 100*m
pitch = 12*m
  • m is the slope, or rise divided by run.
  • x₁, y₁ are the coordinates of the first point.
  • x₂, y₂ are the coordinates of the second point.
  • b is the y-intercept of the line.
  • rise is the vertical change.
  • run is the horizontal change.
  • angle is the angle of the line measured from horizontal.
  • grade is the slope written as a percentage.
  • pitch is the rise per 12 units of run, commonly used for roofs.

In two-point mode, the calculator finds the slope from the coordinate difference, then uses the slope and one point to find the line equation. In rise/run mode, it converts the rise and run to the same base unit before dividing them. In angle and grade mode, it converts the value you enter into slope first, then calculates the matching angle, grade, and roof pitch.

Common Slope, Grade, Angle, and Pitch Equivalents

Slope m Grade Angle Roof pitch Meaning
0 0% 0-in-12 Flat
0.0833 8.33% 4.76° 1-in-12 Common ramp reference
0.25 25% 14.04° 3-in-12 Low roof pitch
0.5 50% 26.57° 6-in-12 Moderate roof pitch
1 100% 45° 12-in-12 Rise equals run

How to Read Positive, Negative, Zero, and Undefined Slopes

Slope type Condition Interpretation
Positive m > 0 The line rises from left to right.
Negative m < 0 The line falls from left to right.
Zero m = 0 The line is horizontal.
Undefined x₂ = x₁ or run = 0 The line is vertical, so slope cannot be calculated as rise divided by zero.

Example Calculations

Example 1: Find slope from two points

Find the slope of the line through the points (2, 3) and (6, 11).

m = (11 - 3) / (6 - 2)
m = 8 / 4 = 2

The slope is 2. The y-intercept is:

b = 3 - 2*2 = -1

The line equation is y = 2x - 1.

Example 2: Convert a roof pitch to slope and grade

Convert a 6-in-12 roof pitch to slope and grade.

m = 6 / 12 = 0.5
grade = 100*0.5 = 50%

The slope is 0.5, the grade is 50%, and the angle is about 26.57°.

FAQ

What does slope mean?

Slope measures how much a line rises or falls for each unit it moves horizontally. A slope of 2 means the line rises 2 units for every 1 unit of run. A slope of -2 means it falls 2 units for every 1 unit of run.

Why is the slope undefined for a vertical line?

A vertical line has no horizontal change, so the run is 0. Since slope is rise divided by run, calculating the slope would require division by zero. Division by zero is undefined, so the slope of a vertical line is undefined.

What is the difference between slope, grade, and angle?

Slope is the ratio of rise to run. Grade is the same ratio written as a percentage. Angle is the tilt measured in degrees from a horizontal line. For example, a slope of 0.5 is a 50% grade and has an angle of about 26.57°.