Calculator Bar

Slope Calculator

Slope Calculator

—

Slope formula

Slope measures how steep a line is: how much it goes up (the rise) for each step across (the run).

m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run

How to find the slope from two points

  1. Label the points (x₁, y₁) and (x₂, y₂). It doesn't matter which one is first.
  2. Subtract the y values: y₂ − y₁. That's the rise.
  3. Subtract the x values in the same order: x₂ − x₁. That's the run.
  4. Divide rise by run and simplify the fraction.

Example: from (1, 2) to (4, 8), the rise is 8 − 2 = 6 and the run is 4 − 1 = 3, so m = 6 ÷ 3 = 2. Then b = 2 − 2 × 1 = 0, so the line is y = 2x.

Positive, negative, zero and undefined slope

SlopeThe line…Example
Positiverises from left to rightm = 2/3
Negativefalls from left to rightm = −4
Zerois flat (horizontal)y = 3
Undefinedis straight up and down (vertical)x = 2

Writing the equation of the line

Once you have the slope m, you can write the line two common ways:

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

For the points (2, 3) and (5, 5): m = 2/3, b = 3 − 2/3 × 2 = 5/3, so y = (2/3)x + 5/3, or in point-slope form y − 3 = (2/3)(x − 2).

Slope as percent grade and angle

Builders and road engineers usually describe slope as a percent grade or an angle instead of a fraction:

Grade (%) = rise ÷ run × 100 Angle = arctan(rise ÷ run)
GradeRatio (rise : run)AngleWhere you see it
2%1 : 501.15°Typical patio drainage, about ¼ inch per foot
5%1 : 202.86°Gentle walkway
8.33%1 : 124.76°Steepest ADA wheelchair ramp
10%1 : 105.71°Steep road
50%1 : 226.57°A 6/12 roof pitch
100%1 : 145°Rise equals run

Wheelchair ramps: the 2010 ADA Standards (section 405.2) limit a ramp's running slope to 1:12.

Frequently asked questions

What does a slope of 2/3 mean?

The line rises 2 units for every 3 units it moves to the right. As a decimal that's about 0.667, as a percent grade 66.7%, and as an angle about 33.7° above horizontal.

Can a slope be a fraction?

Yes, and in algebra it's usually left as a fraction in lowest terms, such as 2/3 rather than 0.6667, because the fraction is exact. This calculator gives both.

What is the slope of a vertical line?

It's undefined. A vertical line has no run (x doesn't change), and you can't divide by zero. Its equation is written as x = a number, such as x = 2. A horizontal line has slope 0.

How do you convert slope to degrees?

Take the inverse tangent (arctan) of the slope. A slope of 1 is 45°, a slope of 0.5 is about 26.57°, and a slope of 1/12 is about 4.76°.

What is the maximum slope for a wheelchair ramp?

Under the 2010 ADA Standards for Accessible Design, a ramp's running slope can't be steeper than 1:12, which is 1 inch of rise for every 12 inches of run. That's about 8.33% or 4.76°. Use the Rise & run tab to check a ramp.

See also

Last updated: November 16, 2026