How to Find Slope: From Two Points, a Graph, a Table or an Equation

Learn how to find the slope of a line step by step using the slope formula, graphs, tables and equations, plus y-intercepts, perpendicular slopes, percent grade and Excel.
Table of Contents 15 sections
- What is slope?
- How to find slope with two points
- How to find slope on a graph
- How to find slope from a table
- How to find slope from an equation
- How to find the y-intercept and write the equation
- How to find parallel and perpendicular slopes
- How to find slope as a percentage or angle
- How to find the slope of a curve (tangent line)
- How to find slope in Excel and Google Sheets
- Slope as a rate of change
- Common mistakes
- Practice problems
- How to use this guide
- Frequently asked questions
Slope is one of the first ideas in algebra and one of the most useful. It tells you how steep a line is and in which direction it goes, and it describes any constant rate of change, from speed to price per item. This guide explains how to find slope in every common situation: from two points, from a graph, from a table, from an equation, and for parallel and perpendicular lines. Each method has a worked example, and there are practice problems at the end.
What is slope?
Slope is the ratio of vertical change to horizontal change between any two points on a line. The vertical change is called the rise and the horizontal change is the run. In math, slope is written with the letter m.
A slope of 3 means the line goes up 3 units for every 1 unit to the right. A slope of -1/2 means the line goes down 1 unit for every 2 units to the right. Because a straight line has the same steepness everywhere, any two points on it give the same slope.
How to find slope with two points
This is the most common method and the one behind the search "how to find slope of a line". Use the slope formula:
For related numbers, try the Ratio Calculator, Volume Calculator and Percentage Calculator.
- Label the points. Call one (x₁, y₁) and the other (x₂, y₂).
- Subtract the y-values to get the rise: y₂ - y₁.
- Subtract the x-values in the same order to get the run: x₂ - x₁.
- Divide the rise by the run and simplify.
Worked example: find the slope through (1, 4) and (5, 12). Rise = 12 - 4 = 8. Run = 5 - 1 = 4. m = 8 / 4 = 2.
Worked example with negatives: find the slope through (-3, 5) and (2, -5). Rise = -5 - 5 = -10. Run = 2 - (-3) = 5. m = -10 / 5 = -2. The line falls from left to right.
Worked example with a fraction: (0, 1) and (6, 5). Rise = 4, run = 6, so m = 4/6 = 2/3. Leave the slope as a simplified fraction unless asked for a decimal.
How to find slope on a graph
- Pick two points where the line crosses grid intersections exactly, so the coordinates are whole numbers.
- Starting at the left point, count how many units you go up (positive) or down (negative) to reach the height of the right point. That is the rise.
- Count how many units you go right to reach the second point. That is the run.
- Divide rise by run.
Example: a line passes through (0, -2) and (3, 4) on a grid. From (0, -2), go up 6 squares and right 3 squares. m = 6 / 3 = 2.
A quick visual check: if the line goes uphill from left to right, the slope must be positive. If it goes downhill, the slope must be negative. A flat line has slope 0 and a vertical line has an undefined slope.
Slope and the Pythagorean theorem go together: rise and run are the legs of a right triangle. See how to use the Pythagorean theorem or try the Pythagorean Theorem Calculator.
How to find slope from a table
Choose any two rows and apply the slope formula to the x and y values. For a linear table, every pair gives the same answer.
| x | y |
|---|---|
| 0 | 7 |
| 2 | 13 |
| 4 | 19 |
| 6 | 25 |
Using the first two rows: m = (13 - 7) / (2 - 0) = 6 / 2 = 3. Check with rows three and four: (25 - 19) / (6 - 4) = 3. Because the x-values go up by 2 each time and the y-values go up by 6, the slope is 6 / 2 = 3. If the differences are not constant, the relationship is not linear and has no single slope.
How to find slope from an equation
Slope-intercept form: y = mx + b
The slope is the number in front of x. In y = -4x + 7, the slope is -4 and the y-intercept is 7. In y = x/3 - 2, the slope is 1/3.
Standard form: Ax + By = C
Either use the shortcut m = -A / B or solve for y. For 3x + 2y = 8: m = -3 / 2. Solving gives 2y = -3x + 8, so y = -1.5x + 4. The slope is -1.5.
Point-slope form: y - y₁ = m(x - x₁)
The slope is the number multiplying the bracket. In y - 5 = 2(x + 1), the slope is 2 and the line passes through (-1, 5).
Special cases
An equation like y = 6 has slope 0 (horizontal). An equation like x = -2 has an undefined slope (vertical).
How to find the y-intercept and write the equation
Once you know the slope, finding the full equation of the line takes one more step. This answers "how to find slope intercept form" and "how to find y intercept with slope".
- Find m from two points.
- Substitute m and one point into y = mx + b.
- Solve for b.
Worked example: points (1, 4) and (5, 12). We found m = 2. Substitute (1, 4): 4 = 2(1) + b, so b = 2. The equation is y = 2x + 2. Check with (5, 12): 2(5) + 2 = 12. Correct.
Point-slope route: write y - 4 = 2(x - 1), then expand: y = 2x - 2 + 4 = 2x + 2.
How to find parallel and perpendicular slopes
Parallel lines never meet, so they have the same slope. Any line parallel to y = 3x - 1 has slope 3.
Perpendicular lines meet at a right angle. Their slopes are negative reciprocals: flip the fraction and change the sign. The perpendicular slope to 3 is -1/3. The perpendicular slope to -2/5 is 5/2. Multiplying the two slopes always gives -1.
Worked example: find the line perpendicular to y = 2x + 1 through (4, 3). The perpendicular slope is -1/2. Then 3 = -1/2(4) + b, so b = 5 and the line is y = -0.5x + 5.
How to find slope as a percentage or angle
Outside the classroom, slope is often written as a percent grade or an angle.
- Percent grade = slope x 100. A ramp rising 2 feet over 24 feet has slope 2/24 = 0.0833, an 8.33 percent grade.
- Angle = arctan(slope). A slope of 0.0833 is about 4.76 degrees. A slope of 1 is 45 degrees.
- Roof pitch = rise per 12 inches of run. A slope of 0.5 is a 6:12 pitch.
How to find the slope of a curve (tangent line)
A curve does not have one slope; its steepness changes from point to point. The slope at a single point is the slope of the tangent line, found with calculus. For y = x², the derivative is 2x, so at x = 3 the slope of the tangent is 6. Without calculus, you can approximate it with a secant line: pick two points very close together, such as x = 3 and x = 3.01, and apply the slope formula. (9.0601 - 9) / 0.01 = 6.01, very close to 6.
How to find slope in Excel and Google Sheets
Put your x-values in column A and y-values in column B. Then =SLOPE(B2:B10, A2:A10) returns the slope of the best-fit line and =INTERCEPT(B2:B10, A2:A10) returns the y-intercept. For exactly two points, =(B3-B2)/(A3-A2) works too. In a chart, add a linear trendline and tick "Display equation on chart" to see y = mx + b. The SLOPE function takes the y-range first, which trips up many people.
Slope as a rate of change
In word problems, slope is the rate at which one quantity changes with another, and its units are "y-units per x-unit". If a taxi charges $3 plus $2.50 per mile, cost = 2.5 x miles + 3, and the slope is $2.50 per mile. If a car travels 180 miles in 3 hours at a steady speed, the slope of its distance-time graph is 60 miles per hour. Reading the units out loud is a reliable way to interpret any slope.
Common mistakes
- Putting run over rise (x on top) instead of rise over run.
- Subtracting the coordinates in a different order on the top and bottom.
- Dropping a negative sign when subtracting a negative number: 2 - (-3) = 5, not -1.
- Calling a vertical line's slope zero. Horizontal is zero; vertical is undefined.
- Reading the slope from y = mx + b without first solving for y.
Practice problems
- (2, 1) and (6, 9). Answer: 8 / 4 = 2.
- (-1, 7) and (3, -1). Answer: -8 / 4 = -2.
- (0, 0) and (5, 3). Answer: 3/5.
- Slope of 4x - 2y = 10. Answer: y = 2x - 5, so m = 2.
- Perpendicular slope to m = 3/7. Answer: -7/3.
- (4, 2) and (4, 9). Answer: undefined (vertical line).
Check your answers with the slope calculator, which also gives the equation of the line, the angle and the percent grade.
How to use this guide
Work through the steps in order with your own numbers, writing each result down as you go, then check your answer against the matching calculator on this site. If your hand calculation and the calculator disagree, the usual culprits are unit conversions, rounding, and a percentage typed as a whole number instead of a decimal. The examples are illustrations, not recommendations, and your situation may call for different assumptions. For important financial or health decisions, confirm your plan with a licensed professional who knows your circumstances. This article is reviewed periodically and was last updated in November 2026.
Frequently asked questions
How do you find the slope of a line?
Pick two points on the line and divide the change in y by the change in x: m = (y2 - y1) / (x2 - x1).
How do you find slope with two points?
Subtract the y-coordinates, subtract the x-coordinates in the same order, and divide. For (3, 2) and (7, 10), m = 8 / 4 = 2.
How do you find slope on a graph?
Choose two points on grid intersections, count the rise (up is positive, down is negative) and the run to the right, then divide rise by run.
How do you find the slope from an equation?
Rewrite the equation as y = mx + b. The number in front of x is the slope. For Ax + By = C, the slope is -A / B.
How do you find the y-intercept from the slope and a point?
Substitute the slope and the point into y = mx + b and solve for b.
What is the slope of a horizontal line?
Zero. A vertical line has an undefined slope.
Ramp and roof figures are general guides. Building codes, accessibility rules and manufacturer requirements vary by location and product, so confirm requirements with your local code official or a licensed professional.

About the author
Sawera Shahid is the founder and lead writer of Calculators360. She builds the site's free online calculators and writes clear, step-by-step guides on finance, math and health, with every formula explained and worked examples you can check by hand.



