Home » Mathematics » Slope Calculator

Slope Calculator

Free slope calculator. Enter two points to get the slope, rise, run, slope type, angle in degrees, and percent grade, with the formula shown.

FREE CALCULATOR
min -1000000, max 1000000
min -1000000, max 1000000
min -1000000, max 1000000
min -1000000, max 1000000
🧮

Your results will appear here.
Enter your values and press Calculate.

How it works

Enter the coordinates of two points. The calculator subtracts the y values to get the rise and the × values to get the run, then divides rise by run for the slope m, also called the gradient. The sign of m names the slope type (positive, negative, or zero), a zero run flags a vertical line with an undefined slope, and arctan(m) plus m times 100 give the angle in degrees and the percent grade. To convert a slope to degrees, take the arctangent of the slope. A negative slope means the line falls as × increases. The difference between slope and grade is units: slope is a ratio, grade is that ratio expressed as a percentage.

m = (y2 - y1) / (x2 - x1) = rise / run, angle = arctan(m), percent grade = m × 100

The slope formula, explained

The slope of a line measures its steepness: how much y changes for each unit that × changes. For two points (x1, y1) and (x2, y2), the slope m is the vertical change divided by the horizontal change:

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

The top of the fraction is the rise (delta y) and the bottom is the run (delta x). You may also see it written as m = rise / run or m = Δy / Δx. The calculator shows its work for every result, substituting your numbers into the formula.

Any two points on the same straight line give the same slope, because a straight line changes at a constant rate. Swapping which point is listed first does not change the answer: both the rise and the run flip sign, and the two negatives cancel.

How to use this slope calculator

Enter the × and y coordinates of your first point and your second point, following these steps: enter the points, read the slope and its plain-words type, then check the angle and percent grade. The result also implies the line's point-slope form and slope-intercept form, y = mx + b.

Coordinates can be whole numbers, decimals, or negatives. The only impossible case is two points with the same × value: that is a vertical line, and the calculator reports the slope as undefined.

Slope types: positive, negative, zero, and undefined

A positive slope rises from left to right: y grows as × grows. A negative slope falls from left to right. A zero slope is a flat horizontal line: y never changes no matter how far × moves. An undefined slope belongs to a vertical line, where × never changes and the formula would divide by zero.

In the real world, a positive slope can be a price rising per unit sold, a negative slope can be a temperature falling per hour, a zero slope can be a fixed monthly fee that never changes with usage, and an undefined slope is a wall: all height, no horizontal travel.

From slope to angle and percent grade

Slope converts neatly into two everyday measures. The angle from the horizontal is arctan(m): a slope of 1 makes a 45 degree angle, a slope of 2 makes about 63.43 degrees, and a vertical line sits at 90 degrees.

Percent grade is the slope times 100. A slope of 0.06 is a 6 percent grade, the number you see on road signs. A 100 percent grade is a 45 degree incline, and grades above 100 percent are real: a slope of 2 is a 200 percent grade, steeper than any road you will drive. This makes the calculator a useful slope to angle converter for roof pitches and road grades.

Mistakes to avoid when finding slope

The most common error is subtracting in a different order on the top and bottom of the fraction, for example y2 - y1 over x1 - x2. That flips the sign. Always subtract in the same order: second point minus first point, both times.

Other traps: confusing the slope with the y-intercept (slope is change, the intercept is where the line crosses the y-axis), trusting how steep a line looks when the axes are drawn at different scales, and assuming a vertical line has a slope of zero instead of an undefined slope.

Worked example: slope through (2, 5) and (9, 19)

Find the slope of the line through (2, 5) and (9, 19), showing every step.

Rise = 19 - 5 = 14. Run = 9 - 2 = 7. Slope m = 14 / 7 = 2. The slope is positive, so the line rises from left to right, climbing 2 units of y for every 1 unit of x.

Angle = arctan(2) = 63.43 degrees. Percent grade = 2 × 100 = 200 percent. This is exactly the result this calculator produces for those two points.

Frequently asked questions

The slope is a number that describes how steep a line is and which way it tilts. It is the ratio of vertical change to horizontal change between two points on the line, written m = (y2 - y1) / (x2 - x1).

Pick any two points on the line. Subtract the y values to get the rise, subtract the × values to get the run, then divide rise by run. For points (1, 2) and (4, 8): rise = 6, run = 3, slope = 2.

m = (y2 - y1) / (x2 - x1), also written as rise over run or delta y over delta x. The subscripts mark the two points; subtracting in the same order on top and bottom is what makes the sign come out right.

The line falls as you move from left to right: y decreases while × increases. On a graph of temperature over time, a negative slope means the temperature is dropping.

The slope of a vertical line. The two points share the same × value, so the run is zero and the formula divides by zero, which has no defined answer. Vertical lines are written × = a constant.

A perfectly flat, horizontal line. The y values are identical, so the rise is zero and the slope is 0. Horizontal lines are written y = a constant.

No, as long as you subtract in the same order on the top and the bottom. Swapping the points flips the sign of both the rise and the run, and the two negatives cancel, giving the same slope.

Take the arctangent of the slope: angle = arctan(m). A slope of 1 gives 45 degrees, a slope of 0.5 gives about 26.57 degrees, and a vertical line is 90 degrees.

Only the scale: percent grade is the slope multiplied by 100. A slope of 0.0833 is an 8.33 percent grade, a slope of 1 is a 100 percent grade, and grades above 100 percent describe slopes steeper than 45 degrees.

Yes. A slope of 1/2 means y rises half a unit for each unit × moves. Fractions, decimals, and negative numbers are all valid slopes; only division by zero (a vertical line) is off limits.

Zero. Every point on a horizontal line has the same y value, so the rise is zero and zero divided by any nonzero run is 0.

Undefined. Every point on a vertical line has the same × value, so the run is zero and the slope formula divides by zero, which is undefined.

Related calculators