AbraCalc

Slope Calculator

Calculate the slope between two points (x₁,y₁) and (x₂,y₂).

Embed this tool on your site
Cite this tool

APA

AbraCalc. (2026). Slope Calculator [Online calculator]. Retrieved from https://abracalc.com/calculator/slope-calculator/

BibTeX

@misc{abracalc-slope-calculator, author = {AbraCalc}, title = {Slope Calculator}, year = {2026}, howpublished = {\url{https://abracalc.com/calculator/slope-calculator/}} }

Did this tool answer your question?

How to use this tool

  1. Enter x₁, y₁, x₂ and y₂ in the fields above.
  2. Results update instantly as you type — or click Calculate.
  3. Read your slope (m) and the full breakdown beneath it.

Calculate the slope (gradient) of a line passing through two points using m = (y₂−y₁)/(x₂−x₁).

Formula

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

Also written as rise / run, where rise = y₂ − y₁ and run = x₂ − x₁.

How it works

The calculator subtracts the y-coordinates (rise) and divides by the difference in x-coordinates (run) to find the slope of the straight line connecting two points. If both x-values are equal the run is zero and the result is ±Infinity (a vertical line has undefined slope).

Worked example

Worked example: slope through (1, 2) and (4, 8)

  1. Inputs: x₁ = 1, y₁ = 2, x₂ = 4, y₂ = 8.
  2. Rise = y₂ − y₁ = 8 − 2 = 6.
  3. Run = x₂ − x₁ = 4 − 1 = 3.
  4. Slope m = 6 / 3 = 2.

Slope m = 2

Common mistakes to avoid

  • Reversing the order of subtraction: computing (x2-x1)/(y2-y1) instead of (y2-y1)/(x2-x1).
  • Dividing by zero when x1 = x2; a vertical line has undefined slope, not zero slope.
  • Confusing zero slope (horizontal line, y1=y2) with undefined slope (vertical line, x1=x2).

Key terms

Slope (m)
A measure of the steepness of a line; the ratio of vertical change to horizontal change between any two points.
Rise
The vertical change between two points on a line: y₂ − y₁.
Run
The horizontal change between two points on a line: x₂ − x₁.
Gradient
Another term for slope, commonly used in the UK and in calculus contexts.
Undefined slope
The slope of a vertical line, where the run is zero and division by zero occurs.

Frequently asked questions

How do you calculate slope from two points?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁). A positive slope means the line goes up from left to right.

References & sources