Slope Calculator

Slope m = (y₂ − y₁) ÷ (x₂ − x₁), so the line through (2, 3) and (8, 7) has a slope of 4/6 = 2/3 (about 0.667), an angle of 33.69° and the equation y = (2/3)x + 5/3. You can also enter a rise and run for ramps and roofs, or find a point a set distance along a slope.

By the Calculators With Steps team · Updated November 10, 2026 · How we check our math

I know

Fractions (1/2) and negatives work.

Slope through (2, 3) and (8, 7)
m = 2/3
≈ 0.666667 · y = (2/3)x + 5/3
Slope as a decimal
0.666667Rising left to right
Rise / run
4 / 6
Angle of inclination
33.69°
Grade (percent)
66.67%
Distance between points
2√13 ≈ 7.211103
Midpoint
(5, 5)
y-intercept
(0, 5/3)
x-intercept
(-2.5, 0)
Step-by-step working
  1. Slope formula: m = (y₂ − y₁) ÷ (x₂ − x₁)
  2. Rise: y₂ − y₁ = 7 − 3 = 4
  3. Run: x₂ − x₁ = 8 − 2 = 6
  4. m = 4 ÷ 6 = 2/3 ≈ 0.666667
  5. y-intercept: b = y₁ − m × x₁ = 3 − (2/3) × 2 = 5/3
  6. Slope-intercept form: y = (2/3)x + 5/3
  7. Angle of inclination = arctan(0.666667) = 33.69°
  8. Distance = √((x₂ − x₁)² + (y₂ − y₁)²) = √(6² + 4²) = √52 = 2√13 ≈ 7.211103
  9. Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) = (5, 5)

Equation of the line

FormEquation
Slope-intercept (y = mx + b)y = (2/3)x + 5/3
Point-slope (y − y₁ = m(x − x₁))y − 3 = (2/3)(x − 2)
Standard (Ax + By = C)2x − 3y = -5

How to use the slope calculator

Choose what you know:

  • Two points: enter (x₁, y₁) and (x₂, y₂). Coordinates can be negative, decimals or fractions such as 1/2.
  • Rise and run: enter the vertical rise and horizontal run, for example a ramp, roof, driveway or hill.
  • A point, slope and distance: enter a starting point, the slope and how far to travel along the line to get the two points at that distance.

The two-point result shows the slope as a reduced fraction and a decimal, the rise and run, the angle, the percent grade, the distance and midpoint, both intercepts and the equation of the line in three forms.

The slope formula

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

  • m is the slope (gradient).
  • y₂ − y₁ is the rise, the change in height.
  • x₂ − x₁ is the run, the horizontal change.

It does not matter which point you call the first, as long as you subtract in the same order on the top and the bottom.

Worked example: (2, 3) and (8, 7)

Quantity Working Result
Rise 7 − 3 4
Run 8 − 2 6
Slope 4 ÷ 6 2/3 ≈ 0.666667
y-intercept 3 − (2/3) × 2 5/3
Angle arctan(2/3) 33.69°
Grade 2/3 × 100 66.67%
Distance √(6² + 4²) = √52 2√13 ≈ 7.211103
Midpoint ((2 + 8) ÷ 2, (3 + 7) ÷ 2) (5, 5)

The equation of the line in each form:

  • Slope-intercept: y = (2/3)x + 5/3
  • Point-slope: y − 3 = (2/3)(x − 2)
  • Standard: 2x − 3y = −5

The distance uses the Pythagorean theorem on the rise and run; the Pythagorean theorem calculator explains that step in more detail.

Positive, negative, zero and undefined slopes

Slope Line Example points Result
Positive Rises left to right (2, 3), (8, 7) 2/3
Negative Falls left to right (−2, 1), (4, −3) −2/3
Zero Horizontal (0, 4), (5, 4) 0, y = 4
Undefined Vertical (3, 2), (3, 9) x = 3

Slope as grade, angle and pitch

Builders, road engineers and roofers describe the same slope in different ways. Grade is the slope as a percentage (rise ÷ run × 100), the angle comes from the inverse tangent, and roof pitch is the rise for every 12 units of run.

Rise : run Slope Grade Angle
1 : 12 0.083333 8.33% 4.76°
1 : 4 0.25 25% 14.04°
4 : 12 roof 0.333333 33.33% 18.43°
6 : 12 roof 0.5 50% 26.57°
1 : 1 1 100% 45°
2 : 1 2 200% 63.43°

A 100% grade is a 45° angle, not a vertical wall, which surprises a lot of people. Because grade is a ratio, the percentage calculator and the ratio calculator are useful for related conversions.

Ramps. The ADA Standards for Accessible Design limit the running slope of a wheelchair ramp to 1:12. For a 30-inch rise, enter rise 30 and run 360 to confirm 8.33%.

Tips

  • Keep rise and run in the same unit. Mixing inches and feet makes the slope 12 times too big or too small.
  • The angle of inclination is measured counter-clockwise from the positive x-axis, so it runs from 0° up to (but not including) 180°. A negative slope gives an angle above 90°.
  • Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, such as 2/3 and −3/2.
  • To find the point a given distance along a line, use the third mode. From (2, 3) along a slope of 3/4, the points 10 units away are (10, 9) and (−6, −3).

Slope Calculator: frequently asked questions

How do you find the slope with two points?

Subtract the y-values, subtract the x-values in the same order, and divide: m = (y₂ − y₁) ÷ (x₂ − x₁). For (2, 3) and (8, 7), m = (7 − 3) ÷ (8 − 2) = 4 ÷ 6 = 2/3, about 0.666667.

What is the slope formula?

Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). The rise is the vertical change and the run is the horizontal change between two points on the line.

How do you convert a slope to a percentage?

Multiply the slope by 100. A ramp that rises 1 unit for every 12 units of run has a slope of 1/12, which is an 8.33% grade.

How do I convert a slope to degrees?

Take the inverse tangent of the slope: angle = arctan(rise ÷ run). A roof that rises 6 inches per 12 inches of run has a slope of 0.5, which is 26.57°.

What is the slope of a vertical or horizontal line?

A horizontal line has a slope of 0 because the rise is 0. A vertical line has an undefined slope because the run is 0 and you cannot divide by zero. The line through (3, 2) and (3, 9) is vertical, with equation x = 3.

How do I write the equation of a line from two points?

Find the slope, then the y-intercept b = y₁ − m × x₁, and write y = mx + b. For (2, 3) and (8, 7), m = 2/3 and b = 3 − (2/3) × 2 = 5/3, so y = (2/3)x + 5/3, or 2x − 3y = −5 in standard form.

What is the maximum slope for a wheelchair ramp?

The 2010 ADA Standards allow a running slope of no more than 1:12, an 8.33% grade or about 4.76°. A ramp that climbs 30 inches therefore needs at least 360 inches (30 feet) of run.

What does a negative slope mean?

The line falls as you move from left to right. The line through (−2, 1) and (4, −3) has a slope of −4 ÷ 6 = −2/3, and its angle of inclination is 146.31° measured from the positive x-axis.

How we checked this page: every figure in the examples and FAQs above is produced by this calculator and verified by automated tests against known answers, and the rules and rates come from the sources below. Last updated . Spotted a problem? Tell us.

Browse all math & statistics calculators →