Skip to content
Calcora

Slope Calculator

The slope of a line between two points.

Input sheet

Browse DIY guidesDo the project yourself, step by step

DIY at your own risk. Calcora's calculators and guides are general estimates and information only — not professional, engineering, legal, or safety advice. Always verify local building codes and permit requirements, and hire a licensed pro for electrical, gas, plumbing, structural, or any work you're not fully comfortable doing yourself.

Slope measures how steeply a line rises or falls — a road grade, a wheelchair ramp, the trend in a chart. It is the change in vertical position divided by the change in horizontal position between two points.

How it works

Slope is rise over run: (y2 − y1) ÷ (x2 − x1).

Slope is 'rise over run.' A positive slope climbs left to right, a negative one descends, zero is flat, and a vertical line has an undefined slope because the run is zero (the tool flags this).

From the slope and one point, this tool also reconstructs the full line equation y = mx + b, where b is the y-intercept — the value of y where the line crosses the vertical axis.

Slope m = (y₂ − y₁) ÷ (x₂ − x₁)

Worked examples

Tips & gotchas

FAQ

What does a slope of zero mean?

The line is perfectly horizontal — no rise as you move along it. Its equation is y = a constant.

Why is a vertical line's slope undefined?

The run (change in x) is zero, and dividing by zero has no value. The line still exists; its slope simply cannot be expressed as a number.

How do I get the line equation from the slope?

Use y = mx + b. Plug in the slope for m and one known point to solve for b, the y-intercept, as this tool does automatically.

Related calculators

Percentage Calculator · Percent Change Calculator · Average (Mean) Calculator · Ratio Calculator · Exponent Calculator