Slope Calculator
Slope, intercept and the line's equation from two points.
Work out Slope. Slope, intercept and the line's equation from two points. Shows the working, not just the answer.
Slope (m)
2
y = 2x + 0
Slope is rise over run: 6 ÷ 3 = 2. The angle from horizontal is 63.43°, which is the arctangent of the slope — a slope of 1 is exactly 45°.
How the Slope Calculator works
Slope is rise over run, and two points determine it along with the y-intercept, the angle and the line's equation. A vertical line is the case worth handling deliberately: its slope is undefined rather than infinite, and it has no y-intercept at all.
Also known as: slope formula · find the slope of a line · slope intercept form calculator · rise over run calculator
The calculation itself
Slope is rise over run: the change in y divided by the change in x. From (1,2) to (4,8) that is 6 ÷ 3 = 2.
Once the slope is known, the intercept follows by substituting either point back into y = mx + b. Here b works out to 0, so the line passes through the origin.
The vertical case
A vertical line has a run of zero, and division by zero has no value — so its slope is undefined, not infinite. The distinction matters: infinity would suggest a limit being approached, whereas nothing is being approached at all.
It also has no y-intercept unless it happens to be the y-axis, in which case it has infinitely many. That is why its equation is written x = k, outside slope-intercept form entirely.
This page reports both as undefined rather than printing a very large number, which is what a naive implementation produces and what quietly corrupts a spreadsheet.
Frequently asked questions
How do I find the slope between two points?
Divide the change in y by the change in x. From (1,2) to (4,8) the rise is 6 and the run is 3, giving a slope of 2.
What is slope-intercept form?
y = mx + b, where m is the slope and b is where the line crosses the y-axis. This page returns the equation in that form directly.
What is the slope of a vertical line?
Undefined, not infinite. The run is zero, and division by zero has no value at all. A vertical line is written x = k instead.
What does a negative slope mean?
The line falls from left to right. A slope of −2 drops two units for every one it moves across.
Put this calculator on your own site
Free to use, on any site, commercial or not. Paste this where you want it to appear. It is a plain iframe, so it works in WordPress, Squarespace, Wix, Webflow, Ghost and anything else that accepts HTML.
<iframe src="https://www.thecalclibrary.com/embed/slope-calculator" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px" loading="lazy" title="Slope Calculator"></iframe>The only condition is that the credit line stays visible. It sits inside the frame, so you do not have to do anything to keep it.
Related calculators
Distance Formula Calculator
Distance between two points, which is Pythagoras in disguise.
OpenMidpoint Calculator
The point exactly halfway between two others.
OpenProportion Calculator
Solve a : b = c : d for whichever term is missing.
Open