Slope Formula: How to Find the Slope Between Two Points
Math Expert
Geometry
The slope formula tells you how steep a line is and whether it rises or falls as you move from left to right. Given any two points on a line, it turns their coordinates into a single number that describes the line’s direction and steepness. Students meet it in coordinate geometry and use it again in algebra, physics, and data graphs, because so many problems come down to measuring a rate of change. In GCSE maths the same idea is often called the gradient of a line. This guide explains the formula in plain language, works through every slope type you will meet, and shows how to read slope from points, graphs, and equations.
What Is the Slope Formula?
Slope measures the rate at which one quantity changes against another along a straight line. On a coordinate plane, that means comparing how far a line moves vertically with how far it moves horizontally between two points. A line that climbs steeply has a large slope. A line that climbs gently has a small slope. A flat line has a slope of zero, and a vertical line has no defined slope at all.
The slope formula calculates that number from the coordinates of two points:
m = (y₂ - y₁) / (x₂ - x₁)
Here is what each symbol means:
- m is the slope of the line, also called its gradient.
- (x₁, y₁) is the first point on the line.
- (x₂, y₂) is the second point on the line.
- y₂ - y₁ is the vertical change between the points, called the rise.
- x₂ - x₁ is the horizontal change between the points, called the run.
That is why slope is described as “rise over run”. The formula divides the vertical change by the horizontal change, and the result is a single number that captures both direction and steepness. One condition matters: the denominator must not equal zero. When x₂ - x₁ = 0, the two points share the same x-coordinate, the line is vertical, and division by zero is undefined, so the slope is undefined rather than zero.
Featured snippet answer: The slope formula is m = (y₂ - y₁) / (x₂ - x₁). It finds the slope, or gradient, of the line through two points (x₁, y₁) and (x₂, y₂) by dividing the vertical change (rise) by the horizontal change (run).
Slope has no unit of its own on a plain coordinate plane, but in applied problems its unit comes from the axes. On a distance-time graph, slope is measured in kilometres per hour. On a ramp diagram, slope is a pure ratio of height to length. Keeping the axes in mind turns an abstract number into a meaningful rate.
How to Find Slope Between Two Points
Follow these six steps in order and the method never changes, whatever the numbers look like:
- Identify the coordinates of both points. Label the first point (x₁, y₁) and the second point (x₂, y₂).
- Write the slope formula: m = (y₂ - y₁) / (x₂ - x₁).
- Substitute the coordinates correctly, keeping the same point order in the numerator and the denominator.
- Subtract the y-coordinates to find the rise.
- Subtract the x-coordinates to find the run.
- Divide and simplify the result.
Here is the slope formula between two points in action. Find the slope of the line through A(1, 2) and B(4, 8).
First, label the points: x₁ = 1, y₁ = 2, x₂ = 4, y₂ = 8. Next, write the formula and substitute: m = (8 - 2) / (4 - 1). Then subtract: the rise is 8 - 2 = 6 and the run is 4 - 1 = 3. Finally, divide and simplify: m = 6 / 3 = 2. The slope is 2, which means the line rises 2 units vertically for every 1 unit it moves horizontally to the right.
Coordinate order deserves emphasis, because it is where most errors start. The numerator and denominator must use the points in the same order. If you subtract y₁ from y₂ on top, you must subtract x₁ from x₂ underneath. Swapping the order in only one of them flips the sign of the answer. Interestingly, swapping the order in both places at once gives the same slope, because both the numerator and the denominator change sign and the two changes cancel. What is never allowed is mixing the orders.
Understanding Rise Over Run
Rise and run are the geometric heart of slope. Imagine walking along a line from left to right. The rise is how far you climb or drop vertically. The run is how far you travel horizontally. Slope is simply rise divided by run, so it answers the question: for each step forward, how much do I go up or down?
Take the points A(2, 1) and B(5, 7). Moving from A to B, the vertical change is 7 - 1 = 6, so the rise is 6. The horizontal change is 5 - 2 = 3, so the run is 3. The slope is 6 / 3 = 2. On a graph you can see this as a right-angled triangle: start at A, move 3 units right along a horizontal dashed line, then move 6 units up along a vertical dashed line to reach B. That rise/run triangle is the slope made visible.
The size of the triangle does not matter, only the ratio. A rise of 6 over a run of 3 gives the same slope as a rise of 2 over a run of 1, because both simplify to 2. This is why any two points on the same straight line give the same slope: every rise/run triangle drawn on that line is a scaled copy of every other one. Steepness is a property of the line, not of the points chosen.
Types of Slopes in Coordinate Geometry
Every straight line falls into one of four slope types. Learning to recognise them at a glance makes graph questions much faster, because the sign and size of the slope tell you the line’s direction before any calculation.
Positive Slope
A line with a positive slope rises from left to right. As x increases, y increases too. For example, the line through A(0, 1) and B(3, 7) has slope m = (7 - 1) / (3 - 0) = 6 / 3 = 2. The positive result matches the picture: moving rightwards, the line climbs. Positive slopes appear in growth graphs, such as distance increasing with time at a steady speed.
Negative Slope
A line with a negative slope falls from left to right. As x increases, y decreases. For example, the line through A(1, 6) and B(4, 0) has slope m = (0 - 6) / (4 - 1) = -6 / 3 = -2. The negative sign is the whole message: the line drops 2 units for every 1 unit it moves right. Negative slopes appear in decline graphs, such as a cooling temperature or a draining tank.
Zero Slope
A horizontal line has a slope of zero. Both points share the same y-coordinate, so the rise is zero while the run is not. For example, the line through A(2, 5) and B(6, 5) has slope m = (5 - 5) / (6 - 2) = 0 / 4 = 0. Zero divided by any non-zero number is zero, so the slope is exactly 0. A zero slope means no vertical change at all: the line is perfectly flat.
Undefined Slope
A vertical line has an undefined slope. Both points share the same x-coordinate, so the run is zero and the formula asks for division by zero. For example, the line through A(3, 1) and B(3, 6) gives m = (6 - 1) / (3 - 3) = 5 / 0, which is undefined. This is not zero and not a large number; it is simply not a number at all, because division by zero has no meaning. Never describe an undefined slope as zero: zero slope is flat, undefined slope is vertical, and the two are opposites in character.
| Slope type | Line direction | Mathematical characteristic | Example |
|---|---|---|---|
| Positive | Rises left to right | m > 0 | A(0, 1), B(3, 7): m = 2 |
| Negative | Falls left to right | m < 0 | A(1, 6), B(4, 0): m = -2 |
| Zero | Horizontal | Rise = 0, m = 0 | A(2, 5), B(6, 5): m = 0 |
| Undefined | Vertical | Run = 0, division by zero | A(3, 1), B(3, 6): undefined |
Slope Formula Examples With Step-by-Step Solutions
Example 1: Positive Slope
Find the slope of the line through A(2, 3) and B(6, 11).
Write the formula: m = (y₂ - y₁) / (x₂ - x₁). Substitute: m = (11 - 3) / (6 - 2). Subtract: the rise is 8 and the run is 4. Divide and simplify: m = 8 / 4 = 2. The slope is 2, so the line rises 2 units for every 1 unit of horizontal movement. The positive sign confirms the line climbs from left to right.
Example 2: Negative Slope
Find the slope of the line through A(1, 8) and B(5, 2).
Substitute: m = (2 - 8) / (5 - 1). Subtract: the rise is -6 and the run is 4. Divide and simplify: m = -6 / 4 = -3 / 2. The slope is -3/2, so the line falls 3 units for every 2 units it moves right. The negative sign is essential: dropping it would describe a rising line, the opposite of the truth.
Example 3: Slope With Negative Coordinates
Find the slope of the line through A(-3, -2) and B(2, 3).
Substitute carefully, keeping the signs visible: m = (3 - (-2)) / (2 - (-3)). Subtracting a negative is the same as adding its positive value, so the rise is 3 + 2 = 5 and the run is 2 + 3 = 5. Divide: m = 5 / 5 = 1. The slope is 1, meaning the line rises 1 unit for every 1 unit right, a steady 45-degree climb. This example shows why brackets matter: writing 3 - -2 without brackets invites sign errors, while 3 - (-2) makes the double negative visible.
Example 4: Slope With Fractions
Find the slope of the line through A(1/2, 3/2) and B(5/2, 9/2).
Substitute: m = (9/2 - 3/2) / (5/2 - 1/2). With matching denominators, subtract the numerators: the rise is 6/2 = 3 and the run is 4/2 = 2. Divide: m = 3 / 2. The slope is 3/2, so the line rises 3 units for every 2 units right. If the denominators ever differ, convert to a common denominator before subtracting, or convert every coordinate to a decimal first. Both routes give the same slope, so use whichever you find more reliable.
Example 5: Horizontal and Vertical Lines
Find the slope of the horizontal line through A(-2, 4) and B(5, 4).
Substitute: m = (4 - 4) / (5 - (-2)) = 0 / 7 = 0. The slope is 0, as expected for a horizontal line: no vertical change, whatever the run.
Now find the slope of the vertical line through A(4, -1) and B(4, 6).
Substitute: m = (6 - (-1)) / (4 - 4) = 7 / 0, which is undefined. The slope is undefined, as expected for a vertical line: the run is zero, so no slope value exists. Keeping these two cases side by side is the best defence against the most common confusion in the topic: zero slope is flat, undefined slope is vertical, and they are never interchangeable.
How to Find Slope From a Graph
Sometimes no coordinates are given and the slope must be read from a graph. If you already know how to calculate slope from coordinates, the graph method is the same idea with counting instead of subtracting:
- Pick any two points on the line where it crosses grid intersections, so the coordinates are exact.
- Count the vertical movement between them: up is positive, down is negative.
- Count the horizontal movement between them, always moving right for a positive run.
- Divide rise by run and simplify.
- Check the sign against the picture: rising lines give positive slopes, falling lines give negative ones.
Worked example: a line passes through (1, 2) and (4, 5). Counting on the grid, the rise from the first point to the second is 3 units up and the run is 3 units right, so m = 3 / 3 = 1. Choosing a different pair of points on the same line, say (2, 3) and (5, 6), gives the same result: rise 3, run 3, slope 1. Any pair works, because slope is constant along a straight line. If two pairs give different slopes, the points are not on the same straight line, or a counting error has crept in.
How to Find Slope From an Equation
A linear equation in slope-intercept form wears its slope openly:
y = mx + b
Here m is the slope and b is the y-intercept, the point where the line crosses the y-axis. Reading slope from such an equation needs no calculation at all: the number multiplied by x is the slope. In y = 3x + 2, the slope is 3 and the line crosses the y-axis at 2.
Equations do not always arrive in this form. To find the slope of 2x + 4y = 8, rearrange it into slope-intercept form first. Subtract 2x from both sides: 4y = -2x + 8. Divide every term by 4: y = -1/2 x + 2. Now the slope is visible: m = -1/2, and the line crosses the y-axis at 2. This section stays introductory on purpose. Full linear equation work belongs to its own guide; here the point is simply that slope hides inside every straight-line equation, waiting to be read once the equation is in the right form.
Slope Formula vs Distance Formula vs Midpoint Formula
Students learning to find slope from two points often meet three coordinate geometry formulas together, because all three take the same input, two points, and answer three different questions. Confusing them is common, so keep the questions separate:
| Formula | Purpose | Mathematical formula | Type of answer |
|---|---|---|---|
| Slope formula | Measures rate of change | m = (y₂ - y₁) / (x₂ - x₁) | A number (the gradient) |
| Distance formula | Measures the distance between two points | d = √((x₂ - x₁)² + (y₂ - y₁)²) | A length |
| Midpoint formula | Finds the point halfway between two endpoints | M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2) | A point (ordered pair) |
Slope compares vertical change with horizontal change. Distance measures how far apart the points are. Midpoint finds the centre point between them. If a question asks “how steep”, reach for slope. If it asks “how far”, reach for distance. If it asks “where is the middle”, reach for midpoint. Our distance formula guide and midpoint formula guide cover the other two in the same teaching style, and together the three complete the basic coordinate geometry toolkit.
Common Mistakes When Using the Slope Formula
Reversing Coordinate Subtraction Inconsistently
Subtracting in one order on top and the other order underneath flips the sign. For A(1, 2) and B(4, 8), the mixed version (2 - 8) / (4 - 1) = -6 / 3 = -2 is wrong, while the consistent version (8 - 2) / (4 - 1) = 2 is right. Keep the point order identical in numerator and denominator.
Subtracting x-Values in the Numerator
The numerator holds y-values only. For A(1, 2) and B(4, 8), putting x-values on top gives (4 - 1) / (8 - 2) = 3 / 6 = 1/2, which is the reciprocal of the correct slope 2, not the slope itself. Remember the phrase “rise over run”: y-values over x-values, always.
Confusing Positive and Negative Slopes
A falling line must give a negative answer. If the graph falls left to right but the calculation returns a positive number, a subtraction order has been mixed up. Always check the sign against the picture before moving on.
Forgetting to Simplify Fractions
An unsimplified slope is not wrong in value, but it is marked wrong in many school answers and it hides the real rate. -6 / 4 must become -3 / 2, and 8 / 4 must become 2. Simplify every slope as the final step.
Treating an Undefined Slope as Zero
A vertical line has undefined slope, not zero slope. Zero slope means the line is flat and the rise is zero. Undefined slope means the run is zero and division is impossible. Writing 0 for a vertical line describes a horizontal line instead, which is a different line entirely.
Assuming a Steeper Line Always Has a Larger Signed Slope
Steepness follows the absolute value of the slope, not its signed value. A line with slope -4 is steeper than a line with slope 3, because |-4| = 4 is greater than |3| = 3, even though -4 is the smaller signed number. Compare steepness with absolute values and direction with signs, and the two ideas stop interfering with each other.
Real-Life Applications of the Slope Formula
Slope leaves the textbook quickly. A wheelchair ramp that rises 1.5 metres over a horizontal distance of 12 metres has a gradient of 1.5 / 12 = 1/8 = 0.125, and accessibility rules limit that ratio precisely because slope measures how hard the ramp is to climb. A road sign showing an 8% gradient means the road rises 8 metres for every 100 metres of horizontal distance, which is a slope of 0.08.
On graphs, slope is a constant rate of change. A distance-time graph with a straight section covering 60 kilometres in 2 hours has a slope of 60 / 2 = 30 kilometres per hour, which is the speed. A steeper section means faster travel, a flatter section means slower travel, and a flat section means the traveller has stopped. The same reading works for any straight-line graph: slope turns a picture into a rate, with units taken from the axes.
One caution: slope describes straight lines and straight sections. Most real relationships curve, and a single slope cannot summarise a curve. Where a graph bends, slope is measured section by section, or with methods beyond this guide. Claiming one slope for a curved relationship would misread the data.
Slope Formula Practice Questions
Try these six questions in order. They get harder as they go and cover every slope type. Work each one fully before looking at the answers.
- Find the slope of the line through A(1, 3) and B(5, 11).
- Find the slope of the line through A(2, 9) and B(6, 1).
- Find the slope of the line through A(-4, 2) and B(3, -5).
- Find the slope of the line through A(1/2, 1) and B(7/2, 4).
- Find the slope of the horizontal line through A(-3, 6) and B(4, 6).
- Find the slope of the vertical line through A(2, -3) and B(2, 5).
Answers
- m = (11 - 3) / (5 - 1) = 8 / 4 = 2.
- m = (1 - 9) / (6 - 2) = -8 / 4 = -2.
- m = (-5 - 2) / (3 - (-4)) = -7 / 7 = -1.
- m = (4 - 1) / (7/2 - 1/2) = 3 / 3 = 1.
- m = (6 - 6) / (4 - (-3)) = 0 / 7 = 0.
- m = (5 - (-3)) / (2 - 2) = 8 / 0, which is undefined.
If any answer disagrees with yours, check the sign against the line’s direction first, then check that the numerator holds y-values and the denominator holds x-values. Those two checks catch most errors without reworking the whole problem.
Frequently Asked Questions
Short answers to the questions students ask most about the slope formula.
01 What is the slope formula in maths?
The slope formula is m = (y₂ - y₁) / (x₂ - x₁). It finds the slope, or gradient, of the line through two points (x₁, y₁) and (x₂, y₂) by dividing the vertical change (rise) by the horizontal change (run).
02 How do you find the slope between two points?
Label the points (x₁, y₁) and (x₂, y₂). Subtract the y-coordinates for the rise and the x-coordinates for the run, keeping the same point order in both. Divide rise by run and simplify the result.
03 What does rise over run mean?
Rise is the vertical change between two points on a line and run is the horizontal change. Slope is rise divided by run, so it tells you how many units the line goes up or down for each unit it moves right.
04 What is the slope of a horizontal line?
Zero. On a horizontal line both points share the same y-coordinate, so the rise is zero. Zero divided by any non-zero run is zero, which matches the flat picture: the line never climbs and never falls.
05 Why is the slope of a vertical line undefined?
On a vertical line both points share the same x-coordinate, so the run is zero and the formula asks for division by zero. Division by zero has no defined value, so the slope is undefined, not zero and not infinite.
06 Can the slope formula give a negative answer?
Yes. A negative slope means the line falls from left to right: as x increases, y decreases. The negative sign carries the direction, so never drop it, or a falling line will be described as rising.
07 How do you find slope from a graph?
Pick two points where the line crosses grid intersections. Count the vertical movement (rise) and the horizontal movement (run) between them, then divide rise by run. Check the sign against the picture: rising lines give positive slopes.
08 What is the difference between slope and distance?
Slope measures rate of change, how steep a line is, and returns a single number that can be negative. Distance measures how far apart two points are and returns a non-negative length. They answer different questions from the same two points.
Conclusion
The slope of a line compares vertical change with horizontal change, and that one ratio carries both direction and steepness. Positive slopes rise, negative slopes fall, zero slope is flat, and undefined slope is vertical. The method stays the same whatever the numbers: label the points, subtract y-values over x-values in consistent order, divide, and simplify, then check the sign against the picture. Work through the six practice questions until the steps feel automatic, then read slope from graphs and equations with the same confidence, since all three routes describe the same line.