Last updated: August 21, 2026
Slope Calculator
| Format | Value | Meaning |
|---|---|---|
| Percent Grade | — | Rise per 100 units of run |
| Angle (Degrees) | — | Angle above horizontal |
| Ratio (X:1) | — | Run units per 1 unit of rise |
| Decimal Slope (m) | — | Raw rise/run value |
| x | y | Slope f(x,y) |
|---|
Slope Calculator: Find Slope, Equation, and Grade From Any Two Points
What This Calculator Does
A slope calculator finds how steep a line is. You enter two points on that line, and it tells you the slope.
Slope shows how much a line rises or falls as it moves sideways. It applies to math class, road signs, roof designs, and hiking trails.
This guide explains every part of the slope calculator. You will learn the formula, see worked examples, and find out how slope connects to percent grade, degrees, ratios, and even multi-point data sets.
Slope belongs to a branch of math called coordinate geometry (sometimes taught inside linear algebra). Understanding that background helps explain why the same rise-over-run idea shows up in so many unrelated fields.
Who Should Use a Slope Calculator
Students use this tool to check algebra homework. Teachers use it to build practice problems fast.
Builders and roofers use slope math to plan roof pitch and drainage. Homeowners use it to check driveway grade before pouring concrete.
Engineers and land surveyors use slope to meet code requirements. Hikers and cyclists use percent grade to judge trail difficulty.
Data analysts use a related version of slope — called a regression slope — to describe trends in a data set instead of a single straight line.
Slope Calculator vs. Related Math Tools
Before you scroll through the full explainer, confirm you have the right tool for your question.
| Tool | Best For |
|---|---|
| Slope Calculator | Finding steepness between two points |
| Percentage Calculator | General percent-based math problems |
| Percentage Change Calculator | Comparing two values over time |
| Right Triangle Calculator | Finding triangle sides and angles |
| Grade Calculator | Academic scoring, not slope |
| Graphing Calculator | Plotting full equations and curves |
In short: if you have two coordinate points and want steepness, this is your tool. If you have an angle and a side length instead, use the right triangle calculator. If you’re grading a test, the grade calculator — not this page — is what you want.
Why Slope Matters
Slope is one of the most useful numbers in math. It appears in geometry, algebra, physics, construction, and everyday life.
A single slope value can answer very different questions. Is this line steep? Will this ramp meet accessibility rules? Is this roof pitched enough for shingles?
Getting slope wrong has real consequences. A driveway with too much grade floods a garage. A roof with too little pitch leaks.
What Is Slope? A Simple Definition
Slope measures steepness. It compares vertical change to horizontal change between two points on a line.
Mathematicians call vertical change “rise.” They call horizontal change “run.”
Slope equals rise divided by run. A bigger number means a steeper line.
The Slope Formula
The standard slope formula is:
m = (y₂ − y₁) / (x₂ − x₁)
Here, m stands for slope. The letters x and y represent coordinates of two points on the line.
This formula works for any straight line on a coordinate plane. It is the foundation every other slope calculation builds on.
| Symbol | Meaning |
|---|---|
| m | Slope |
| (x₁, y₁) | First point |
| (x₂, y₂) | Second point |
| Δy | Rise (y₂ − y₁) |
| Δx | Run (x₂ − x₁) |
In short, m is just shorthand for “rise divided by run,” and Δy and Δx are the rise and run values you calculate before dividing.
How to Use the Slope Calculator
Follow these steps to find slope from two points.
Step 1: Identify Your Two Points
Write down the coordinates of both points. Label the first point (x₁, y₁) and the second point (x₂, y₂).
For example, use Point 1 (0, 0) and Point 2 (4, 8).
Step 2: Enter the Coordinates
Type the x and y values for each point into the calculator’s input fields. This tool defaults to (0, 0) and (4, 8) so you can see a sample result right away.
Step 3: Choose Your Display Precision
Select how you want the result rounded. Options include whole numbers, one decimal, two decimals, or a simplified fraction.
For example, a raw result of 4/2 automatically simplifies to 2 when you choose the fraction display, instead of showing the unreduced fraction.
Step 4: Read the Results
The calculator returns the slope as both a decimal and a fraction. It also shows rise, run, percent grade, angle in degrees, ratio format, and the direction of the line.
Step 5: View the Graph
The calculator draws the line on a coordinate plane, with both input points labeled and the connecting line rendered in color. This helps you confirm the answer visually before you use it for homework or a real project.
Worked Example: Calculating Slope From Two Points
Let’s calculate the slope between Point 1 (0, 0) and Point 2 (4, 8).
- Find the rise: Δy = 8 − 0 = 8
- Find the run: Δx = 4 − 0 = 4
- Divide rise by run: m = 8 / 4 = 2
The slope is 2. In plain English, for every 1 unit the line moves right, it rises 2 units.
A Second Example With Negative Slope
Try Point 1 (2, 6) and Point 2 (5, 0).
Δy = 0 − 6 = −6 Δx = 5 − 2 = 3 m = −6 / 3 = −2
The slope is −2. This line falls as it moves right, which is a negative slope.
Understanding Slope Direction
Slope direction tells you the shape of the line at a glance. There are four possible cases.
A vertical line has no run — both points share the same x-value, so Δx equals zero. Dividing by zero is impossible in math, which is why vertical lines have an undefined slope instead of a numeric one.
A horizontal line has no rise — both points share the same y-value, so Δy equals zero. Zero divided by any run still equals zero, which is why horizontal lines always have a slope of exactly 0.
| Slope Value | Direction | Line Behavior |
|---|---|---|
| Positive (m > 0) | Uphill | Rises left to right |
| Negative (m < 0) | Downhill | Falls left to right |
| Zero (m = 0) | Flat | Perfectly horizontal |
| Undefined | Vertical | Straight up and down |
In short, a positive slope climbs, a negative slope falls, a zero slope stays flat, and an undefined slope only exists on a straight vertical line.
From Slope to Equation: Two Common Forms
Once you know the slope, you can write a full equation for the line. Two formats are used most often.
Slope-Intercept Form (y = mx + b)
This is the most common form. It uses the slope (m) and the y-intercept (b), which is where the line crosses the y-axis.
Formula: b = y − (m × x)
Example: Using slope m = 2 and point (4, 8):
b = 8 − (2 × 4) = 8 − 8 = 0
The equation is y = 2x + 0, or simply y = 2x.
Point-Slope Form (y − y₁ = m(x − x₁))
This form is common in Algebra I and II courses. It uses the slope and any single point on the line, without solving for the intercept first.
Example: Using slope m = 2 and point (4, 8):
y − 8 = 2(x − 4)
You can expand this into slope-intercept form if needed. Both equations describe the exact same line.
Slope From an Equation (No Two Points Needed)
Sometimes you already have an equation instead of two coordinate points. You can still find slope without plotting anything.
If the equation is already in slope-intercept form (y = mx + b), the slope is simply the number in front of x. For the equation y = 3x + 5, the slope is 3 and the y-intercept is 5 — no calculation required.
If the equation is in standard form (Ax + By = C), rearrange it first. For example, take 2x + 4y = 8:
- Solve for y: 4y = −2x + 8
- Divide every term by 4: y = −0.5x + 2
- The slope is the coefficient of x: m = −0.5
This method works for any linear equation, and it’s useful whenever a textbook or worksheet gives you a formula instead of two raw coordinates.
Converting Slope to Other Formats
Raw slope numbers like “2” or “0.25” don’t mean much outside a math class. Real-world fields use percent grade, degrees, or ratios instead.
Slope as Percent Grade
Percent grade is the format used on road signs and hiking apps.
Formula: Percent Grade = (Rise / Run) × 100
A slope of 0.25 becomes a 25% grade. Road signs, trail maps, and civil engineering drawings all use this format.
Slope as an Angle in Degrees
Degrees describe the actual angle of a slope compared to flat ground.
Formula: Angle° = arctan(Rise / Run)
A slope with a 25% grade equals about 14 degrees. This is the format engineers use when specifying incline angles.
Slope as a Ratio (X:1 Format)
Ratio notation appears on wheelchair ramp specs, retaining walls, and earthworks drawings. Common examples include “3:1” or “1-in-12.”
Formula: Ratio (X:1) = Run / Rise
A slope of 1-in-12 is the maximum ratio commonly cited for wheelchair ramps under U.S. accessibility guidance. [VERIFY: confirm the exact current code section before using this figure for a real construction project — always check with a licensed professional or your local building authority.]
Quick Reference: Slope Format Comparison
| Slope (Decimal) | Percent Grade | Angle (Degrees) | Ratio |
|---|---|---|---|
| 0.083 | 8.3% | 4.8° | 1:12 |
| 0.17 | 17% | 9.6° | 1:6 |
| 0.25 | 25% | 14° | 1:4 |
| 0.5 | 50% | 26.6° | 1:2 |
| 1.0 | 100% | 45° | 1:1 |
In short, a 1-in-12 slope equals about 8.3 percent grade and roughly 4.8 degrees, while a 1-in-1 slope equals 100 percent grade and 45 degrees.
Rise Over Run: The Physical Way to Think About Slope
Before formulas, most students learn slope as “rise over run.” This is the most visual way to understand steepness.
Rise is how far a line moves up or down. Run is how far it moves left or right.
Picture a staircase. Each step has a height (rise) and a depth (run). The steepness of the whole staircase is rise divided by run, exactly like slope.
Steepness Categories by Rise-Over-Run
| Slope Range | Description |
|---|---|
| Under 10% | Gentle |
| 10–20% | Moderate |
| 20–40% | Steep |
| Over 40% | Very steep |
In short, most everyday inclines — driveways, sidewalks, and gentle trails — fall under 10 percent, while anything past 40 percent is considered genuinely steep terrain.
Finding Slope With Multiple Points (Line of Best Fit)
The two-point slope formula only works for a single, perfectly straight line. Real data sets often have more than two points that don’t line up exactly.
When that happens, you need a line of best fit, also called a linear regression line. This is a single straight line drawn through a scattered set of points so that it sits as close as possible to all of them at once.
The math behind it — called the least-squares method — calculates a slope and intercept that minimize the total distance between the line and every data point. You don’t need to memorize the formula to use the concept.
Practical angle, not homework math: if you have a spreadsheet of measurements — say, hours studied versus test scores, or distance versus elevation gain on a trail — a line of best fit slope tells you the average rate of change across the whole data set, not just between two isolated points.
For example, if five data points roughly trend upward but aren’t perfectly aligned, a regression slope of 1.8 means the line rises about 1.8 units for every 1 unit it moves right, on average, across all five points combined. This differs from simple two-point slope because it accounts for every point’s position, not just two.
Spreadsheet tools like Excel and Google Sheets calculate this automatically with a built-in SLOPE() function or a trendline feature — more on that below.
Real-World Applications of Slope
Slope isn’t just a classroom concept. It shows up constantly in construction, transportation, and land planning.
Roof Pitch
Roofers express slope as “rise per 12 inches of run,” written as a fraction like 6/12. A steeper pitch sheds water and snow faster.
Asphalt shingles typically need a minimum pitch of about 2/12, though exact minimums vary by shingle manufacturer and local code. [VERIFY: confirm the specific shingle manufacturer’s minimum-pitch specification before relying on this figure.] Flat or low-slope roofs need membrane roofing instead. Use our roof pitch calculator to check your roof’s exact pitch, angle, and material suitability.
Driveway and Land Grading
Most residential driveways should stay under a 15–20% grade. Anything steeper can cause traction problems in rain or snow.
Yards and drainage swales need a small positive slope, usually 1–2%, so water flows away from the house instead of pooling. The same math applies to drainage pipe and sewer-line fall requirements, where installers calculate a minimum slope per foot to keep water moving.
Wheelchair Ramps
Ramps built to meet the accessibility requirements of the Americans with Disabilities Act (ADA) commonly follow a maximum slope of 1:12, which equals about 8.33%. This helps ensure ramps are safe and usable for wheelchair users. [VERIFY: confirm current ADA Standards for Accessible Design section and any landing-length requirements before finalizing a real ramp build.] Use our ramp calculator to check ramp length and rise against this code requirement.
Parallel and Perpendicular Lines
Two lines are parallel when they share the same slope. Two lines are perpendicular when their slopes are negative reciprocals of each other.
- Parallel: m₂ = m₁
- Perpendicular: m₂ = −1 / m₁
For example, if Line A has a slope of 2, a line perpendicular to it has a slope of −1/2.
How Surveyors and Engineers Measure Slope in the Field
Classroom slope problems start with two neat coordinate points. Field measurements work differently.
Surveyors typically describe slope in one of three ways: percent slope (vertical rise divided by horizontal distance, times 100), slope distance (the actual measured length along the sloped ground itself, not the flat map distance), and horizontal distance (the flat, map-view distance between two points, which is always shorter than or equal to the slope distance on any incline).
This distinction matters because a tape measure run directly along a hillside records slope distance, not horizontal distance. Engineers correct for this using trigonometry before the number goes into a grading plan, ADA ramp design, or road profile.
Land surveyors also work with elevation-based or GPS slope, which is common in hiking apps and road-grade tools. Instead of x and y coordinates on a flat graph, these tools use elevation gain (vertical) divided by trail distance (horizontal) to produce the same rise-over-run result — just measured with a GPS receiver instead of a coordinate plane.
Slope in Excel, Desmos, and Graphing Calculators
You don’t always need a dedicated slope calculator. Several everyday tools can find slope too, though each works a little differently.
Excel and Google Sheets include a built-in SLOPE() function. Enter your y-values and x-values as two ranges, and the formula returns a single slope number — this is especially useful for the multi-point regression slope discussed above, since spreadsheets handle least-squares math automatically.
Desmos lets you plot two points directly and see the connecting line drawn instantly, along with its equation. It’s a strong visual option when you want to experiment with different points side by side.
Graphing calculators, like a TI-84, require entering the two-point slope formula manually or using a built-in linear regression menu for multi-point data.
The advantage of a dedicated slope calculator like this one is speed: no formula entry, no menu navigation, and an instant conversion to percent grade, degrees, and ratio format in the same result. If you want to plot a full equation or compare multiple lines visually, our graphing calculator is the better next step.
Slope Calculator vs. Golf Slope Rating: Not the Same Thing
If you searched for “slope calculator” and expected golf scoring information, this is not that tool.
A golf course’s Slope Rating is a completely different statistic. It’s a number between 55 and 155, published by the USGA, that measures how much harder a course plays for a bogey golfer compared to a scratch golfer — it has nothing to do with rise-over-run line steepness.
The two concepts share a word by coincidence, not by mathematical connection. If you’re looking for golf handicap math instead of line-steepness math, our golf handicap calculator is the correct tool. The same naming overlap also exists in unrelated technical fields — molecular biology uses “slope” to describe a qPCR standard-curve measurement, and chromatography uses “gradient” for a solvent-mixing ratio. Neither is covered on this page.
Common Mistakes When Calculating Slope
- Mixing up rise and run. Always put the y-values (rise) on top and the x-values (run) on the bottom.
- Subtracting points in the wrong order. Keep the same order for both x and y. If you start with y₂ − y₁, you must also use x₂ − x₁, not x₁ − x₂.
- Confusing percent grade with degrees. A 100% grade is a 45-degree angle, not a 90-degree angle. These two units are not interchangeable without conversion. If you’re mixing up percent grade with a percentage change or difference calculation instead, the percentage difference calculator handles that separate type of math.
- Forgetting undefined slope. A perfectly vertical line has no slope value at all. Don’t force a number where one doesn’t exist.
- Ignoring code limits. A mathematically correct slope can still fail a building code. Always check driveway, ramp, and roofing limits separately with a licensed professional.
Pro Tips for Working With Slope
- Use a graph whenever possible. Seeing the line makes direction and steepness obvious.
- Keep units consistent. Don’t mix feet and meters within the same calculation.
- Simplify fractions for cleaner answers. A slope of 4/2 should be reduced to 2 for clarity.
- Double-check vertical and horizontal cases separately. These are the two most common sources of calculation errors.
- For data sets larger than two points, use a line of best fit instead of picking two points at random — random point selection can distort the true trend.
Limitations of This Calculator
This calculator handles straight lines only. It does not calculate the slope of curves, which requires calculus.
For curves, the “slope” changes at every point and requires a derivative rather than a simple rise-over-run formula. That advanced calculus topic — sometimes called a slope field — is outside the scope of this page and this calculator.
Building and safety codes vary by region. This tool provides general math, not official code approval. Always confirm construction slopes with a licensed engineer or your local building department for roofing, driveway, ADA-ramp, or drainage projects.
Frequently Asked Questions
How do you find the slope of a line?
Pick any two points on the line and label them (x₁, y₁) and (x₂, y₂). Subtract the y-values, subtract the x-values, then divide the first result by the second.
What is the slope formula?
The slope formula is m = (y₂ − y₁) / (x₂ − x₁). This calculates rise divided by run between any two points on a straight line.
How do you convert slope to degrees?
Divide the rise by the run to get a decimal slope, then take the arctangent of that number. The formula is Angle° = arctan(Rise / Run).
How do you calculate roof slope?
Measure how many inches a roof rises for every 12 inches of horizontal run. This is written as a fraction like 6/12, and it can be converted to degrees using the arctangent formula.
What is a good slope for a driveway?
Most residential driveways stay between 0% and 15–20% grade. Steeper slopes usually require engineering review and better traction surfaces.
What is the slope of a horizontal line?
A horizontal line always has a slope of 0. It has zero rise because the y-value never changes between points.
What is the slope of a vertical line?
A vertical line has an undefined slope. Its run equals zero, and dividing by zero is not possible.
How do you find a line perpendicular to another line?
Take the negative reciprocal of the original slope. If the original slope is m, the perpendicular slope is −1/m.
Can slope be a negative number?
Yes. A negative slope means the line falls as it moves from left to right on the graph.
What’s the difference between slope and gradient?
The terms are used interchangeably in practice. “Gradient” is more common in UK, civil engineering, and physics contexts, while “slope” is the standard US math term.
How do you find slope from an equation instead of two points?
If the equation is in slope-intercept form (y = mx + b), the slope is the number multiplied by x. If it’s in standard form (Ax + By = C), rearrange it into y = mx + b first, then read the slope directly.
What is the maximum slope for a wheelchair ramp?
A slope of 1:12, or about 8.33%, is the maximum commonly cited under U.S. accessibility guidance. Confirm the exact current requirement with a licensed professional before building.
How steep can a driveway be?
Most residential driveways stay under 15–20% grade. Anything steeper often needs engineering review and a higher-traction surface.
Is slope the same thing as golf Slope Rating?
No. Golf Slope Rating is a USGA statistic measuring course difficulty for different skill levels. It has no mathematical connection to line steepness.
Can I use this calculator for a curved line?
No. This calculator finds the slope of straight lines only. Curved lines require calculus and a derivative at each point, which is beyond this tool’s scope.
What’s the difference between rise-over-run and percent grade?
They describe the same underlying steepness, just in different formats. Percent grade simply multiplies the rise-over-run decimal by 100.
How do I find slope in Excel?
Use the built-in SLOPE() function, entering your y-value range first and your x-value range second. It works for both two points and larger data sets.
What does an undefined slope mean in real life?
It describes a perfectly vertical surface or line, like a cliff face or a wall, where there is no horizontal change at all.
How many points do I need for a line of best fit?
At least three points are needed for a meaningful line of best fit, though the method works with any number of points above two.
Does slope have units?
Slope itself is usually unitless when both axes use the same measurement (like feet and feet). It becomes unit-specific only when comparing different measurement types, such as elevation in meters over distance in miles.
Key Takeaways
Slope measures steepness as rise divided by run. The core formula, m = (y₂ − y₁) / (x₂ − x₁), works for any two points on a straight line.
Slope converts easily into percent grade, degrees, or ratio format depending on your field. Roofers, road engineers, and ramp designers each use a different version of the same underlying number. For data sets with more than two points, a line of best fit calculates an average slope instead.
Always double-check construction-related slope calculations against local building codes. This calculator delivers accurate math, but code compliance requires a licensed professional for projects involving roofing, driveways, ramps, or drainage.
Use the slope calculator above to find slope instantly from any two points, then convert your result into the format you need for school, work, or your next building project.
