Slope Calculator

Find the slope and equation of the line through two points.

Slope (m)
Line equation
y-intercept (b)
run rise
Slope is how steep a line is: the rise (up) divided by the run (across).

How to calculate slope from two points

The slope of a line measures how steep it is: how much it rises for each step it runs sideways. Given two points, slope is the change in y divided by the change in x, often remembered as "rise over run". This calculator finds the slope from any two points, along with the line's direction.

The formula

Slope (m) = (y2 - y1) / (x2 - x1).

Worked example

From (1, 2) to (3, 6): the rise is 6 - 2 = 4, the run is 3 - 1 = 2, so the slope is 4 / 2 = 2.

Reading the sign

A positive slope rises left to right; a negative slope falls. A slope of 0 is a flat horizontal line, and a vertical line has an undefined slope because the run is zero.

Frequently asked questions

What is the slope formula?

Slope equals the change in y divided by the change in x, or (y2 - y1) / (x2 - x1). It is rise over run.

What does a negative slope mean?

The line falls as you move from left to right. A positive slope rises, zero is horizontal, and a vertical line has undefined slope.

Why is my slope undefined?

The two points share the same x value, making a vertical line. Vertical lines have no defined slope.

What is the y-intercept?

It is where the line crosses the y-axis, the value of y when x is 0.

Was this calculator helpful?

Related calculators

More Math calculators

Embed this calculator on your website (free)

Paste this into your page. It stays up to date and links back to us.

<iframe src="https://calculatorden.com/embed/slope-calculator/" width="100%" height="540" loading="lazy" style="border:1px solid #e5e7eb;border-radius:12px;max-width:480px" title="Slope Calculator - Calculator Den"></iframe>

More tools to embed on our embed a calculator page.