Calculators

See how steep a line is

Slope calculator

Enter two points to find how far the line goes up or down as it moves across.

Calculated in your browser

Formula and steps included

No account. No signup.

Optional learning Learn how this math works See the formula, definitions, and step-by-step method.

Formula

The slope formula

Slope: m = (y₂ − y₁) / (x₂ − x₁), when x₂ ≠ x₁

Slope tells how much a line moves up or down for each move across. This is called rise over run: rise is the up-or-down change, and run is the across change.

A positive slope rises from left to right, a negative slope falls, and zero is flat. When the run is zero, dividing is not allowed, so the vertical line's slope is called undefined.

How to use the formula

  1. Keep each point together

    The first x and y belong together, and the second x and y belong together.

  2. Find the rise and run

    Subtract the first y from the second y for rise. Subtract the first x from the second x for run.

  3. Divide and interpret

    Divide rise by run when the run is nonzero, then use the sign to describe the line's direction.

Worked examples

Slope calculator examples

Positive slope

Between (2, 3) and (6, 11), the up change is 11 − 3 = 8 and the across change is 6 − 2 = 4. The slope is 8 / 4 = 2.

Vertical line

Between (4, −1) and (4, 7), the across change is 4 − 4 = 0. Dividing by 0 is not allowed, so the vertical line has no number for its slope. This is called undefined.

Common questions

Slope calculator FAQ

What is the slope of a horizontal line?

Its slope is zero because the y-values do not change, making the rise zero while the run is nonzero.

Why is a vertical line's slope undefined?

Both points have the same x-value, so the run is zero. The slope formula would require division by zero, which is undefined.

Does switching the two points change the slope?

No, if you reverse both subtraction orders. Both the rise and run change sign, leaving their quotient unchanged.

Are my coordinates stored?

Your points stay in your browser and are not saved by default or uploaded. Use Save on this device to keep them here, or download a backup file.