Skip to content
CalcTide logo
Education & Math

Slope Calculator

The slope between (1, 2) and (4, 8) is 2. This slope calculator finds the steepness of a line between two points. Slope is the rise over the run, which means the vertical change divided by the horizontal change. A vertical line has an undefined slope because the run is zero and you cannot divide by zero.

Education & MathBy

Quick answer

The slope measures how steep a line is between two points.

What this tells you

  • The slope measures how steep a line is between two points.
  • It equals the rise (change in y) divided by the run (change in x).
  • A positive slope rises from left to right and a negative slope falls.
  • A horizontal line has a slope of zero and a vertical line has an undefined slope.

How to Use

  1. 1Enter the x and y coordinates of the first point (x1, y1).
  2. 2Enter the x and y coordinates of the second point (x2, y2).
  3. 3Click Calculate to get the slope, rise, run, angle, y-intercept, and line equation.

How It Works

Formula

m = (y2 - y1) / (x2 - x1)

The slope m is the rise divided by the run. The rise is the vertical change (y2 - y1) and the run is the horizontal change (x2 - x1). When the run is zero the line is vertical and the slope is undefined. When the rise is zero the line is horizontal and the slope is zero.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

Slope from (1, 2) to (4, 8)

X11
Y12
X24
Y28
Result2

The rise is 8 - 2 = 6 and the run is 4 - 1 = 3. Divide the rise by the run to get 6 / 3 = 2, so the slope is 2.

Slope from (0, 4) to (2, 0)

X10
Y14
X22
Y20
Result-2

The rise is 0 - 4 = -4 and the run is 2 - 0 = 2. Divide the rise by the run to get -4 / 2 = -2, so the slope is -2 and the line falls from left to right.

Example Slopes

Common point pairs and the slope of the line between them.

Point 1Point 2Slope
(1, 2)(4, 8)2
(0, 0)(5, 5)1
(0, 5)(4, 5)0 (horizontal)
(2, 3)(2, 9)Undefined (vertical)

Common mistakes

  • Dividing the run by the rise instead of the rise by the run. Slope is the change in y divided by the change in x, so keep the y values on top.
  • Calling a vertical line slope zero instead of undefined. A vertical line has a run of zero, so the slope is undefined, while a horizontal line has a rise of zero and a slope of zero.
  • Sign errors with negative coordinates. When a coordinate is negative, subtracting it adds a positive value, so 2 - (-3) = 5, not -1.

Frequently Asked Questions

The slope formula is m = (y2 - y1) / (x2 - x1). It gives the steepness of a line between two points by dividing the vertical change (the rise) by the horizontal change (the run).
Divide the rise by the run. Subtract the y values to get the rise (y2 - y1) and subtract the x values to get the run (x2 - x1), then divide the rise by the run. For example, from (1, 2) to (4, 8) the rise is 6 and the run is 3, so the slope is 2.
The slope between (1, 2) and (4, 8) is 2. The rise is 8 - 2 = 6 and the run is 4 - 1 = 3, so the slope is 6 / 3 = 2.
The slope of a vertical line is undefined. The run (x2 - x1) is zero for a vertical line, and dividing by zero is not allowed, so the slope cannot be calculated and the line is written as x = constant.
A zero slope means the line is horizontal. The rise (y2 - y1) is zero because both points share the same y value, so dividing zero by the run gives a slope of 0.
A negative slope means the line falls from left to right. As the x value increases the y value decreases, so the rise is negative while the run is positive, which makes the slope a negative number.
It estimates slope calculator outputs using the visible inputs and formula assumptions on this page.

Explore More in Education & Math