Slope Calculator

Slope = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁). For the points (1, 2) and (3, 6) the rise is 4 and the run is 2, so the slope is 2, the line is y = 2x + 0 and it climbs at an angle of about 63.4° above the x-axis.

Inputs

Point 1
Point 2
Result
–

Results are calculated in your browser for convenience. Double-check important figures before relying on them.

How to find the slope

m = (y₂ − y₁) ÷ (x₂ − x₁) y = mx + b, where b = y₁ − m × x₁

Take the two points (1, 2) and (3, 6). Rise = 6 − 2 = 4 and run = 3 − 1 = 2, so m = 2. The intercept is b = 2 − 2 × 1 = 0, so the line is y = 2x. The angle with the x-axis is arctan(2) = 63.43°. Swapping the order of the points gives the same slope.

Reading the slope

SlopeThe line
PositiveRises from left to right
NegativeFalls from left to right
ZeroHorizontal
UndefinedVertical (run is 0)

Parallel lines have equal slopes, and perpendicular lines have slopes that multiply to −1. Roads and roofs use percent grade, which is slope × 100: a slope of 0.08 is an 8% grade.

Uses of slope

  • Rate of change in graphs: speed from a distance-time graph, or cost per unit.
  • Road gradients, wheelchair ramps, roofs and drainage.
  • Finding trend lines in data.

See also the distance calculator, the Pythagorean theorem calculator and the quadratic formula calculator.

Complete guide to the Slope Calculator

How to use the Slope Calculator, step by step

  1. Enter the two points.
  2. Read the slope and line equation.
  3. Check the angle and intercepts.
  4. Use the distance and midpoint if needed.

Common mistakes to avoid

  • Subtracting in a different order on top and bottom.
  • Mixing up x and y.
  • Forgetting a vertical line has no slope.

Key terms explained

Rise
The change in y.
Run
The change in x.
Intercept
Where a line crosses an axis.
Grade
Slope expressed as a percentage.

Frequently asked questions

What is the slope formula?

The slope between two points is (y₂ − y₁) ÷ (x₂ − x₁), the change in y divided by the change in x, also called rise over run.

What does an undefined slope mean?

The two points have the same x value, so the line is vertical and the run is zero. Division by zero is undefined.

How do I find the equation of a line?

Work out the slope m, then use y = mx + b with b = y₁ − m × x₁. The result is the slope-intercept form.

How do I convert slope to degrees?

The angle is the inverse tangent of the slope: angle = arctan(m). A slope of 1 is 45°, and a slope of 0 is 0°.

What is the slope of perpendicular lines?

It is the negative reciprocal. If one line has slope 2, a line perpendicular to it has slope −1/2.

What is percent grade?

Percent grade is slope × 100. A road that rises 6 metres over 100 metres of horizontal distance has a 6% grade.

How is slope used in real life?

Slope describes steepness and rates of change: the gradient of a road, the pitch of a roof, speed on a distance graph, or the cost of each extra unit in a price line.

Related calculators

Guides worth reading