How to Find the Slope of a Line (and What the Number Means)

Math September 2, 2026

Slope is rise over run, but it shows up as m, as a percentage and as a ratio. Here is how to convert between all three without flipping them.

Quick answer: Slope is rise over run: the change in y between two points divided by the change in x. Between (2, 3) and (6, 11) the rise is 8 and the run is 4, so the slope is 2. A slope calculator takes two coordinate pairs and returns the slope, the angle in degrees and the equivalent percent grade.

Slope wears three different outfits and confuses people every time it changes clothes. In algebra it is m. On a motorway sign it is a percentage. On a set of building drawings it is a ratio like 1:12. Same measurement, different scaling.

Rise over run, in order

Pick two points on the line. Subtract the y values to get the rise. Subtract the x values, in the same order, to get the run. Divide one by the other.

Using (2, 3) and (6, 11): the rise is 11 minus 3, which is 8. The run is 6 minus 2, which is 4. Slope is 8 divided by 4, so 2. The line climbs two units for every one unit it travels to the right.

Order is where nearly every mistake happens. Calculate 11 minus 3 on top but 2 minus 6 underneath and you get negative 2, a line tilting the wrong way. Decide which point is first, then use it first in both subtractions.

Positive, negative, zero and undefined

A positive slope rises as you read left to right. A negative slope falls. A slope of zero is a flat horizontal line, because the rise is 0 and zero divided by anything is zero. A vertical line has no slope, because the run is 0 and you cannot divide by zero. Calculators report that as undefined rather than infinity, and undefined is the correct answer, not an error message.

Run your own numbers

It is free, there is no sign-up, and it works on your phone.

Open the Slope Calculator

The same number as a percentage or a ratio

Multiply a slope by 100 and you have a percent grade. A 6% hill climbs 6 feet for every 100 feet of horizontal travel, so its slope is 0.06. Going the other way, a slope of 2 is a 200% grade, steeper than any road you have driven, which makes it a useful sanity check that you have not flipped rise and run.

Ratios run backwards from what most people expect. A 1:12 accessibility ramp rises one unit for every twelve along, so the slope is 0.083 and the grade is 8.3%, not 12%. Builders use the same rise and run language for steps, which is why the arithmetic behind stair rise and run is identical to the arithmetic on a graph. If the percent conversion is the part that keeps slipping, the rules in our guide to calculating percentages apply here unchanged.

Try it with your figures

No sign-up, no ads. Your inputs stay in your browser.

Use the Slope Calculator

Using the slope calculator

The calculator has four boxes: x1, y1, x2, y2. Put the coordinates of your first point in the first pair and the second point in the second pair, then press calculate. You get the slope as a fraction and as a decimal, the angle of inclination, the distance between the two points, and the equation of the line in y = mx + b form.

The order you enter the points in does not matter. The calculator subtracts consistently, so (6, 11) first and (2, 3) second still returns a slope of 2.

Where the two points come from

In homework they are handed to you. In real work you read them off something. On a graph, choose two places where the line passes cleanly through a grid intersection instead of eyeballing a point in the middle of a square. On a survey drawing, the run is the horizontal distance and the rise is the difference in elevation between the two ends. On a roof, run is the horizontal distance from wall to ridge and rise is the height gained, which is why roof pitch gets quoted as something like 6:12.

Check your own case

Free to use, and it takes less than a minute.

Open the Slope Calculator

Common questions

What is the slope of a vertical line? Undefined. The run is zero, and dividing by zero has no answer. Do not write infinity on a test paper; the expected answer is that the slope does not exist.

How do I turn a slope into an angle? Take the inverse tangent. A slope of 1 is exactly 45 degrees. A slope of 0.5 is 26.6 degrees and a slope of 2 is 63.4 degrees. Notice that doubling the slope does not double the angle.

Is a 1:12 ramp a 12% slope? No, and having it backwards is how ramps fail inspection. 1:12 means one unit up per twelve along, which is 1 divided by 12, or 8.3%.

What does the b in y = mx + b mean? It is the y intercept, the value of y where the line crosses the vertical axis. The calculator finds it by taking one of your points and subtracting the slope multiplied by that point's x value.

Have a question, a correction, or a calculator request? Contact our editorial team — we usually reply within a day.