Skip to content
ihateDesmos

Slope calculator

Type two points to get the slope with the working shown, the equation of the line in slope-intercept, point-slope and standard form, and a graph. Fractions stay exact.

Slope (m)
2
Slope-intercept form
y = 2x
Point-slope form
y − 2 = 2(x − 1)
Standard form
2x − y = 0
y-intercept
(0, 0)
x-intercept
(0, 0)
Angle with the x-axis
63.435°
Grade
200%
Distance between the points
√80 ≈ 8.94427
Midpoint
(3, 6)
Steps
  1. Write the slope formula: m = (y₂ − y₁) ÷ (x₂ − x₁)
  2. Put in the points (1, 2) and (5, 10): m = (10 − 2) ÷ (5 − 1)
  3. Work out the rise and run: m = 8 ÷ 4 = 2
  4. Find the y-intercept from y = mx + b: b = y₁ − m·x₁ = 2 − (2)(1) = 0
  5. The line is y = 2x. It rises from left to right.
12345624681012(1, 2)(5, 10)
The line through (1, 2) and (5, 10).
Open this line in the calculator →

How to find the slope

  1. 1
    Type the coordinates of two points. Fractions like 1/2 and decimals both work.
  2. 2
    Read the slope and the equation of the line. The result updates as you type.
  3. 3
    Follow the steps to see how it was worked out, and open the line in the calculator to explore it.

The slope formula

Slope is rise over run: how far the line goes up for each step to the right. Through the points (x₁, y₁) and (x₂, y₂):

m=y2−y1x2−x1

For the points (1, 2) and (5, 10), the rise is 10 − 2 = 8 and the run is 5 − 1 = 4, so the slope is 8 ÷ 4 = 2. The line goes up 2 for every 1 across. It doesn’t matter which point you call first, as long as you use the same order on the top and bottom.

The four kinds of slope

SlopeThe line…Example
PositiveRises from left to righty = 2x + 1
NegativeFalls from left to righty = −3x + 4
ZeroIs horizontaly = 5
UndefinedIs vertical, because the run is zerox = 2

From slope to the equation of the line

Once you have the slope, you can write the line in any form:

Slope in the real world

Road signs and ramps give slope as a percentage called grade: rise ÷ run × 100. A 5% grade rises 5 feet per 100 feet. A slope can also be given as an angle, found with the inverse tangent: a slope of 1 is 45°, and a slope of 0.05 is about 2.86°. In the US, the ADA limit for a wheelchair ramp is a slope of 1:12, about 8.33%.

Frequently asked questions

How do you find slope from two points?
Subtract the y-coordinates, subtract the x-coordinates in the same order, and divide: m = (y₂ − y₁) ÷ (x₂ − x₁).
What does a slope of 0 mean?
The line is horizontal. It has the same y-value everywhere, with an equation like y = 3.
What is an undefined slope?
A vertical line has an undefined slope, since the run is zero and you can’t divide by zero. Its equation looks like x = 2.
How do you find the slope from an equation?
Rearrange it into y = mx + b; the number multiplying x is the slope. For 2x + 3y = 6, y = −(2/3)x + 2, so the slope is −2/3.
How are the slopes of parallel and perpendicular lines related?
Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, so a slope of 2 pairs with a slope of −1/2.

Related tools and guides

Try the slope calculator

It opens instantly, with no account and nothing to install.

Open the calculator