Slope Calculator

Enter two points and get the slope of the line through them, as a simplified fraction and a decimal, with the rise-over-run steps.

First point (x₁, y₁):

Second point (x₂, y₂):

Advertisement

How to use this calculator

Type the coordinates of two points and press Calculate. The calculator applies the slope formula, simplifies the fraction, and reports the rise and run separately, so a slope of 4/3 reads as “up 4, right 3.” Vertical lines are reported as undefined, not as an error.

How it works

Slope = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁). It measures steepness and direction: positive slopes climb left-to-right, negative slopes fall, zero is flat, and a zero run (x₁ = x₂) means a vertical line whose slope is undefined.

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

Worked example

Example: through (1, 2) and (4, 6)

Step 1, Rise: 6 − 2 = 4.

Step 2, Run: 4 − 1 = 3.

Step 3, Divide: m = 4/3 ≈ 1.333. The line rises 4 units for every 3 it runs.

Common mistakes

  • Subtracting in the wrong order: (y₂ − y₁) ÷ (x₂ − x₁) must keep the same point second in both, flipping one gives the negative of the right answer.
  • Calling vertical slope “zero”: vertical lines have undefined slope (division by zero); horizontal lines have slope zero. Opposites, not synonyms.
  • Reading 4/3 as “4 over 3” without meaning: always translate to rise-over-run, it is what the number is for.

When to use it

Slope is the rate of change: speed (distance ÷ time), price per unit, grade of a hill, trend of a data series, and the m in y = mx + b. Anywhere “how fast does y change when x changes?” is asked, slope is the answer.

Frequently asked questions

m = (y₂ − y₁) ÷ (x₂ − x₁): the change in y divided by the change in x between two points on the line.

The line falls as you move right, y decreases while x increases. A slope of −2 drops 2 units for every 1 unit right.

Because the run (x₂ − x₁) is zero, and division by zero has no value. It is not zero and not infinite, it is undefined.

The m is the slope: it tells you the line rises m units per 1 unit of x. The b is where the line crosses the y-axis.