Home/Calculators/Math/Slope Calculator

Slope Calculator

Find the slope of a line through two points — instant and free.

slope-calculator
Result
—
In summary: The slope between two points is the change in y over the change in x: m = (y2 − y1) ÷ (x2 − x1). For (1, 2) and (4, 8), m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. A vertical line (x2 = x1) has an undefined slope.

How to find the slope of a line

The slope is rise over run — the change in y divided by the change in x: m = (y2 − y1) ÷ (x2 − x1). For points (1, 2) and (4, 8), m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. The straight-line gap between the points comes from the distance formula calculator.

How to use this calculator

Enter the coordinates of two points as (x1, y1) and (x2, y2). A positive slope rises left-to-right, a negative slope falls, and zero is flat. If x2 equals x1 the line is vertical and the slope is undefined.

Slope has no units of its own unless the axes carry units, in which case it is a rate — metres per second, dollars per item, and so on. That is what makes it useful well beyond geometry. The slope is the tangent of the angle the line makes with the horizontal, so the arctangent calculator turns it into degrees.

Worked example

A road climbs from (1, 2) to (4, 8). Slope = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2, meaning it rises 2 units for every 1 unit across. Need the actual length? Use the distance formula calculator.

A slope of 2 is steep: the same value expressed as a road gradient would be 200%. Parallel lines share a slope, while perpendicular lines have slopes whose product is −1, so a line at right angles to this one would have a slope of −0.5.

Frequently asked questions

What is the formula for slope?
m = (y2 − y1) ÷ (x2 − x1) — the change in y divided by the change in x between two points.
What is the slope between (1, 2) and (4, 8)?
2, because (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.
Why is the slope sometimes undefined?
When x2 = x1 the line is vertical, so the run is zero and you cannot divide by zero — the slope is undefined.
What does a negative slope mean?
The line falls from left to right; y decreases as x increases.
Does it matter which point I call point 1?
No. Swapping the points flips the sign of both the top and the bottom of the fraction, and those cancel out. What does matter is keeping the order consistent — subtracting the y values one way and the x values the other gives the wrong sign.
How this tool works

The formula behind this tool is written out in full in the sections above, so you can check the maths yourself. Every calculator on Calculorium is verified against worked examples with automated tests before it is published, and pages are reviewed as formulas or standards change. Nothing you type is sent anywhere — the calculation runs entirely in your browser. Read how we build and check these tools.

Last updated: July 27, 2026 · Calculations run in your browser. Estimates for information only.