Free online formula calculators

Slope Calculator

Enter two points to calculate the slope (rise over run), the y-intercept, the equation of the line and its angle of inclination.

Slope Calculator
Result
Slope (m)2
Equation of the liney = 2x − 1
y-intercept (b)-1
Angle of inclination63.43 °
Grade200.0%

Link to this calculation

Formula

m = (y2 − y1) ÷ (x2 − x1)
b = y1 − m × x1
θ = arctan(m)
SymbolMeaning
mSlope (gradient) of the line
by-intercept, where the line crosses the y-axis
θAngle of the line measured from the positive x-axis

How to Use This Calculator

  1. Enter the x₁.
  2. Enter the y₁.
  3. Enter the x₂.
  4. Enter the y₂.
  5. Press Calculate. Results also update automatically as you type.

Worked Example

Using the values pre-filled in the calculator above:

Inputs
x₁2
y₁3
x₂6
y₂11
Results
Slope (m)2
Equation of the liney = 2x − 1
y-intercept (b)-1
Angle of inclination63.43 °
Grade200.0%

About This Calculation

The slope of a line measures how steep it is: how much y changes for every one-unit step in x. It is often described as "rise over run". A positive slope climbs from left to right, a negative slope falls, a slope of zero is a horizontal line, and a vertical line has an undefined slope because the run is zero.

Once you know the slope, the y-intercept follows from either point, giving the slope-intercept equation y = mx + b. That equation lets you predict y for any x, check whether a third point lies on the same line, or compare lines: parallel lines share the same slope, and perpendicular lines have slopes whose product is −1. The slope is also a rate — in a graph of distance against time it is speed; in a graph of cost against quantity it is the price per unit.

Slope is expressed in different ways in different fields. Road signs and wheelchair ramps use grade, the slope as a percentage (a 1:12 ramp is an 8.3% grade). Roofers talk about pitch, such as 6-in-12. Surveyors and engineers often quote the angle of inclination instead, which is the arctangent of the slope. Note that a 100% grade is a 45° angle, not a vertical wall.

Frequently Asked Questions

Does it matter which point I enter first?
No. Swapping the points changes the sign of both the rise and the run, so their ratio — the slope — stays the same.
What is the slope of a vertical line?
It is undefined, because the run (change in x) is zero and you cannot divide by zero. Its equation is simply x = constant.
How is slope related to the angle?
The slope is the tangent of the angle the line makes with the x-axis, so θ = arctan(m). A slope of 1 is 45°, and a slope of 0.5 is about 26.6°.

Category: Math & Algebra. Found a problem with this calculator? Let us know.