calculate slope of a line calculator

If you need to calculate the slope of a line quickly, this tool gives you an instant answer from two points. Enter any two coordinates \((x_1, y_1)\) and \((x_2, y_2)\), and the calculator will return the slope, classify the line, and show key details like rise, run, and slope-intercept form when possible.

Slope Calculator (Two-Point Form)

Use the formula: m = (y2 - y1) / (x2 - x1)

Enter values and click Calculate Slope.

What is the slope of a line?

The slope describes how steep a line is and the direction it moves as you go from left to right. In algebra, slope is usually written as m.

  • Positive slope: line rises left to right.
  • Negative slope: line falls left to right.
  • Zero slope: horizontal line.
  • Undefined slope: vertical line.

Slope formula (two points)

m = (y₂ - y₁) / (x₂ - x₁)

This is often called “rise over run”:

  • Rise = change in y = \(y_2 - y_1\)
  • Run = change in x = \(x_2 - x_1\)

If run is 0, you cannot divide by zero, so the slope is undefined (vertical line).

How to use this calculator

  1. Enter the first point \((x_1, y_1)\).
  2. Enter the second point \((x_2, y_2)\).
  3. Click Calculate Slope.
  4. Review the slope result and line type.

Worked example

Points: (1, 2) and (5, 10)

Using the formula:

m = (10 - 2) / (5 - 1) = 8 / 4 = 2

The slope is 2, which means the line goes up 2 units for every 1 unit to the right.

Special cases to remember

1) Vertical line

If x₂ = x₁, then run = 0. Slope is undefined.

2) Horizontal line

If y₂ = y₁, then rise = 0. Slope is 0.

3) Same point repeated

If both points are identical, rise and run are both zero. In that case, slope is indeterminate because infinitely many lines can pass through one point.

Tip: Keep point order consistent. If you switch both points, the final slope value stays the same because both numerator and denominator change sign.

Why slope matters

Slope appears everywhere in math and real life: linear equations, geometry, coordinate graphing, statistics, and even basic economics. Understanding slope helps you interpret rates of change, trends, and line behavior.

FAQ

Can slope be a fraction?

Yes. Many slopes are fractional, and that is perfectly valid.

Can slope be decimal?

Yes. A decimal slope is just a numeric form of rise/run.

Is slope the same as gradient?

In many contexts, yes. “Gradient” is another term for slope.

What if I enter negative coordinates?

No problem. The calculator handles positive, negative, and decimal values.

Final thoughts

This calculate slope of a line calculator is built to be fast and simple: just enter two points and get immediate results. Use it to check homework, verify graphing steps, or quickly evaluate linear relationships.

🔗 Related Calculators

🔗 Related Calculators