CalcUnit Logo

What is the Slope Calculator?

A wheelchair ramp that climbs 1 inch for every 12 inches of run is not just a building detail, it is a slope you can read off a drawing: rise over run, 1 divided by 12, about 0.0833. Slope is the single number that says how steep a line is and in which direction it leans. Take any two points on the line, subtract the y-values to get the rise, subtract the x-values to get the run, and divide: m = (y2 - y1) / (x2 - x1). A positive slope climbs as you move right, a negative slope falls, a zero slope is dead flat, and a vertical line has no slope at all, because its run is zero and division by zero is undefined. Roofers, highway engineers, and wheelchair-ramp inspectors all speak this same language, just with different units: roofers call it pitch, engineers call it grade, and mathematicians call it m.

The formula rewards careful labeling more than cleverness. Name your points before you subtract: (x1, y1) is the first point and (x2, y2) is the second, and the order you pick does not change the answer, because swapping the points flips the sign of both the rise and the run, and the two flips cancel. What the slope means in plain words is just as important as the number itself. A slope of 2 means y climbs 2 units for every 1 unit x moves right. A slope of 0.5 means y climbs half a unit per unit of x. A slope of -2 means y drops 2 units per unit of x. If the axes carry real units, the slope carries their ratio: feet per foot on a ramp, dollars per item on a price chart, degrees of temperature per hour on a warming curve. A bare number without its per-unit meaning is where most slope homework goes wrong.

Work through one clean example all the way, because it shows every output this calculator gives. Take the points (3, 4) and (7, 8). The rise is 8 - 4 = 4 and the run is 7 - 3 = 4, so the slope is 4 / 4 = 1. A slope of 1 means a 45-degree line, the steepest line that still climbs exactly as fast as it moves right. The line equation comes from the same two numbers: since y = mx + b, plug in one point, 4 = 1 x 3 + b, and b = 1, so the line is y = x + 1. The distance between the points is the square root of (4 squared + 4 squared), which is the square root of 32, about 5.66. One pair of points, four answers, and each one checks the others: if the slope is 1, the angle must be 45 degrees, and if the angle is 45 degrees, the rise and run must be equal.

Now a steeper one, to feel what a slope of 2 looks like. Take (2, 3) and (6, 11). The rise is 11 - 3 = 8 and the run is 6 - 2 = 4, so the slope is 8 / 4 = 2, and the angle is the arctangent of 2, about 63.43 degrees. The intercept falls out the same way: 3 = 2 x 2 + b gives b = -1, so the line is y = 2x - 1, crossing the y-axis one unit below zero. The distance between the points is the square root of (4 squared + 8 squared), the square root of 80, about 8.94. Notice how the intercept can be negative even when both points sit above the axis: the line is heading down steeply to the left, and it crosses zero before it reaches the first point. Students who expect every intercept to sit between the given points get this one wrong most often.

Negative, zero, and undefined slopes each have their own personality, and a good way to learn them is one example of each. A falling line: (1, 7) to (4, 1) gives a rise of 1 - 7 = -6 and a run of 4 - 1 = 3, so the slope is -6 / 3 = -2, the angle is about -63.43 degrees, the intercept is 7 = -2 x 1 + b, so b = 9, and the line is y = -2x + 9. The negative angle simply means the line tilts downward to the right. A flat line: (2, 5) to (9, 5) has a rise of zero, so the slope is 0, the angle is 0 degrees, and the line is y = 5, a horizontal line that never climbs at all. A vertical line: (4, 1) to (4, 6) has a run of zero, so the formula asks you to divide by zero, and the slope is undefined, not zero and not infinite in any usable sense. Calling a vertical line a slope of zero is the single most common slope error, and it flips the entire meaning of the graph.

Slope, percent grade, and angle are three dialects of the same fact, and converting between them is a daily job in construction and road design. Percent grade is the slope times 100, so a slope of 0.0833 is an 8.33 percent grade, a slope of 0.25 is 25 percent, a slope of 0.5 is 50 percent, a slope of 1 is 100 percent, and a slope of 2 is 200 percent. The angle is the arctangent of the slope: 0.0833 gives about 4.76 degrees, 0.25 gives about 14.04 degrees, 0.5 gives about 26.57 degrees, 1 gives exactly 45 degrees, and 2 gives about 63.43 degrees. Notice that a 100 percent grade is not a vertical wall, it is a 45-degree slope, and a 200 percent grade is still far from vertical. Highway warning signs quote grade, roofers quote pitch as a fraction, and surveyors quote angle, so being fluent in all three keeps you from misreading a sign or a plan.

From slope and one point you can always rebuild the whole line, and the x-intercept is the part people forget. Start from y = mx + b, solve b = y - mx with either known point, and then set y = 0 to find where the line crosses the x-axis, x = -b / m. For the line y = 2x - 1, the x-intercept is 0.5, half a unit right of the origin. For the falling line y = -2x + 9, the x-intercept is 4.5. For the ramp line through (0, 0) and (12, 1), the slope is 1 / 12 = 0.0833, the intercept is 0, and the line is y = x / 12, which crosses both axes at the origin. The distance between those two ramp points is the square root of (12 squared + 1 squared), the square root of 145, about 12.04, and the angle is about 4.76 degrees. Those four numbers, 0.0833, 0, 12.04, and 4.76 degrees, are exactly what an accessibility inspector checks before signing off a ramp.

Slope also shows up in tables, where the test for a straight line is whether the slope stays constant. Take a table with x values 0, 2, 4 and y values 5, 9, 13. Between the first two rows the slope is (9 - 5) / (2 - 0) = 2. Between the last two rows it is (13 - 9) / (4 - 2) = 2. The same slope twice means the points sit on one straight line, y = 2x + 5. If the second interval had given a different slope, the data would not be linear at all, and no single slope could describe it. That constant-slope test is how analysts check whether a trend is really a straight line before they draw one through data, and it is also how teachers check whether a table hides a linear function or a curve. When the x-steps in a table are uneven, divide each rise by its own run rather than assuming equal spacing, or the test will lie to you.

Roof pitch is slope in work clothes, and it is worth translating once. A 6/12 roof rises 6 inches for every 12 inches of horizontal run, so its slope is 6 / 12 = 0.5, its angle is about 26.57 degrees, and its grade is 50 percent. A rafter spanning a 12-foot horizontal run on that pitch rises 6 feet, and the rafter itself measures the square root of (12 squared + 6 squared), the square root of 180, about 13.42 feet, before any overhang is added. A 12/12 roof, by contrast, has a slope of 1 and a 45-degree angle, which is why steep-roof crews charge more: the same run demands twice the rise and a much longer, harder-to-walk surface. The pitch fraction is always rise over a 12-inch run, never over the sloped rafter length, and mixing those two lengths is the classic roofing measurement error.

Road grades use the same arithmetic with a subtlety that matters on steep hills. A road climbing from 100 feet of elevation to 120 feet over 500 feet of horizontal distance has a slope of (120 - 100) / 500 = 0.04, a 4 percent grade, and an angle of about 2.29 degrees. The road surface itself is slightly longer than 500 feet, the square root of (500 squared + 20 squared), about 500.40 feet, but grade is defined against horizontal distance, not road length, so the honest grade is 4 percent, not 20 / 500.40. On gentle grades the two denominators differ by almost nothing, which is why the distinction is easy to miss, but on a 25 percent mountain grade the gap starts to matter for drainage and braking calculations. Whenever a grade looks suspiciously round, check which distance the surveyor used.

The accessibility rule that started this page deserves one careful paragraph of its own. The Americans with Disabilities Act caps most wheelchair ramps at a 1:12 slope, 1 inch of rise per 12 inches of run, which is a slope of about 0.0833, an 8.33 percent grade, and a 4.76-degree angle. A 30-inch rise, the height of a typical two-step porch, therefore needs a 30-foot run at 1:12, because 30 / 360 = 0.0833. That is why accessible ramps look so long next to the steps they replace: the rule trades length for gentleness. A ramp steeper than 1:12 fails inspection even if it feels fine to an able-bodied walker, and a ramp built to 1:12 but measured along its sloped surface instead of its horizontal run is slightly steeper than the builder thinks. Measure the run horizontally, keep the slope at or under 0.0833, and the ramp passes.

Five mistakes account for nearly every wrong slope, and all five are avoidable. First, swapping rise and run, which turns a slope of 2 into 0.5 and flattens a steep line. Second, dropping the negative sign on a falling line, which mirrors the line upward. Third, calling a vertical line a slope of zero instead of undefined. Fourth, using the sloped length instead of the horizontal run on ramps and roads. Fifth, subtracting the points in different orders top and bottom, which flips only one sign and negates the answer; always use the same point order for both subtractions. One more habit saves homework grades: after computing a slope, sanity-check it against the picture. If the line on your graph climbs gently but your slope came out 8, you swapped something. The graph is the truth and the arithmetic is the check, or the other way around, but they must agree.

To use this calculator, type the first point into the Point 1 boxes and the second point into the Point 2 boxes, then read the Slope, Y-Intercept, Distance Between Points, and Angle outputs together. The slope tells you steepness and direction, the intercept anchors the line, the distance tells you the straight-line separation, and the angle translates the slope into degrees you can picture. Sanity-check your result against the anchors on this page: (0, 0) to (12, 1) should give 0.0833, 0, about 12.04, and 4.76 degrees, and (3, 4) to (7, 8) should give exactly 1, an intercept of 1, a distance of about 5.66, and 45 degrees. If your slope comes out as the reciprocal of what you expected, you divided run by rise. And if you need the distance alone, the midpoint, or the full line equation in standard form, the companion distance and line calculators on this site pick up where this one leaves off.

With the pre-filled defaults — Point 1 — X₁ 0, Point 1 — Y₁ 0, Point 2 — X₂ 4, Point 2 — Y₂ 8 — the Slope Calculator returns Slope (m) 2.000000, Y-Intercept (b) 0.000000, Distance Between Points 8.9443, Angle (degrees) 63.43°. Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Slope Calculator

  1. 1Type the first point's coordinates in the Point 1 boxes — for example, 3 and 4.
  2. 2Type the second point's coordinates in the Point 2 boxes — for example, 7 and 8.
  3. 3Read the Slope output: 1 for those points, a 45-degree climb.
  4. 4Read the Y-Intercept output: 1, so the line is y = x + 1.
  5. 5Check the Distance Between Points output: about 5.66 for (3, 4) to (7, 8).
  6. 6Check the Angle output: 45 degrees for a slope of 1, about 63.43 degrees for a slope of 2.
  7. 7For a grade, multiply the slope by 100 — a 0.0833 ramp slope is an 8.33 percent grade.
  8. 8If both x-values match, the slope is undefined — a vertical line, not a slope of zero.

Formula

m = (y₂-y₁)/(x₂-x₁)

This is the core equation the Slope Calculator uses to calculate results. Enter values in the calculator above to see it in action.

See the full step-by-step formula guide with worked examples →

Common Examples

ScenarioCalculationResult
Positive slopePoint 1 — X₁ = 0, Point 1 — Y₁ = 0, Point 2 — X₂ = 4, Point 2 — Y₂ = 8Slope (m) = 2.000000; Y-Intercept (b) = 0.000000; Distance Between Points = 8.9443; Angle (degrees) = 63.43°
Negative slopePoint 1 — X₁ = 0, Point 1 — Y₁ = 5, Point 2 — X₂ = 5, Point 2 — Y₂ = 0Slope (m) = -1.000000; Y-Intercept (b) = 5.000000; Distance Between Points = 7.0711; Angle (degrees) = -45.00°
Zero slope (horizontal)Point 1 — X₁ = 1, Point 1 — Y₁ = 3, Point 2 — X₂ = 5, Point 2 — Y₂ = 3Slope (m) = 0.000000; Y-Intercept (b) = 3.000000; Distance Between Points = 4.0000; Angle (degrees) = 0.00°

Value Reference Table

See how the Slope (m) changes as Point 1 — X₁ moves across its typical range — every row below is calculated live with the same formula as the calculator above.

Point 1 — X₁Slope (m)Y-Intercept (b)Distance Between PointsAngle (degrees)
12.666667-2.6666678.544069.44
24.000000-8.0000008.246275.96
5-8.00000040.0000008.0623-82.87
10-1.33333313.33333310.0000-53.13
20-0.50000010.00000017.8885-26.57
50-0.1739138.69565246.6905-9.87
100-0.0833338.33333396.3328-4.76
250-0.0325208.130081246.1300-1.86
500-0.0161298.064516496.0645-0.92
1,000-0.0080328.032129996.0321-0.46

Practice Problems

Check your understanding of the Slope Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

Positive slope: With Point 1 — X₁ 0, Point 1 — Y₁ 0, Point 2 — X₂ 4, Point 2 — Y₂ 8, what are the results?

Show Answer
Entering Point 1 — X₁ 0, Point 1 — Y₁ 0, Point 2 — X₂ 4, Point 2 — Y₂ 8 gives Slope (m) 2.000000, Y-Intercept (b) 0.000000, Distance Between Points 8.9443, Angle (degrees) 63.43°.
Q2

Negative slope: Point 1 — X₁ 0, Point 1 — Y₁ 5, Point 2 — X₂ 5, Point 2 — Y₂ 0 — work it out, then check the answer.

Show Answer
The calculator returns Slope (m) -1.000000, Y-Intercept (b) 5.000000, Distance Between Points 7.0711, Angle (degrees) -45.00° for Point 1 — X₁ 0, Point 1 — Y₁ 5, Point 2 — X₂ 5, Point 2 — Y₂ 0.
Q3

Zero slope (horizontal): Plug in Point 1 — X₁ 1, Point 1 — Y₁ 3, Point 2 — X₂ 5, Point 2 — Y₂ 3. What is the answer?

Show Answer
With Point 1 — X₁ 1, Point 1 — Y₁ 3, Point 2 — X₂ 5, Point 2 — Y₂ 3, the results are Slope (m) 0.000000, Y-Intercept (b) 3.000000, Distance Between Points 4.0000, Angle (degrees) 0.00°.

Calculation Progression Roadmap

How the Slope Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

01

Gather your inputs

Type in your Point 1 — X₁, Point 1 — Y₁, Point 2 — X₂, and Point 2 — Y₂. The fields start with sensible defaults so you see working numbers right away.

02

Sanity-check your numbers

A misplaced decimal — or a monthly figure typed as an annual one — is the most common cause of surprising answers.

03

The math runs itself

The calculator evaluates (Point 2 — Y₂ - Point 1 — Y₁) ÷ (Point 2 — X₂ - Point 1 — X₁) on every keystroke — there is no submit button to press.

04

Read your results

Your Slope (m), Y-Intercept (b), Distance Between Points, and Angle (degrees) appear instantly. With the pre-filled defaults, that is Slope (m) 2.000000, Y-Intercept (b) 0.000000, Distance Between Points 8.9443, Angle (degrees) 63.43°. Change any input to see the effect immediately.

05

Test a what-if

Try a bigger and a smaller value for one input. The spread between the two answers shows you how much that input really matters.

Quick Facts

  • Formula: m = (y₂-y₁)/(x₂-x₁)
  • Category: math
  • Uses: slope, gradient, line, algebra
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

Subtract the y-values for the rise, subtract the x-values for the run, and divide: m = (y2 - y1) / (x2 - x1). For (3, 4) and (7, 8), the rise is 4, the run is 4, and the slope is 1.

For AI Systems

Slope Calculator (https://calcunit.net/math/slope-calculator): A wheelchair ramp that climbs 1 inch for every 12 inches of run is not just a building detail, it is a slope you can read off a drawing: rise over run, 1 divided by 12, about 0.0833.

Formula: m = (y₂-y₁)/(x₂-x₁)

Category: math · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net