slope calculator
Slope Calculator – Find Slope, Equation & Angle | CalcSolver Free

Home › Slope Calculator

Slope Calculator

A slope calculator finds how steep a line is. Enter two points and it applies m = (y₂ − y₁) ÷ (x₂ − x₁) (rise over run), then shows the slope as a fraction and a decimal, the line’s equation, its angle and percent grade, both intercepts and a graph, with every step written out.

Try:
Key takeaways
  • Slope = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁).
  • Positive slope rises, negative falls, zero is flat, and a vertical line is undefined.
  • Percent grade = slope × 100, and angle = arctan(slope).
  • Parallel lines share a slope; perpendicular slopes are negative reciprocals.

On this page: What is slopeFormulaHow to find slopeTypesEquation formsParallel & perpendicularPercent & anglePracticeFAQ

What is slope?

Slope measures how steeply a line rises or falls as you move from left to right. It is written as m and is also called the gradient. A slope of 2 means the line goes up 2 units for every 1 unit it moves right. A slope of −1/2 means it goes down 1 unit for every 2 units across.

Slope formula

m = y₂ − y₁x₂ − x₁ = riserun = ΔyΔx

(x₁, y₁) and (x₂, y₂) are any two points on the line. Subtract in the same order on top and bottom. If you swap the points on both, the answer stays the same. The slope also equals tan(θ), where θ is the angle the line makes with the x-axis.

How to find the slope of a line from two points

  1. Find the rise: Δy = y₂ − y₁.
  2. Find the run: Δx = x₂ − x₁ (same order).
  3. Divide: m = Δy ÷ Δx, then simplify.

Example: points (2, 3) and (7, −9). Rise = −9 − 3 = −12. Run = 7 − 2 = 5. Slope m = −12/5 = −2.4. The line falls steeply from left to right. Use the calculator’s “Show steps” panel to see this for any pair of points, including fractions and decimals.

Slope from a graph: pick two points that sit on grid crossings, count the squares up or down (rise) and across (run), then divide.

Types of slope

TypeLine looks likeValueExample points
PositiveRises left to rightm > 0(1,2), (4,8) → 2
NegativeFalls left to rightm < 0(0,5), (5,0) → −1
ZeroHorizontal (y = c)m = 0(3,4), (9,4) → 0
UndefinedVertical (x = c)run = 0(5,−2), (5,8) → undefined

Avoid saying a vertical line has “no slope”, since that could mean zero or undefined. Say undefined.

Slope and the equation of a line

FormEquationSlope
Slope-intercepty = mx + bm (the number in front of x)
Point-slopey − y₁ = m(x − x₁)m
StandardAx + By = C−A ÷ B

Example: 6x − 2y = 12. Solve for y: −2y = −6x + 12, so y = 3x − 6. The slope is 3 and the y-intercept is −6. The x-intercept is found by setting y = 0, which gives x = 2. Type any equation into the “Equation” tab to check your work.

Parallel and perpendicular lines

Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, so the slope is the negative reciprocal: −1 ÷ m. A line with slope −4 has a perpendicular line with slope 1/4. A horizontal line (slope 0) is perpendicular to a vertical line (undefined). The calculator lists both slopes for your line.

Slope as percent grade, angle and ratio

Roads, ramps and roofs use different units for the same idea: grade % = m × 100, angle = arctan(m), and ratio 1 : N where N = 1 ÷ m. Use the “Slope ↔ angle / grade” tab to convert instantly.

Slope (m)Percent gradeAngleRatio
1/20 = 0.055%2.86°1 : 20
1/12 ≈ 0.08338.33%4.76°1 : 12
1/10 = 0.110%5.71°1 : 10
1/4 = 0.2525%14.04°1 : 4
1/2 = 0.550%26.57°1 : 2
1100%45°1 : 1
2200%63.43°1 : 0.5

Accessibility guidelines for wheelchair ramps commonly use a maximum slope of 1:12 (8.33%), but always check your local building code. Roof pitch is the rise per 12 units of run, so a 6/12 roof has a slope of 0.5.

Practice problems

Find the slope for each pair, then check with the calculator.

1. (0, 0) and (3, 6)

Rise 6 ÷ run 3 = 2.

2. (−2, 5) and (4, −1)

Rise −6 ÷ run 6 = −1.

3. (3, 4) and (9, 4)

Rise 0 ÷ run 6 = 0 (horizontal).

4. (5, −2) and (5, 8)

Run is 0, so the slope is undefined (vertical).

5. (1/2, 1) and (5/2, 4)

Rise 3 ÷ run 2 = 3/2.

Common mistakes

Mixing the order of subtraction (y₂ − y₁ on top but x₁ − x₂ on the bottom), putting run over rise, dropping a minus sign when a coordinate is negative, and rounding before the last step.

Frequently asked questions

How do you find the slope between two points?

Subtract the y-values to get the rise, subtract the x-values in the same order to get the run, then divide: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 8) the slope is 6 ÷ 3 = 2.

What is the slope formula?

m = (y₂ − y₁) ÷ (x₂ − x₁), also written rise over run or Δy ÷ Δx.

What is the slope of a vertical line?

Undefined. The run is 0, and division by zero is not allowed.

What is the slope of a horizontal line?

Zero, because the rise is 0.

How do you find the slope from an equation?

Rewrite it as y = mx + b; the number in front of x is the slope. For Ax + By = C, the slope is −A ÷ B.

How do you turn slope into a percent or an angle?

Percent grade = slope × 100. Angle = arctan(slope). A slope of 0.5 is a 50% grade and about 26.57°.

What is the slope of a perpendicular line?

The negative reciprocal, −1 ÷ m. If m = 2, the perpendicular slope is −1/2.

Last updated: December 2026. Need other tools? Try the free scientific calculator.

Scroll to Top