Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

How to Find the Slope of a Line From Two Points

Author: Uneeb Khan
by Uneeb Khan
Posted: Dec 02, 2026

To find the slope of a line from two points, subtract the y-values, subtract the x-values in the same order, and divide the first difference by the second. For the points (2, 3) and (6, 11), that's (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2. The line rises 2 units for every 1 unit it moves to the right.

That's the whole method. Most wrong answers come from three small slips: subtracting in a different order on the top and bottom, putting x on top, or losing a minus sign. This article walks through the formula, a few worked examples and those slips.

The slope formula

Slope measures how steep a line is and which way it tilts. It's usually written as m, and for two points (x₁, y₁) and (x₂, y₂) it is:

m = (y₂ − y₁) ÷ (x₂ − x₁)

The top of the fraction is the rise, the change in height. The bottom is the run, the change in horizontal position. So slope is "rise over run," the same definition used in standard algebra textbooks such as OpenStax College Algebra 2e.

It doesn't matter which point you call the first one. Swapping them flips the sign of both the rise and the run, and the two sign changes cancel. What matters is that you use the same order on the top and the bottom.

A worked example with positive slope

Take the points (2, 3) and (6, 11).

  1. Rise: 11 − 3 = 8
  2. Run: 6 − 2 = 4
  3. Slope: 8 ÷ 4 = 2

Now do it the other way round to see that the order doesn't change the answer: (3 − 11) ÷ (2 − 6) = −8 ÷ −4 = 2.

A slope of 2 means that every time x goes up by 1, y goes up by 2. Because the slope is positive, the line climbs as you read the graph from left to right.

A worked example with negative slope

Take (−1, 4) and (3, −2).

  1. Rise: −2 − 4 = −6
  2. Run: 3 − (−1) = 3 + 1 = 4
  3. Slope: −6 ÷ 4 = −3/2, or −1.5

The run is where the minus sign usually goes missing. Subtracting −1 is the same as adding 1, so the run is 4, not 2. A negative slope means the line falls as you move to the right: here it drops 3 units for every 2 units across.

In algebra classes, slopes are usually left as fractions in lowest terms, such as −3/2, because a fraction is exact and a rounded decimal often isn't. A slope of 2/3 written as 0.67 has already lost a little accuracy.

When the slope is zero or undefined

Two special cases show up often.

If both points have the same y-value, such as (1, 5) and (7, 5), the rise is 0. Zero divided by any non-zero run is 0, so the line is horizontal and its slope is 0.

If both points have the same x-value, such as (5, 1) and (5, 7), the run is 0. Division by zero isn't defined, so the slope of a vertical line is undefined. It isn't zero and it isn't infinity in ordinary algebra. A vertical line's equation is written as x = 5 instead of in y = mx + b form.

The three most common mistakes

Mixing the order. Writing (y₂ − y₁) on top and (x₁ − x₂) on the bottom gives the right size of number with the wrong sign. With (2, 3) and (6, 11), that mistake gives 8 ÷ −4 = −2 instead of 2. A quick sketch catches it: if the line visibly rises to the right, the slope must be positive.

Putting x on top. Run over rise gives the reciprocal of the slope. For the first example, that would be 4/8 = 1/2 instead of 2. Remember that y, the vertical change, always goes on top.

Dropping a negative. Subtracting a negative coordinate is the step most likely to go wrong. Writing the subtraction out in full, as in 3 − (−1), before simplifying makes the sign change visible.

From slope to the equation of the line

Once you have the slope, you can write the line's equation in slope-intercept form, y = mx + b, where b is the y-intercept, the point where the line crosses the y-axis. Put either point into b = y₁ − m × x₁.

For (2, 3) with slope 2: b = 3 − 2 × 2 = −1. So the line is y = 2x − 1.

Check it with the other point: when x = 6, y = 2 × 6 − 1 = 11. That matches (6, 11), so the equation is right. This check takes a few seconds and catches most arithmetic slips.

Checking your answer

For homework, it's worth working each problem by hand first, because the steps are what tests ask for. Afterwards, you can enter the same two points into a slope calculator to confirm the slope, the fraction in lowest terms and the equation of the line. If your answer and the calculator's differ, compare the rise and run separately to find which subtraction went wrong.

About the Author

Uneeb Khan is the founder of Techager and has over 6 years of experience in tech writing and troubleshooting. He loves converting complex technical topics into guides that everyone can understand.

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Uneeb Khan
Professional Member

Uneeb Khan

Member since: Jan 16, 2026
Published articles: 690

Related Articles