Slope Calculator

Find the slope between two points along with the line equation in every standard form, the angle, and the perpendicular slope.

How to use this calculator

  1. 1Enter the coordinates of two points on the line.
  2. 2The slope, intercept and all three standard equation forms are produced together.
  3. 3Use the grade percentage for anything involving physical gradients.

How the calculation works

m = (y₂ − y₁) / (x₂ − x₁) y = mx + b b = y₁ − m·x₁
m
Slope — vertical change per unit of horizontal change
b
y-intercept — where the line crosses the y-axis
rise / run
The vertical and horizontal changes between the points

A positive slope rises left to right; a negative slope falls. Zero is horizontal, and a run of zero makes the slope undefined rather than infinite.

Perpendicular slopes are negative reciprocals: m₁ × m₂ = −1.

Expressed as a percentage, slope is the "grade" used for roads and railways — a 5% grade rises 5 metres per 100 travelled horizontally.

Worked example

Through (2, 3) and (6, 11)

  1. 1.Rise = 11 − 3 = 8. Run = 6 − 2 = 4.
  2. 2.Slope m = 8 ÷ 4 = 2.
  3. 3.Intercept: b = 3 − 2 × 2 = −1.
  4. 4.So the line is y = 2x − 1, rising at 63.435° from horizontal.

Result: Slope 2, equation y = 2x − 1

What slope measures

Slope describes how steeply a line rises or falls — the amount it moves vertically for every unit it moves horizontally. It is often introduced as "rise over run": pick any two points on the line, find how far you climbed (or dropped) between them, divide by how far you moved sideways, and the result is the same number no matter which two points on the line you chose.

That last part is what makes slope meaningful in the first place — a straight line has exactly one slope along its entire length, unlike a curve, whose steepness changes from point to point.

Writing the equation of a line

Once a slope and one point on the line are known, the whole line is fully determined, and it can be written a few equivalent ways depending on what is most convenient.

  • Slope-intercept formy = mx + b, built around the slope (m) and where the line crosses the y-axis (b) — the most common form for graphing quickly.
  • Point-slope formy − y₁ = m(x − x₁), built directly from the slope and any single known point — useful when the y-intercept is not one of the values you started with.
  • Standard formAx + By = C, which does not single out either variable and is often preferred for systems of equations and certain algebraic manipulations.

Where slope shows up outside a maths class

Slope is one of the rare pieces of algebra most people apply constantly without necessarily calling it "slope".

  • Road and rail gradesa road’s steepness is quoted as a percentage grade — a direct expression of slope, where a 5% grade rises 5 metres for every 100 travelled horizontally.
  • Roof pitchroofers describe a roof’s steepness as a ratio like "6 in 12" — the roofing equivalent of rise over run, in inches instead of a decimal.
  • Wheelchair rampsaccessibility standards set a maximum slope a ramp is allowed to have, since too steep a rise makes a ramp unsafe or unusable.
  • Ski runstrail difficulty is closely tied to slope — steeper gradients are graded for more advanced skiers.
  • Trends in datathe slope of a line fitted through data points describes the rate of change of whatever is being measured — dollars per year, degrees per hour, and so on.

Special cases worth recognising

A few slope values and relationships come up often enough to be worth knowing on sight rather than recalculating.

  • Zero slopea perfectly horizontal line — y never changes, however far you move along x.
  • Undefined slopea perfectly vertical line, where the run is zero. This is not an infinitely large slope — division by zero simply has no defined value, which is also why a vertical line cannot be written in slope-intercept form at all.
  • Parallel linesalways share exactly the same slope, however far apart they sit.
  • Perpendicular linestheir slopes are negative reciprocals of each other — multiply the two slopes together and the result is always −1.

Beyond straight lines

Every calculation here assumes a straight line, where slope is constant everywhere along it. Curves don’t have a single slope — their steepness changes continuously from point to point, and describing it precisely at any one location is what calculus, specifically the derivative, exists to do. The slope of a straight line is, in a sense, the simplest possible case of that broader idea: a curve whose steepness happens to never change.

What this assumes, and where it stops

Assumptions

  • A straight line in a flat Cartesian plane.

Limitations

  • Vertical lines have no defined slope and cannot be written in slope-intercept form.
  • Only straight lines. Curves have a slope that changes at every point, which requires calculus.

Common questions

What does slope actually mean?

How steeply the line rises or falls: the vertical change divided by the horizontal change. A slope of 2 means the line goes up 2 units for every 1 unit right. A slope of −0.5 means it drops half a unit for every unit right.

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

Because slope is rise divided by run, and a vertical line has a run of zero. Division by zero has no value at all — it is not a very large number, it is undefined. That is why vertical lines are written x = a instead of y = mx + b.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the slope calculator.

See all geometry calculators →