This free online slope calculator will find the slope, yintercept, and angle of a straight line when two points on the line are known.
Plus, the calculator also finds the distance between the two entered points, formulates the equation of the line, and even shows its work as to how it arrived at the slope and the line equation.
Finally, the calculator will attempt to graph the straight line formed by the two points (may not work in older web browsers).
The formula for calculating the slope of a straight line from any two points on the line is as follows:
Slope Formula  

m =  Y_{2}  Y_{1} 
X_{2}  X_{1} 
To solve the slope formula, choose any two points on the straight line and designate one of them to be point #1 and the other to be point #2 (regardless of which point you choose for which designation you will still get the same answer).
After designating the two points ...
The X value from point #1 becomes X1.
The Y value from point #1 becomes Y1.
The X value from point #2 becomes X2.
The Y value from point #2 becomes Y2.
From there you simply substitute the values into the slope formula to solve for m (slope).
Find the slope of a straight line passing through the points (2,1) and (4,5).
For this example we will choose (2,1) to be point number one, and (4,5) to be point number two, which means ...
X1 = 2
Y1 = 1
X2 = 4
Y2 = 5
From there we simply substitute the variables in the slope formula and solve it, like this:
Slope Solution  

m =  Y_{2}  Y_{1} 
X_{2}  X_{1}  
m =  (5)  (1) 
(4)  (2)  
m =  6 
6  
m =  6/6, or 1 
To see how the opposite designation yields the same result, this time we will choose (4,5) to be point number one, and (2,1) to be point number two, which means ...
X1 = 4
Y1 = 5
X2 = 2
Y2 = 1
Solving the formula give us:
m =  (1)  (5) 
(2)  (4)  
m =  6 
6  
m =  6/6, or 1 
So you see, it doesn't matter which point you designate as #1 or #2.
If the X coordinates are the same for both points, you will end up with a zero as the denominator. In turn this means that the slope will be undefined since you can't divide a number by zero. Of course, all this really means is that a line with an undefined slope is a vertical line.
Conversely, if the Y coordinates are the same for both points, the slope will be zero (0 divided by any number is 0). A slope of 0 indicates a horizontal line.
Once you have solved for the slope of the line running between the two points, you can then formulate an equation that will find the Y value for any X value, using the following formula:
Straight Line Equation 

y  y1 = m(x  x1) 
Using our first example, you would formulate the line equation as follows:
y  y1 = m(x  x1) y  (1) = 1(x  (2)) y = 1x  ((2) + (1)) y = x + 1 
Using the second example, you would formulate the line equation as follows:
Straight Line Equation 

y  y1 = m(x  x1) y  (5) = 1(x  (4)) y = 1x  ((4) + (5)) y = x + 1 
In the case of a vertical line, the X value would be the same for any Y value.
In the case of a horizontal line, the Y value would be the same for any X value on the line.
With that, let's use the Slope Calculator to find the slope, yintercept, and angle of a straight line when two points on the line are known.

Follow me on any of the social media sites below and be among the first to get a sneak peek at the newest and coolest calculators that are being added or updated each month.
Monthly What's New Email Update!
Who knows if I will show up in your next search. These monthly updates will insure you'll always know what I've been up to and where you can find me! 
Online Pocket Calc  

