Slope Calculator

Calculate the slope (rise over run) between two points, find the slope-intercept form of the line (y = mx + b), the distance between the points, and the midpoint.

Slope Between Two Points

Slope Formula

Slope m = (y₂ − y₁) / (x₂ − x₁) = rise / run

  • Positive slope: Line goes up from left to right
  • Negative slope: Line goes down from left to right
  • Zero slope: Horizontal line
  • Undefined slope: Vertical line (x₁ = x₂)

Frequently Asked Questions

Slope is the rate of change — how much y changes for every unit increase in x. A slope of 2 means y increases by 2 for every 1-unit increase in x.

y = mx + b, where m is the slope and b is the y-intercept (where the line crosses the y-axis).

The formula

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

Slope measures steepness: how much the line rises for each unit it moves right. It is often described as "rise over run".

Worked example

Through (2, 3) and (6, 11):

m = (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2

A slope of 2 means the line climbs 2 units for every 1 unit right.

The order of the points doesn't matter, as long as you're consistent. Reversing both gives (3 − 11) ÷ (2 − 6) = −8 ÷ −4 = 2, the same answer. Reversing only one is the classic error and flips the sign.

Reading the sign

SlopeThe line
PositiveRises left to right
NegativeFalls left to right
ZeroHorizontal
UndefinedVertical

A vertical line is undefined rather than infinite because x₂ − x₁ = 0, and division by zero has no value. The run is zero, so there is no rate of change to report.

Writing the equation of the line

With a slope and one point, point-slope form gives the equation directly:

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

Using m = 2 and the point (2, 3): y − 3 = 2(x − 2), which rearranges to y = 2x − 1. That is slope-intercept form, y = mx + b, where b = −1 is where the line crosses the y-axis.

Parallel and perpendicular

Parallel lines share the same slope. Perpendicular lines have slopes that are negative reciprocals — multiply to −1. A line perpendicular to slope 2 has slope −1/2.

Slope outside maths class

Roof pitch is slope expressed as rise per 12 inches of run. Road gradients are slope as a percentage — a 6% grade climbs 6 feet per 100 travelled. Accessibility ramps are governed by maximum slope rules. In statistics, the slope of a regression line is the effect size: how much the outcome changes per unit of the predictor.