About the Slope Calculator
This slope calculator finds the slope of the straight line through two points. Enter (x₁, y₁) and (x₂, y₂) and it returns the slope m (rise over run), the angle of the line in degrees, the percent grade, the y-intercept, the distance between the points and the equation of the line in slope-intercept form, y = mx + b.
It is designed for algebra students working with linear equations and for practical questions about steepness: the grade of a road or driveway, the fall of a drain pipe, the pitch of a ramp or the trend between two data points. The chart plots the line so you can see its direction at a glance.
A positive slope rises from left to right and a negative slope falls. If both points share the same x value the line is vertical and its slope is undefined; the calculator flags this, gives the equation as x = constant and hides the y-intercept (a vertical line never crosses the y-axis unless it is the y-axis itself). Very small slopes are shown to four significant figures in the equation so they never round down to a flat y = 0.
With the default inputs, the slope (m) is 2. Change any value above to recalculate instantly.
How to use the slope calculator
- 1Enter the coordinates of the first point.
- 2Enter the coordinates of the second point.
- 3Read the slope, then the equation, intercept, angle and grade.
- 4Check the chart to confirm the line’s direction.
Formula and method
Slope measures how much y changes for each one-unit change in x — the rise divided by the run. Because a straight line has the same steepness everywhere, any two distinct points on it give the same slope.
With the slope known, the y-intercept b follows by substituting one point into y = mx + b. The angle of inclination is the arctangent of the slope, measured from the positive x-axis, and the percent grade used for roads and ramps is simply the slope × 100. A vertical line has zero run, so its slope is undefined.
- m
- Slope — rise over run
- b
- y-intercept, where the line crosses the y-axis
- θ
- Angle between the line and the x-axis
- (x₁, y₁), (x₂, y₂)
- The two points on the line
Worked examples
Line through (1, 2) and (5, 10)
Rise = 10 − 2 = 8 and run = 5 − 1 = 4, so m = 2. Substituting (1, 2) gives b = 0, so the line is y = 2x, inclined at arctan 2 ≈ 63.43°.
Falling line through (−2, 4) and (6, 0)
Rise = −4 over a run of 8 gives m = −0.5. From y = −0.5x + b with (6, 0), b = 3. The negative angle shows the line slopes downward.
Road climbing 6 m over 100 m
A 6 m rise over a 100 m run is a slope of 0.06 — a 6% grade, or about 3.43°. The road surface itself is slightly longer than the run, about 100.18 m.
Very gentle slope: (0, 1) to (30000, 2)
A rise of 1 over a run of 30,000 gives m = 1 ÷ 30,000 ≈ 0.00003333 (a 0.00333% grade, about 0.0019°). Such a tiny slope would round to 0 at four decimal places, so the equation keeps four significant figures: y = 0.00003333x + 1.
Frequently asked questions
How do you find the slope between two points?+
Subtract the y-values and divide by the difference of the x-values in the same order: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (5, 10) that is 8 ÷ 4 = 2.
What does a negative slope mean?+
A negative slope means the line goes down as you move to the right: y decreases as x increases. A slope of −0.5 drops half a unit for every unit across.
What is the slope of a vertical line?+
Undefined. Both points share the same x, so the run is zero and division by zero is impossible. The line is written x = constant instead of y = mx + b.
How do I convert slope to degrees or percent grade?+
Angle = arctan(slope) and grade = slope × 100%. A slope of 1 is a 45° angle and a 100% grade; the 1:12 maximum running slope for ramps in the ADA Standards is a slope of 0.0833, about 8.33% or 4.76°.
What is slope-intercept form?+
It is y = mx + b, where m is the slope and b is the y-intercept. Once you know the slope, plug one point into the equation to solve for b.