Slope is a number that measures how steep a line is: the change in y divided by the change in x between any two points on the line, often called rise over run. A positive slope rises from left to right, a negative slope falls, and a horizontal line has slope 0.
From A to B the line goes right 4 (the run) and up 3 (the rise), so its slope is 34. Any two points on this line give the same slope. The small graphs show the four kinds of slope.
Formal definition and notation
For two points (x1, y1) and (x2, y2) on a non-vertical line, with x1 ≠ x2, the slope is m = y2 − y1x2 − x1. Because the line is straight, every pair of points on it gives the same value of m: the slope triangles they make are similar. A vertical line has x1 = x2, so its slope is undefined.
Where the name comes from. Nobody knows for sure why slope is written m. The earliest known printed use is in a book by O’Brien from 1844, and the popular story that it comes from the French word monter (to climb) has no evidence behind it.
Slope formula
Slope formula
m = y2 − y1x2 − x1 = riserun
m
the slope of the line
(x1, y1), (x2, y2)
any two different points on the line
y2 − y1
the rise: how far up (positive) or down (negative) you move
x2 − x1
the run: how far right you move (it cannot be 0)
Subtract in the same order on the top and the bottom. The formula does not work when x2 = x1, because that is a vertical line.
Try it: drag the points
Interactive
Drag point A or B, or select a point and use the arrow keys. The rise, run, slope and equation of the line update as you move. Try the presets for special cases.
This interactive needs JavaScript. The worked examples below show the same ideas step by step.
Slope examples, step by step
Example 1: Slope from two points
Warm-up
Find the slope of the line through (2, 3) and (6, 11).
Label the points: (x1, y1) = (2, 3) and (x2, y2) = (6, 11).
Find the rise: y2 − y1 = 11 − 3 = 8.
Find the run: x2 − x1 = 6 − 2 = 4.
Divide rise by run: m = 84 = 2.
Answer: The slope is 2: the line goes up 2 units for every 1 unit it moves to the right.
Example 2: A negative, fractional slope
Core
Find the slope of the line through (−3, 4) and (5, −2).
Rise: y2 − y1 = −2 − 4 = −6.
Run: x2 − x1 = 5 − (−3) = 8. Subtracting a negative means adding.
Check the sign: as x goes from −3 to 5, y goes down from 4 to −2, so a negative slope makes sense.
Answer:m = −34, or −0.75: the line falls 3 units for every 4 units to the right.
Example 3: Slope as a rate in a word problem
Test-style
A plumber charges a fixed fee plus an hourly rate. A 2-hour job costs 150 dollars and a 5-hour job costs 315 dollars. The cost is a linear function of time. What is the slope, and what does it mean?
Write each job as a point (hours, cost): (2, 150) and (5, 315).
Rise (change in cost): 315 − 150 = 165 dollars.
Run (change in time): 5 − 2 = 3 hours.
Slope: m = 1653 = 55 dollars per hour.
Interpret it: every extra hour adds 55 dollars, so the slope is the hourly rate. The fixed fee is the y-intercept: 150 − 2 × 55 = 40 dollars.
Answer: The slope is 55 dollars per hour, the plumber’s hourly rate (and the fixed fee is 40 dollars).
Common mistakes
✗ MistakeRun over rise: x2 − x1y2 − y1.
✓ InsteadRise over run: y2 − y1x2 − x1. The change in y goes on top.
Slope tells how much y changes for each 1-unit step in x, so the change in y is divided by the change in x, not x over y. Memory trick: you rise out of bed before you run.
✗ MistakeMixing the order: for (2, 3) and (6, 11), 11 − 32 − 6 = −2.
✓ InsteadSame order on top and bottom: 11 − 36 − 2 = 2.
If you start the top with the second point’s y, start the bottom with the second point’s x. Mixing the order flips the sign.
✗ MistakeA vertical line has slope 0.
✓ InsteadA horizontal line has slope 0. A vertical line has an undefined slope.
On a vertical line the run is 0, and you cannot divide by 0. On a horizontal line the rise is 0, and 0 divided by any run is 0.
Slope is how steep the line is: the m in y = mx + b. The y-intercept is where the line crosses the y-axis: the b. In y = 2x + 5, the slope is 2 and the y-intercept is 5.
Slope is one number. Slope-intercept form, y = mx + b, is a way to write the equation of a whole line so that its slope and y-intercept are easy to read.
Slope is a ratio, not an angle. A slope of 1 makes a 45° angle with the x-axis, but doubling the slope to 2 gives about 63°, not 90°.
Quick check: 3 questions
Question 1 of 3
What is the slope of the line through (1, 2) and (4, 8)?
Show answer and explanation
Answer: A. Rise = 8 − 2 = 6 and run = 4 − 1 = 3, so m = 63 = 2. Choice B is run over rise; C and D are the rise and the run on their own.
Question 2 of 3
Which line has an undefined slope?
Show answer and explanation
Answer: B.x = 3 is a vertical line: every point has the same x, so the run is 0 and you cannot divide by 0. y = 3 is horizontal, so its slope is 0.
Question 3 of 3
What is the slope of y = −4x + 7?
Show answer and explanation
Answer: B. In slope-intercept form y = mx + b, the slope m is the coefficient of x, so m = −4. The 7 is the y-intercept.
Slope: frequently asked questions
Can a slope be zero?
Yes. A slope of 0 means the rise is 0: the y-value never changes, so the line is horizontal, like y = 4. Do not mix this up with a vertical line such as x = 4. There the run is 0, and since you cannot divide by 0, the slope of a vertical line is undefined, not zero.
Does it matter which point I use first?
No, as long as you stay consistent. Using (2, 3) first gives 11 − 36 − 2 = 2. Using (6, 11) first gives 3 − 112 − 6 = −8−4 = 2. Both orders give the same slope. The only rule is to subtract in the same order in the numerator and the denominator.
What does slope mean in a word problem?
Slope is a rate of change: how much the output changes for each 1-unit increase in the input. Its units are output units per input unit, such as dollars per hour, miles per gallon or degrees per minute. On a graph of cost against hours worked, for example, the slope is the hourly rate.
TriangleA triangle is a polygon with three sides and three angles. Its three corners are called vertices, and the angle measures in any triangle add to 180 degrees. Triangles are classified by their sides (equilateral, isosceles, scalene) and by their angles (acute, right, obtuse).Geometry · Grade 3, Grade 4, Grade 5UndefinedUndefined describes an expression that has no value, most often because it divides by zero. 70 is undefined, since no number times 0 gives 7. A vertical line has an undefined slope, and 3x − 2 is undefined at x = 2. Undefined does not mean zero: 07 = 0, but 70 has no value.Problem Solving · Grade 6, Grade 8, Algebra 1Slope-Intercept FormSlope-intercept form is the linear equation form y = mx + b, where m is the slope and b is the y-intercept. You can read both values directly from the equation without rearranging: in y = 2x + 5, the slope is 2 and the line crosses the y-axis at (0, 5).Algebra · Grade 8, Algebra 1Y-InterceptThe y-intercept is the point where a graph crosses the y-axis. Every point on the y-axis has x = 0, so you find the y-intercept by putting x = 0 into the equation. In y = mx + b, the y-intercept is b, written as the point (0, b).Algebra · Grade 8, Algebra 1Absolute ValueThe absolute value of a number is its distance from zero on the number line, so it is never negative. It is written with two vertical bars: |−6| = 6 and |6| = 6. A positive number and 0 keep their value; a negative number loses its minus sign.Number System · Grade 6, Grade 7, Grade 8Parallel LinesParallel lines are lines in the same plane that never intersect. They stay the same distance apart and point in the same direction, like the rails of a straight railroad track. On a coordinate plane, parallel lines have the same slope but different y-intercepts. The symbol ∥ means is parallel to.Geometry · Grade 4, Grade 5, Grade 6Perpendicular LinesPerpendicular lines are lines that intersect to form right angles: their intersection makes a 90-degree angle. The symbol ⊥ means is perpendicular to. On a coordinate plane, two perpendicular lines that are not vertical have slopes that multiply to −1, such as 2 and −12.Geometry · Grade 4, Grade 5, Grade 6Unit RateA unit rate is a rate that compares a quantity to one unit of another quantity, such as 50 miles per hour or 4 dollars per notebook. To find it, divide the first quantity by the second: 150 miles in 3 hours is 150 ÷ 3 = 50 miles per hour. The word per means for each one.Ratios and Proportions · Grade 6, Grade 7, Grade 8Rate of ChangeA rate of change tells how much an output changes for each 1-unit change in the input: the change in y divided by the change in x. If a phone plan costs 15 dollars more for every extra hour, its rate of change is 15 dollars per hour. For a straight line, the rate of change equals the slope.Functions · Grade 8, Algebra 1, Algebra 2MileA mile (mi) is a US customary unit of length for long distances, equal to 5,280 feet or 1,760 yards. One mile is about 1.61 kilometers, so it is longer than a kilometer. Road distances and speed limits in the United States use miles and miles per hour.Measurement · Grade 4, Grade 5, Grade 6MeterA meter (m) is a metric unit of length equal to 100 centimeters. It is the base unit of length in the metric system, a little over three feet (about 3.28 feet). A doorway is about 2 meters tall, and 1,000 meters make a kilometer. To change meters to centimeters, multiply by 100.Measurement · Grade 3, Grade 4, Grade 5SimplifySimplify means to rewrite a number or expression in a shorter, easier form without changing its value. To simplify a fraction, divide the numerator and denominator by a common factor until none is left: 1824 = 34. To simplify an expression, combine like terms and do the operations you can: 3x + 2x = 5x.Number System · Grade 4, Grade 5, Grade 6Linear FunctionA linear function is a function whose graph is a straight line. You can write it as f(x) = mx + b, where m is the slope, or constant rate of change, and b is the y-intercept. Each time x increases by 1, the output changes by the same amount, m.Functions · Grade 8, Algebra 1Y-AxisThe y-axis is the up-and-down number line on the coordinate plane, with positive numbers above the origin and negative numbers below it. It meets the x-axis at the origin, (0, 0). A point’s y-coordinate is read along the y-axis, and every point on the y-axis has x-coordinate 0, like (0, 4).Geometry · Grade 5, Grade 6, Grade 7NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2AngleAn angle is formed by two rays that share the same endpoint, called the vertex. It is measured in degrees by how far one ray is turned from the other. A right angle measures 90 degrees, a straight angle measures 180 degrees, and one full turn is 360 degrees.Geometry · Grade 4, Grade 5, Grade 6RatioA ratio compares two quantities by division. Ratios can be written with words, a colon, or a fraction: 3 boys to 5 girls is 3 to 5, 3 : 5, or 35. Order matters, and a ratio can compare part to part or part to whole. Multiplying both numbers by the same amount gives an equivalent ratio.Ratios and Proportions · Grade 6, Grade 7, Grade 8X-AxisThe x-axis is the horizontal number line on the coordinate plane. It crosses the vertical y-axis at the origin, (0, 0). The x-coordinate of a point tells how far to move along the x-axis, and every point on the x-axis has a y-coordinate of 0, such as (5, 0).Geometry · Grade 5, Grade 6, Grade 7Coordinate PlaneThe coordinate plane is a flat grid formed by a horizontal x-axis and a vertical y-axis crossing at the origin, (0, 0). Every point is located by an ordered pair, x first then y, such as (3, −2). The two axes divide the plane into four quadrants, numbered I to IV counterclockwise from the upper right.Geometry · Grade 5, Grade 6, Grade 7Ordered PairAn ordered pair is two numbers written to locate a point on the coordinate plane. It is written as (x, y): the x-value comes first, and the y-value comes second. From the origin, move x units across, then y units up or down. The order matters: (2, 5) and (5, 2) are different points.Geometry · Grade 5, Grade 6, Grade 7Linear EquationA linear equation is an equation whose graph is a straight line. In one variable, it usually has a variable to the first power, like 3x + 2 = 14. In two variables, it can be written in forms like y = mx + b, where m is the slope. No variable is squared, multiplied by another variable or in a denominator.Algebra · Grade 7, Grade 8, Algebra 1FunctionA function is a rule that gives exactly one output for each input. If you put in one x-value, a function gives back one y-value. In f(x) = 2x + 1, the input 3 gives the output 7. Two inputs may share an output, but one input can never have two different outputs.Functions · Grade 8, Algebra 1, Algebra 2Point-Slope FormPoint-slope form is a way to write the equation of a line from its slope m and one point (x1, y1) on it: y − y1 = m(x − x1). It is the fastest form to use when you know a point and the slope, or two points. Multiplying it out gives slope-intercept form.Algebra · Grade 8, Algebra 1