If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Slope formula

Learn how to write the slope formula from scratch and how to apply it to find the slope of a line from two points.
It's kind of annoying to have to draw a graph every time we want to find the slope of a line, isn't it?
We can avoid this by writing a general formula for slope. Before we start, let's remember how slope is defined:
Slope=Change in yChange in x
Let's draw a line through two general points (x1,y1) and (x2,y2).
A coordinate plane. The x-axis runs from horizontally and has 2 tick marks labeled x1 and x2. The y-axis runs vertically and has 2 tick marks labeled y1 and y2. A graph of a line intersects the points (x1, y1) and (x2, y2). Closed points are plotted at (x1, y1) and (x2, y2).
An expression for change in x is x2x1:
A coordinate plane. The x-axis runs from horizontally and has 2 tick marks labeled x1 and x2. The y-axis runs vertically and has 2 tick marks labeled y1 and y2. A graph of a line intersects the points (x1, y1) and (x2, y2). Closed points are plotted at (x1, y1) and (x2, y2). There is a horizontal segment that starts at (x1, y1) that is labeled x2 minus x1.
Similarly, an expression for change in y is y2y1:
A coordinate plane. The x-axis runs from horizontally and has 2 tick marks labeled x1 and x2. The y-axis runs vertically and has 2 tick marks labeled y1 and y2. A graph of a line intersects the points (x1, y1) and (x2, y2). Closed points are plotted at (x1, y1) and (x2, y2). There is a horizontal segment that starts at (x1, y1) that is labeled x2 minus x1. There is a vertical segment that starts at (x2, y2) that is labeled y2 minus y1.
Now we can write a general formula for slope:
Slope=Change in yChange in x=y2y1x2x1
That's it! We did it!

Using the slope formula

Let's use the slope formula to find the slope of the line that goes through the points (2,1) and (4,7).
Step 1: Identify the values of x1, x2, y1, and y2.
x1=2
y1=1
x2=4
y2=7        
Step 2: Plug in these values to the slope formula to find the slope.
Slope=y2y1x2x1=7142=62=3
Step 3: Gut check. Make sure this slope makes sense by thinking about the points on the coordinate plane.
A coordinate plane. The x-axis runs from negative 2 to 10 and is scaled by 1. The y-axis runs from negative 4 to 10 and is scaled by 1. A graph of a line intersects the points (2, 1) and (4, 7). Closed points are plotted at (2, 1) and (4, 7).
Yup! This slope seems to make sense since the slope is positive, and the line is increasing.

Using the slope formula walkthrough

Let's use the slope formula to find the slope of the line that goes through the points (6,3) and (1,7).
Step 1: Identify the values of x1, x2, y1, and y2.
x1=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
y1=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
x2=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
y2=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Step 2: Plug in these values to the slope formula to find the slope.
Slope=y2y1x2x1=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Step 3: Gut check. Make sure this slope makes sense by thinking about the points on the coordinate plane.
A coordinate plane. The x-axis runs from negative 2 to 10 and is scaled by 1. The y-axis runs from negative 4 to 10 and is scaled by 1. A graph of a line intersects the points (1, 7) and (6, negative 3). Closed points are plotted at (1, 7) and (6, negative 3).
Does this slope make sense?
Choose 1 answer:

Let's practice!

1) Use the slope formula to find the slope of the line that goes through the points (2,5) and (6,8).
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

2) Use the slope formula to find the slope of the line that goes through the points (2,3) and (4,3).
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

3) Use the slope formula to find the slope of the line that goes through the points (5,7) and (2,1).
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Something to think about

What happens in the slope formula when x2=x1?
As a reminder, here is the slope formula:
Slope=y2y1x2x1
Feel free to discuss in the comments below!

Want to join the conversation?