Geometry
Slope Calculator: Find Slope From Two Points, Grade And Angle
Last updated: October 2026
A slope calculator finds how steep a line is by dividing the rise by the run: m = (y₂ − y₁) ÷ (x₂ − x₁). For the points (1, 2) and (4, 8), the slope is (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. As a grade, a slope of 2 is 200%, or about 63.4°.
- Free, no sign-up
- Shows the working
- Runs on your device
Slope is one of the first ideas in algebra, and it is also how builders describe ramps, roofs and drains. This guide explains what slope means, how to use the slope calculator above, how to find slope from points and equations, and how to convert slope into percent grade, degrees and roof pitch. Every example was checked in Python.
What Is Slope?
Slope measures how steep a line is and which way it tilts. It compares the vertical change (the rise) to the horizontal change (the run) between any two points on the line.
Slope = rise ÷ run
The letter m usually stands for slope. A slope of 2 means the line goes up 2 units for every 1 unit it moves to the right. A slope of 1/3 means it goes up 1 unit for every 3 units to the right, which is much gentler.
Slope is also a rate of change. If a graph shows distance over time, the slope is the speed. If it shows cost over the number of items, the slope is the price per item. That is why slope shows up in science, money and data, not just in math class.
A straight line has the same slope everywhere. That is what makes it straight. Any two points on the line give the same answer.
How To Use The Slope Calculator
The slope calculator above has three tabs, and each one shows its steps.
- Two Points: enter the coordinates of two points. You get the slope as a fraction and a decimal, the line equation, the angle, the percent grade, the distance, the midpoint and a graph.
- Point and Slope: enter one point and a slope to get the line equation, more points on the line, and parallel and perpendicular slopes.
- Grade and Pitch Converter: enter a slope in any form, such as 1:12, 6/12 or 5%, and see it in every other form, plus the total fall over a distance.
You can type fractions like 3/4 and negative numbers like −2. If the two x-values match, the tool tells you the line is vertical.
The Slope Formula
The slope formula finds the slope from any two points (x₁, y₁) and (x₂, y₂):
m = (y₂ − y₁) ÷ (x₂ − x₁)
The top is the rise, the change in y. The bottom is the run, the change in x.
Example 1: (1, 2) and (4, 8)
- Rise: 8 − 2 = 6.
- Run: 4 − 1 = 3.
- Slope: 6 ÷ 3 = 2.
Example 2: (−2, 5) and (3, −5)
- Rise: −5 − 5 = −10.
- Run: 3 − (−2) = 5.
- Slope: −10 ÷ 5 = −2. The line falls as it moves right.
Example 3: (1, 3) and (5, 6)
- Rise: 6 − 3 = 3.
- Run: 5 − 1 = 4.
- Slope: 3/4, or 0.75. Leave it as a fraction in algebra class. If it needs reducing, the fraction calculator simplifies it.
Order does not matter, but consistency does. You can start with either point, as long as you subtract in the same order on the top and bottom. Mixing the order, such as y₂ − y₁ over x₁ − x₂, flips the sign and gives the wrong answer.
The Four Types Of Slope
Every line has one of four kinds of slope. You can tell which one by looking at the graph from left to right.
| Type | What the line does | Value | Example points |
|---|---|---|---|
| Positive | Rises left to right | Greater than 0 | (1, 2) and (4, 8): m = 2 |
| Negative | Falls left to right | Less than 0 | (−2, 5) and (3, −5): m = −2 |
| Zero | Flat (horizontal) | 0 | (0, 5) and (7, 5): m = 0 |
| Undefined | Straight up and down (vertical) | No value | (3, 4) and (3, 9): run is 0 |
A horizontal line has a slope of 0 because the rise is 0. Its equation is y = a number, such as y = 5.
A vertical line has an undefined slope because the run is 0, and you cannot divide by 0. Its equation is x = a number, such as x = 3. Students often mix these two up. A good memory trick: you can walk on a flat line (zero slope), but you cannot walk up a wall (undefined).
How To Find Slope From An Equation
If you have the equation of a line instead of two points, the slope is often sitting right in it. Which form the equation is in tells you where to look.
| Form | Equation | Slope | Example |
|---|---|---|---|
| Slope-intercept | y = mx + b | m | y = 4x − 7 has slope 4 |
| Point-slope | y − y₁ = m(x − x₁) | m | y − 2 = −3(x + 1) has slope −3 |
| Standard | Ax + By = C | −A ÷ B | 3x + 4y = 12 has slope −3/4 |
Example: 3x + 4y = 12
- Solve for y: 4y = −3x + 12.
- Divide by 4: y = −(3/4)x + 3.
- The slope is −3/4, and the y-intercept is 3.
If the equation has no x term, like y = 5, the slope is 0. If it has no y term, like x = 3, the slope is undefined.
How To Write The Equation Of A Line From Its Slope
Once you know the slope, you can write the full equation of the line. You need the slope and any one point on the line.
Example: the line through (2, 3) and (6, 11)
- Find the slope: (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2.
- Plug the slope and one point into y = mx + b: 3 = 2(2) + b.
- Solve for b: 3 = 4 + b, so b = −1.
- Write the equation: y = 2x − 1.
- Check with the other point: 2(6) − 1 = 11. ✔
You can also skip step 2 and use point-slope form right away: y − 3 = 2(x − 2). Expanding it gives the same line, y = 2x − 1. Point-slope form is faster when you only need an equation, and slope-intercept form is easier to graph.
Parallel And Perpendicular Slopes
Parallel lines have the same slope, and perpendicular lines have slopes that are negative reciprocals of each other. These two rules let you write the equation of a related line quickly.
- Parallel: a line parallel to y = 2x − 1 also has slope 2. For example, y = 2x + 5.
- Perpendicular: flip the slope and change its sign. The negative reciprocal of 2 is −1/2. So y = −(1/2)x + 4 is perpendicular to y = 2x − 1.
A quick check for perpendicular lines: multiply the two slopes. The product is always −1. Here, 2 × (−1/2) = −1. ✔
The one exception is a horizontal line and a vertical line. They are perpendicular, but the rule does not work, because the vertical line has no slope to multiply.
Slope, Angle And Distance
Slope connects directly to the angle a line makes with the horizontal and to the length of the line between two points. Both come from right triangle math.
Angle from slope. The angle θ is the inverse tangent of the slope: θ = arctan(m). For a slope of 2, θ = arctan(2) ≈ 63.43°. For a slope of 1, the angle is exactly 45°. A negative slope gives a negative angle, which means the line points downward.
Distance between the points. The rise and run form the legs of a right triangle, so the length of the line segment is √(run² + rise²). For (2, 3) and (6, 11), the run is 4 and the rise is 8, so the distance is √(16 + 64) = √80 ≈ 8.944. This is the Pythagorean theorem, and the Pythagorean theorem calculator handles any right triangle. The same idea gives the actual length of a sloped surface, like a ramp or a roof.
Slope As Percent Grade, Degrees And Ratio
In construction, roads and landscaping, slope is usually written as a percent grade, an angle or a ratio instead of a plain number. All of them describe the same thing: rise compared to run.
- Percent grade = (rise ÷ run) × 100. A rise of 5 feet over a run of 100 feet is a 5% grade.
- Degrees = arctan(rise ÷ run).
- Ratio is written rise:run, such as 1:12, which means 1 unit up for every 12 units across.
| Percent grade | Degrees | Ratio (rise:run) |
|---|---|---|
| 1% | 0.57° | 1:100 |
| 2% | 1.15° | 1:50 |
| 5% | 2.86° | 1:20 |
| 8.33% | 4.76° | 1:12 |
| 10% | 5.71° | 1:10 |
| 25% | 14.04° | 1:4 |
| 50% | 26.57° | 1:2 |
| 100% | 45° | 1:1 |
A 45° slope is a 100% grade, not 50%. This is the most common mix-up. At 45°, the rise equals the run, so rise ÷ run = 1, which is 100%. A 50% grade is only about 26.6°. Percent grade keeps climbing past 100% as the angle gets steeper, and it reaches infinity at 90°.
For percent conversions in general, the percentage calculator handles any ratio.
Slope In Construction And Everyday Life
Builders, plumbers, roofers and road engineers all work with slope every day, each with their own units. Here is how slope shows up in the most common projects.
Safety note: the numbers below are common guidelines. Building codes vary by city and state, so check local code or a licensed professional before you build.
Ramps
Wheelchair ramps are limited by slope so they can be used safely. Under the 2010 ADA Standards, a ramp's running slope can be no steeper than 1:12, and a single run can rise no more than 30 inches, as explained in the U.S. Access Board guide to ramps and curb ramps.
A 1:12 slope is about 8.33%, or 4.76°. To climb 24 inches at that slope, you need 24 × 12 = 288 inches, or 24 feet of ramp run. The Access Board also notes that a gentler slope than the maximum is easier for more people to use.
Drainage And Pipes
Drainage needs a small, steady slope so water moves without pooling. Slopes here are usually written in inches per foot or as a percent.
- A slope of 1/4 inch per foot is about 2.08%. It is a common target for small drain lines and patios.
- To find the total drop, multiply the grade by the length. A 2% slope over 50 feet drops 50 × 0.02 = 1 foot.
- Too flat a slope lets water and solids sit. Too steep a slope can make water outrun the solids in a drain pipe. Follow the slope your local plumbing code lists for each pipe size.
Roof Pitch
Roof pitch is written as rise over a 12-inch run, like 4/12 or 6/12. A 6/12 roof rises 6 inches for every 12 inches across.
| Roof pitch | Slope | Percent | Degrees |
|---|---|---|---|
| 3/12 | 0.25 | 25% | 14.04° |
| 4/12 | 0.333 | 33.3% | 18.43° |
| 6/12 | 0.5 | 50% | 26.57° |
| 12/12 | 1 | 100% | 45° |
Low-slope roofs, generally below about 3/12, often need different roofing materials than steeper roofs, because water drains off them more slowly.
Roads And Hills
Road signs warn drivers with a percent grade. A 6% grade means the road climbs or drops 6 feet for every 100 feet of horizontal distance, which is about 3.43°. That sounds small, but it is steep enough that trucks often need lower gears on long downhill stretches.
Slope In Physics And Data
Outside geometry, slope is the rate at which one quantity changes compared to another. Reading the slope of a graph is one of the most useful skills in science.
- Speed from a position graph. If a car's position goes from 20 meters at 2 seconds to 80 meters at 5 seconds, the slope is (80 − 20) ÷ (5 − 2) = 20 meters per second. That is its average speed.
- Acceleration from a velocity graph. The slope of a velocity-time graph is acceleration.
- Trend lines in data. Real data rarely falls on a perfect line, so analysts fit a line of best fit and use its slope. For the points (1, 2.1), (2, 3.9), (3, 6.2), (4, 7.8) and (5, 10.1), the best-fit slope is about 1.99, meaning y grows by about 2 for each step in x.
In Excel or Google Sheets, =SLOPE(known_ys, known_xs) returns the best-fit slope for a whole column of data. The statistics calculator covers the related measures of spread and averages.
The Slope Of A Curve
A curve does not have one slope. Its steepness changes from point to point, so you measure the slope at a single point using the line that just touches the curve there, called the tangent line.
Two ideas help:
- Average slope between two points on a curve uses the regular slope formula. The line through those two points is called a secant line. For y = x², the average slope from x = 1 to x = 3 is (9 − 1) ÷ (3 − 1) = 4.
- Slope at a point is what calculus calls the derivative. For y = x², the derivative is 2x, so the slope at x = 3 is exactly 6.
As the two points of a secant line move closer together, its slope gets closer to the tangent slope. That idea is the starting point of calculus.
Common Slope Mistakes
Most slope errors come from mixing up the order of subtraction, swapping rise and run, or confusing zero and undefined slopes.
| Mistake | Example | Fix |
|---|---|---|
| Putting x on top | (4 − 1) ÷ (8 − 2) for (1, 2) and (4, 8) | Rise over run: change in y on top |
| Subtracting in mixed order | (8 − 2) ÷ (1 − 4) = −2 | Use the same point first on top and bottom |
| Calling a vertical line "zero slope" | x = 3 has slope 0 | Vertical is undefined. Horizontal is 0 |
| Thinking 45° is a 50% grade | 45° = 50% | 45° = 100%. 50% ≈ 26.6° |
| Dropping a negative sign | 3 − (−2) = 1 | Subtracting a negative adds: 3 + 2 = 5 |
| Reading standard form slope as A | 3x + 4y = 12 has slope 3 | Slope is −A ÷ B = −3/4 |
Summary
- Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁).
- Lines have positive, negative, zero or undefined slope.
- In y = mx + b, the slope is m. In Ax + By = C, it is −A ÷ B.
- Parallel lines share a slope. Perpendicular slopes multiply to −1.
- Percent grade is slope × 100, and the angle is arctan(slope). A 45° slope is a 100% grade.
- For ramps, drains and roofs, check local code for the required slope.
Next step: enter your two points in the slope calculator at the top of this page, or browse more math tools on the Calc Solver homepage.
Frequently Asked Questions
What is a 1 in 20 slope?
A 1 in 20 slope rises 1 unit for every 20 units of horizontal distance. That is a 5% grade, or about 2.86°. It is a gentle slope, common for walkways. Under the ADA Standards, a walking surface steeper than 1:20 is treated as a ramp, which brings extra requirements such as handrails on longer runs. A 1 in 20 slope over 40 feet rises 2 feet.
What is a 1 to 5 slope in degrees?
A 1 to 5 slope, which rises 1 unit for every 5 units across, is about 11.31°. To get this, divide 1 by 5 to get 0.2, then take the inverse tangent: arctan(0.2) ≈ 11.31°. As a percent grade, it is 20%. This is a fairly steep slope, steeper than most driveways and far steeper than a wheelchair ramp.
Is slope the same as rate of change?
For a straight line, yes. The slope tells you how much y changes for each one-unit change in x, which is the rate of change. For a curve, the rate of change is different at each point, so it matches the slope of the tangent line at that point. Speed, price per item and growth per year are all rates of change.
What does a slope of 0.5 mean?
A slope of 0.5 means the line rises half a unit for every 1 unit it moves right. Put another way, it rises 1 unit for every 2 units across, a 1:2 ratio. As a percent grade, it is 50%, and as an angle it is about 26.57°. A 6/12 roof pitch has this same slope.
How do you find slope from a graph?
Pick two points where the line crosses grid corners, so their coordinates are easy to read. Count how many units the line goes up or down between them (the rise) and how many units it goes right (the run). Then divide rise by run. If the line goes down as you move right, the slope is negative.
Can a slope be greater than 1?
Yes. A slope greater than 1 means the line rises faster than it moves across, so it is steeper than 45°. For example, a slope of 3 rises 3 units for every 1 across, which is about 71.57°. There is no upper limit. As a line gets closer to vertical, its slope grows without bound.
Try it with your own numbers
Use a free CalcSolver tool to check the examples in this guide.