Find the slope from
The slope of the line through (1, 3) and (4, 9) is m = 2, so the line rises 2 units for every 1 unit you move right.
2
Slope m (decimal)
Rising
2
Slope as a fraction
rise / run = 6 / 3
200%
Percent grade
100 × m
63.4349°
Angle
atan(m), from the x-axis
-4-2024680246810xyΔx = 3Δy = 6(1, 3)(4, 9)
Both axes use the same scale, so the angle you see is the real angle.
Rise (Δy)6
Run (Δx)3
DirectionRising
Ratio 1:N1:0.5 (rise : run)
Distance between points6.7082
Midpoint(2.5, 6)
Slope-intercept formy = 2x + 1
Point-slope formy - 3 = 2(x - 1)
Standard form2x - y = -1
y-intercept(0, 1)
x-intercept(-0.5, 0)
Show the math
Slopem = (y2 − y1) / (x2 − x1) = (9 − 3) / (4 − 1) = 6 / 3 = 2
Interceptb = y1 − m × x1 = 3 − 2 × 1 = 1
Slope-intercepty = mx + b: y = 2x + 1
Point-slopey − y1 = m(x − x1): y - 3 = 2(x - 1)
Standard formAx + By = C with A = Δy, B = −Δx, C = A × x1 + B × y1, then divide by the greatest common factor: 2x - y = -1
Angleangle = atan(m) = atan(2) = 63.4349°
Percent gradegrade = 100 × m = 100 × 2 = 200%
Ratio 1:NN = 1 / |m| = 1 / 2 = 0.5, so 1:0.5 (1 up for every 0.5 across)
Distanced = sqrt(Δx² + Δy²) = sqrt(3² + 6²) = 6.7082
Midpoint((x1 + x2) / 2, (y1 + y2) / 2) = ((1 + 4) / 2, (3 + 9) / 2) = (2.5, 6)

Short answer: Slope is rise divided by run: m = (y2 − y1) / (x2 − x1). For (1, 3) and (4, 9) the rise is 6 and the run is 3, so m = 6/3 = 2: the line rises 2 units for every 1 unit you move right.

The slope fixes how steep a line is and which way it leans. The same number also gives the percent grade of a ramp or road, the angle of an incline and the 1:N ratio builders quote. This page covers the formula, the equation forms that follow from it, the vertical and horizontal cases and the grade conversions.

2
Slope m
Through (1, 3) and (4, 9): 6 up, 3 across.
200%
Percent grade
The slope times 100.
63.43°
Angle
Measured from the horizontal.
y = 2x + 1
Equation
Slope-intercept form, crossing the y axis at (0, 1).

This article contains Amazon affiliate links. 33science earns a commission on qualifying purchases. See our affiliate disclosure.

How to use the slope calculator

Pick the mode.
Two points is the default. Choose point and slope when you know one point and m, or rise and run when you measured a vertical and a horizontal distance.
Enter the numbers.
In two-point mode type x1, y1, x2 and y2. Negatives, decimals and fractions such as 3/4 are accepted. The starting values, (1, 3) and (4, 9), give a slope of 2.
Set the units for rise and run.
Choose feet, metres, inches or centimetres when the numbers are distances. The slope itself has no unit.
Read the result.
The slope appears as a decimal, a reduced fraction and a percent grade, next to the equation, intercepts, angle, 1:N ratio, distance, midpoint and a graph with the rise and run triangle.
Check it by plotting.
Plot both points on graph paper or a graphing calculator and compare the line with the graph above.
Desk with a calculator, an open notebook, a pencil and a small plant
Plot the two points, draw the line and count rise over run to confirm the calculator. Photo by Cht Gsml on Unsplash

The slope formula

In words: slope equals the change in y divided by the change in x, or rise over run. In symbols, for a line through (x1, y1) and (x2, y2), m = (y2 − y1) / (x2 − x1) (OpenStax Intermediate Algebra).

Worked example with (1, 3) and (4, 9):

Find the rise.
y2 − y1 = 9 − 3 = 6.
Find the run.
x2 − x1 = 4 − 1 = 3.
Divide.
m = 6 / 3 = 2.

Because slope is also the tangent of the angle the line makes with the horizontal (MathWorld), the angle is the inverse tangent of 2, which is 63.43°. The distance between the points is 6.708 and the midpoint is (2.5, 6).

Key point
Subtract in the same order on top and bottom. Start from either point you like: swapping both subtractions flips two signs and gives the same answer, -6 / -3 = 2.

The slope of a line: positive, negative, zero or undefined

A straight line has one slope everywhere along it. Its sign tells you the direction the line takes as you read it from left to right.

SlopeWhat the line doesWhen it happensExample
PositiveRisesy grows as x growsm = 2, y = 2x + 1
NegativeFallsy shrinks as x growsm = -2/3 (-0.6667), y = -(2/3)x + 5
ZeroHorizontaly1 = y2, so the rise is 0y = -6
UndefinedVerticalx1 = x2, so the run is 0x = -3

A horizontal line has a slope of zero because nothing is gained in y. A vertical line has an undefined slope because the formula divides by a run of zero, and division by zero has no value (OpenStax). The two are different cases: zero is a number, undefined is the absence of one. A vertical line is written as x = c, like x = -3, and has no slope-intercept form. The calculator labels each result as rising, falling, horizontal or vertical.

The steeper the line, the larger the size of m. A slope of -0.6667 is gentler than one of 2, and the minus sign only says it leans the other way.

Slope intercept form and point slope form

Once you have m, one more point gives the equation of the line. The calculator writes it three ways (OpenStax).

Slope-intercept form

The form is y = mx + b, where b is where the line crosses the y axis. Find b with b = y1 − m × x1. For the example, b = 3 − 2 × 1 = 1, so the line is y = 2x + 1 with y-intercept (0, 1) and x-intercept (-0.5, 0).

Point-slope form

The form is y − y1 = m(x − x1) (MathWorld). It needs no intercept: put in a point and the slope. With (1, 3) and m = 2 it reads y – 3 = 2(x – 1). Use point-and-slope mode when that is all you know.

FormPatternExample
Slope-intercepty = mx + by = 2x + 1
Point-slopey − y1 = m(x − x1)y – 3 = 2(x – 1)
StandardAx + By = C2x – y = -1

All three describe the same line. Expand the point-slope example and it becomes the slope-intercept one.

Slope as percent grade, angle and ratio

Percent grade is the slope times 100: grade = rise / run × 100, measured against horizontal distance (FHWA). A road that climbs 2 m over 40 m has a slope of 1/20, a grade of 5% and an angle of 2.862°. The angle is the inverse tangent of the slope, and the ratio 1:N means 1 unit of rise for N units of run.

Ratio (rise:run)Slope mPercent gradeAngle
1:200.055%2.862°
1:12 (ADA maximum ramp)0.083338.333%4.764°
1:80.12512.5%7.125°
1:40.2525%14.04°
1:20.550%26.57°
1:11100%45°
2:12200%63.43°

Grade is not capped at 100%. A grade of 100% is a 45° line, and steeper lines pass it: 200% is 63.43°. The angle never reaches 90°: a 90° line is vertical and has no defined grade.

For ramps, the US Access Board sets the maximum running slope at 1:12 (US Access Board). That is a slope of 0.08333, 8.333% or 4.764°. A ramp that climbs 30 inches at that slope needs 360 inches (30 feet) of run.

Common slope mistakes

Do
Subtract y values on top and x values on the bottom
Keep the same point first in both subtractions
Put rise on top and run on the bottom
Write a vertical line as x = c
Avoid
Divide run by rise
Reverse the order in the numerator only
Pair x1 with y2 when reading the points
Report a vertical line as slope 0

The usual slip is an inverted fraction. Run over rise for the example gives 3 / 6, the reciprocal of the true 2, so check that a line that looks steep has a large number. Mixed-up signs come next: when one subtraction runs left to right and the other right to left, the sign of m flips.

Slope in the real world

Ramps, driveways, stairs, drainage and roads all describe steepness as a slope. A builder measures the vertical rise and the horizontal run separately, then divides.

Hands holding a tape measure against a short ramp to read its vertical rise, with a notebook and phone beside it
Measure rise straight up and run straight along the ground, not along the surface of the ramp.

A digital level or angle gauge reads the angle of a surface directly. Convert it with m = tan(angle), or enter the rise and run you measured in ratio mode to get the grade.

Steep cobblestone street climbing between old buildings on a cloudy day
A steep street is a large positive slope. A 12.5% grade rises 1 unit for every 8 of run. Photo by Claudio on Unsplash

The same slope reads as a ratio in one trade and a percent in another. 1:20, 5% and 2.862° are one slope, and the table above converts between them.

Sources

Frequently asked questions

What is the slope formula?

The slope formula is m = (y2 – y1) / (x2 – x1), the change in y divided by the change in x. For the points (1, 3) and (4, 9) it gives 6 / 3 = 2.

What is the slope of a horizontal line?

The slope of a horizontal line is 0, because both points have the same y value and the rise is 0. Its equation has the form y = c, such as y = -6.

What if the line is vertical?

The slope of a vertical line is undefined, because both points have the same x value and the formula divides by a run of 0. Its equation has the form x = c, such as x = -3.

How do positive and negative slopes differ?

A positive slope means the line rises from left to right and a negative slope means it falls. A slope of -2/3 falls 2 units for every 3 units you move right.

How do you convert slope percentage to degrees?

Divide the percent by 100 to get the slope, then take the inverse tangent of it. A grade of 5% is a slope of 0.05, which is 2.862 degrees.

What is a 10% slope?

A 10% slope rises 1 unit for every 10 units of run, written 1:10. Its angle is 5.711 degrees.

Can slope percentage be over 100%?

Yes. A grade of 100% is a 45 degree line, and any steeper line is above 100%. A slope of 2 is 200% at 63.43 degrees.

How do I find the slope from an equation?

Write the equation as y = mx + b and read m, the number multiplying x. In y = 2x + 1 the slope is 2.