← All calculatorsMath

Slope Calculator

Turns two points into a slope, a y-intercept, the equation of the line and the angle it makes with the horizontal.

Slope (m)
2.25
y-intercept (b)
-0.25
Equation
y = 2.25x − 0.25
Angle from horizontal
66.04°

How to use the Slope Calculator

  1. Enter the coordinates of your first point as x₁ and y₁.
  2. Enter the second point as x₂ and y₂; the order does not affect the slope.
  3. Read the slope m — positive rises left to right, negative falls.
  4. Read the equation y = mx + b to describe the line completely.
  5. Use the angle output when you need a physical grade rather than a ratio.

How the calculation works

Slope is rise over run: the change in y divided by the change in x between any two points on a line. Because a straight line has a constant rate of change, any pair of points on it produces the same slope, which is why the choice of points does not matter. Swapping the two points negates both numerator and denominator, leaving the quotient unchanged.

Once the slope is known, the y-intercept follows by rearranging y = mx + b for b using either point: b = y₁ − mx₁. Together m and b give the slope-intercept form, the most useful description of a line for graphing and prediction. A vertical line breaks this form entirely — the run is zero, the slope is undefined, and the correct description is x = constant, which is why the calculator reports that case separately rather than displaying infinity.

The angle output converts the ratio into degrees using the arctangent, which is what you need when slope means a physical grade. Construction and transport use several conventions for the same idea: a 1:12 accessibility ramp is a slope of 0.0833 or 4.76°, a 5% road grade is a slope of 0.05 or 2.86°. Percentage grade is simply slope × 100, not the angle, and confusing the two is a common and expensive error.

Formula
m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − m·x₁; angle = arctan(m)

Source: Standard coordinate geometry; angle-to-grade conventions per AASHTO Green Book geometric design guidance.

Worked example

A drainage pipe drops from an inlet at (0, 42.60) to an outlet at (85, 42.09), in metres.

  1. Rise: 42.09 − 42.60 = −0.51 m.
  2. Run: 85 − 0 = 85 m.
  3. Slope: −0.51 / 85 = −0.006.
  4. Grade: −0.006 × 100 = −0.6%.

A fall of 0.6%, comfortably above the 1-in-200 (0.5%) minimum typically specified for self-cleansing flow in a sewer of this size.

Frequently asked questions

What is the difference between slope and grade?+

Slope is the plain ratio, grade is that ratio expressed as a percentage, and the angle is its arctangent. A slope of 0.10 is a 10% grade but only a 5.7° angle.

Why is a vertical line's slope undefined rather than infinite?+

The run is zero, and division by zero has no value. Saying 'undefined' is precise; 'infinite' suggests a limit that does not exist in the two-sided sense.

What slope do perpendicular lines have?+

The negative reciprocal. A line with slope 2 is perpendicular to one with slope −0.5, because the product of their slopes is −1.

Can slope be used on curves?+

Not directly — a curve's slope changes at every point. The derivative calculator gives the instantaneous slope of a curve at a chosen x.

Last reviewed August 31, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.

Related

More in Math