Slope Formula Calculator: Rise Over Run Between Two Points

Slope between two points

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

First point x₁ · First point y₁ · Second point x₂ · Second point y₂

P₁ = (1, 2)P₂ = (4, 8)run = 3rise = 6

Read the two labelled points without changing their coordinates.

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

The points are translated and scaled together to fit the drawing; the labels retain your actual coordinates.

Worked example you can change

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

Editable worked example
P₁ = (, ), P₂ = (, )
  1. Slope = (8 − (2)) ÷ (4 − (1))
  2. Slope ≈ 2

Calculator

Enter complete decimal numbers; separate list values with commas or spaces. Decimal answers are shown to 15 significant digits; exact integer results retain all digits.

Calculator inputs
Rise
6
Run
3
Slope
2

Formula variants

Related formulas and when to use them
Shape or methodFormulaMeaning
Two pointsm = (y₂ − y₁)/(x₂ − x₁)Subtract in the same point order in numerator and denominator.
Horizontal linerise = 0, run ≠ 0 ⇒ m = 0A horizontal line has no vertical change.
Vertical linerun = 0, rise ≠ 0 ⇒ undefinedDivision by zero does not produce a finite slope.
Coincident pointsrise = run = 0 ⇒ indeterminateOne point alone does not determine a unique line.

Questions

What is the slope formula?

Slope is the difference in y divided by the difference in x: (y₂ − y₁)/(x₂ − x₁). Use the same point order in both differences.

Why is a vertical line’s slope undefined?

Its horizontal run is zero, so rise divided by run would require division by zero.

What if the points are the same?

Both rise and run are zero. Infinitely many lines pass through the same single point, so the slope is indeterminate.

Where can I find distance and midpoint?

Use the distance and midpoint calculator linked from the Math hub; it uses the same two-point coordinate convention.

Sources and method

Find slope from two points using signed rise over signed run. Vertical and coincident points have explicit explanations instead of a misleading number.

We calculate with 40 significant digits and round only the displayed result. Diagrams are labelled explanations and are not measurement drawings.

More Math formulas

Browse Math calculators

Updated