Slope Calculator with Steps

Enter two points to find the slope of the line through them. You get the rise-over-run working, the equation of the line in three forms, the intercepts, the angle, the distance and midpoint — plus a graph with the rise and run triangle.

Grades 7–10FreeNo sign-up

Point 1 ( , )
Point 2 ( , )
Try:

How to use the slope calculator

  1. Type the coordinates of the first point, (x₁, y₁), and the second point, (x₂, y₂). Negative numbers and decimals are fine.
  2. Press Calculate. The slope appears as a simplified fraction and a decimal, followed by numbered steps.
  3. Scroll down for the graph and a table with the equation of the line, intercepts, angle, distance and midpoint.

What is slope?

Slope measures how steep a line is. It compares how far the line goes up or down (the rise) with how far it goes across (the run):

m = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁)

The letter m is the usual symbol for slope. It does not matter which point you call “first”, as long as you subtract in the same order on the top and the bottom.

SlopeWhat the line does
PositiveRises from left to right
NegativeFalls from left to right
ZeroHorizontal (no rise)
UndefinedVertical (no run — you cannot divide by 0)

Worked example

Find the slope of the line through (1, 2) and (4, 8).

Rise = 8 − 2 = 6. Run = 4 − 1 = 3. Slope m = 6 ÷ 3 = 2. The line climbs 2 units for every 1 unit it moves right.

For the equation, use b = y₁ − m·x₁ = 2 − 2·1 = 0, so the line is y = 2x.

A negative, fractional slope: through (−2, 5) and (4, 1). Rise = 1 − 5 = −4, run = 4 − (−2) = 6, so m = −4/6 = −2/3. Simplifying the fraction is the same job the fraction calculator does.

The equation of the line in three forms

All three describe exactly the same line. A vertical line is the exception: its equation is simply x = (a number), and it has no slope-intercept form.

Intercepts, angle, distance and midpoint

The y-intercept is (0, b). The x-intercept is where y = 0, at x = −b ÷ m. The angle of inclination is the angle the line makes with the positive x-axis, found from tan θ = m; a slope of 1 is a 45° line. The calculator also reports the straight-line distance between your two points and their midpoint — for the full working of those, open the distance and midpoint calculator.

Parallel and perpendicular lines

Parallel lines have equal slopes. Perpendicular lines have slopes that are negative reciprocals: flip the fraction and change the sign. A line with slope 2 is perpendicular to any line with slope −1/2, because 2 × (−1/2) = −1.

Slope in real life

Slope is a rate of change. On a distance–time graph it is speed; on a cost graph it is the price per item. Builders call it pitch or grade: a wheelchair ramp that rises 1 metre over 12 metres has a slope of 1/12, a ratio you can explore with the ratio calculator.

Frequently asked questions

How do you find the slope between two points?

Subtract the y-coordinates to get the rise and subtract the x-coordinates in the same order to get the run, then divide: m = (y2 − y1) ÷ (x2 − x1). For (1, 2) and (4, 8) the slope is 6 ÷ 3 = 2.

What is the slope of a horizontal line and a vertical line?

A horizontal line has slope 0 because its rise is 0. A vertical line has an undefined slope because its run is 0 and division by zero is not allowed.

How do I find the equation of a line from two points?

First find the slope m. Then find the y-intercept with b = y1 − m × x1 and write y = mx + b. For (1, 2) and (4, 8): m = 2 and b = 0, so y = 2x.

What does a negative slope mean?

The line goes down as you move from left to right. For example, a slope of −2/3 means the line falls 2 units for every 3 units it moves to the right.

How do I find the angle of a line from its slope?

Use θ = arctan(m). A slope of 1 gives 45°, a slope of 2 gives about 63.43°. For negative slopes add 180° to get the angle of inclination measured from the positive x-axis.

What is the slope of a perpendicular line?

It is the negative reciprocal of the original slope. If a line has slope 3/4, any line perpendicular to it has slope −4/3.