A little clarity, calculated.

culators

Math / Slope

Slope Calculator

Find the slope and line equation through two coordinate points. It identifies vertical lines separately because their slope is undefined, while still giving their equation. For distinct x-coordinates, slope m=(y₂−y₁)/(x₂−x₁), and point-slope form yields y=mx+b. When x₁=x₂, the line is vertical and has equation x=x₁.

Your inputs

Make it your own
Calculator settings

Your result
2
Slope
Line equation
y = 2x + 0

Example inputs shown. Adjust them to explore.

A familiar situation

Calculate the slope of a line from two chart coordinates to interpret a rate of change.

How to use this calculator

  1. Enter x₁, y₁, x₂ and the remaining inputs.
  2. Select Calculate to see the answer and its breakdown.
  3. Keep a scenario, change an input and compare the results.

Use consistent units and check the assumptions below before applying the result.

How slope is calculated

For distinct x-coordinates, slope m=(y₂−y₁)/(x₂−x₁), and point-slope form yields y=mx+b. When x₁=x₂, the line is vertical and has equation x=x₁. Points (1, 2) and (4, 8) produce slope 2 and line y=2x.

m=(y₂−y₁)/(x₂−x₁); y=mx+b, with x=x₁ for a vertical line.
A worked example

Points (1, 2) and (4, 8) produce slope 2 and line y=2x.

Assumptions & useful context

The result depends on the values you enter and the method described above. Displayed numbers may be rounded; calculations use the unrounded values. Check that this model matches your situation before relying on it.

Frequently asked questions

Do the points need to be different?

Yes; identical points do not determine a unique line.

What happens with a vertical line?

The tool reports an undefined slope and its constant-x equation.

Find a calculator