HelpMeHowTo
Slope of a line calculator
No login · No sign‑up

Slope calculator

Enter two points and get the slope. If the x‑values are the same, the line is vertical and the slope is undefined.

Fill all four values and click calculate.

How this slope calculator works

Slope measures how steep a line is. This calculator uses the standard two‑point formula.

Slope (m) = (y₂ − y₁) ÷ (x₂ − x₁)

Important edge case

Quick interpretation

Worked example

Example: Point 1 = (1, 2), Point 2 = (5, 10).
Slope m = (10 − 2) ÷ (5 − 1) = 8 ÷ 4 = 2. That means y increases by 2 for every +1 in x.

What to do after you know the slope

Quick FAQ

Units and meaning

Slope is “change in y per change in x.” If y is dollars and x is hours, the slope is dollars/hour. If y is miles and x is time, the slope is miles per unit time.

Common forms you’ll see

  • y = mx + b (slope‑intercept form)
  • y − y₁ = m(x − x₁) (point‑slope form)
  • Ax + By = C (standard form; you can solve for slope if B ≠ 0)

Finding the y‑intercept (b)

If you know the slope m and one point (x₁, y₁), you can solve for b in y = mx + b:

b = y₁ − m·x₁

That’s useful when you want the full line equation, not just how steep it is.

Sanity checks

  • If both points are identical, there isn’t a unique line (infinitely many lines go through one point).
  • If you swap the two points, the slope should stay the same (the numerator and denominator both flip signs).

Common mistakes

  • Mixing up x and y: Keep the points aligned: (x₁, y₁) and (x₂, y₂). Swap both together if you swap.
  • Forgetting negative signs: Subtract carefully: y₂ − y₁ and x₂ − x₁.
  • Assuming slope is always a whole number: Slopes can be fractions or decimals (for example, 1/2).

Graphing tip

If you have slope m = rise/run, start at a point, then move run units along x and rise units along y to find the next point.