CCalclabhub

Math · 61 calculators

Slope Calculator

Slope is how much a quantity changes vertically for one unit of horizontal movement. It turns two data points into a rate, and once you have it, the whole line follows.

Last updated

Slope of the line

2

Y-intercept
-1
X-intercept
0.5
Distance between the two points
13.4164

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

The formula this calculator uses

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

m
Slope — the rate of change of y per unit of x
y2 - y1
Rise — how much the vertical coordinate changed
x2 - x1
Run — how much the horizontal coordinate changed
b
Y-intercept — where the line crosses the vertical axis

How to check the result by hand

  1. 1

    Label the two points consistently

    Call one (x1, y1) and the other (x2, y2). Which is which does not matter, but once chosen it must not change partway through the calculation.

  2. 2

    Compute the rise

    y2 - y1 = 15 - 3 = 12. Keep the sign — it tells you whether the line rises or falls as you move right.

  3. 3

    Compute the run

    x2 - x1 = 8 - 2 = 6. If this comes out zero, stop: the line is vertical and has no defined slope.

  4. 4

    Divide rise by run

    12 / 6 = 2. Read it as "y increases 2 units for every 1 unit of x", rather than as an abstract number.

  5. 5

    Find the intercept to complete the line

    Substitute either point into y = mx + b: b = 3 - 2 x 2 = -1. The line is y = 2x - 1, which you can verify against the second point.

Common Questions

How does the Slope Calculator work?

Subtract the y values to get the rise, subtract the x values to get the run, then divide. For the points (2, 3) and (8, 15) the rise is 12 and the run is 6, giving a slope of 2. Working backwards with y = mx + b, the intercept is -1, so the line is y = 2x - 1 and any value can be predicted from it. A horizontal line has slope 0 and a vertical line has undefined slope.

What do I need to enter in the Slope Calculator?

It takes 4 inputs: First point — x, First point — y, Second point — x, Second point — y. Fields that expect a unit say so next to the label.

Where does Slope of the line come from?

It comes from m = (y2 - y1) / (x2 - x1) — rise divided by run. Take both differences in the same direction, or the sign reverses.

What is the most common mistake with the Slope Calculator?

Mixing the subtraction order between numerator and denominator. Taking y2 - y1 with x1 - x2 gives the negative of the correct answer. Always move in the same direction through both coordinates.

For worked examples, common mistakes and the limits of this formula, read the full How To Calculate Slope page.