Slope Calculator to Find
Slope and Y-Intercept of a Straight Line

[ Skip to Calculator ] Calcy pointing down

The Slope Calculator on this page will find the slope of a straight line when two points are known.

This free online slope calculator will find the slope, y-intercept, 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).

How to Calculate Slope From Two Points

The formula for calculating the slope of a straight line from any two points on the line is as follows:

Slope Formula
m = Y2 - Y1
X2 - X1

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).

Example Problem

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 = Y2 - Y1
X2 - X1
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.

Two Cases to Be Aware Of

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.

Formulating the Line Equation

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, y-intercept, and angle of a straight line when two points on the line are known.

Slope Calculator
Slope Calculator


Instructions: Pick two points on the straight line in question and enter the X and Y values of each point. Note that the order of the points makes no difference.

Once you have entered both points, click the "Calculate Slope" button.

Mouse over the blue question marks for a further explanation of each entry field. More in-depth explanations can be found in the glossary of terms located beneath the Slope Calculator.

Important: Please double-check the results of this calculator yourself before considering them to be valid, as I can't test all possible number combinations. If you do find an issue with the calculator, please contact me and let me know what points you entered.

calcy treasure chest of features Save Your Work!

Just one of the Treasure Chest of Bonus Features you'll enjoy when you support the Ad-Free, Member Version of this site (for as little as 58¢ per month). See what you're missing!

Calculator Not Working? Please try disabling Ad Block for this page, as it may be blocking the code that runs the calculator.

Help Point 1 (X1,Y1): (, )
Help Point 2 (X2,Y2): (, )
Help Δ X:
Help Δ Y:
Help Slope m:
Help Angle θ:
Help Distance d:
Help Y-intercept b:
Help Equation y = mx - b:
Please grade my work and help me improve:
If you liked this page, please share it, or give it a Like, +1, Tweet, or Pin.
calcy image pointing right

Algebra Calculator Image

Slope Calculator Glossary of Terms

Calcy magnifying glass

Check Out My Other Super
Online Math Calculators
To Help You To
Solve and Learn ...
Super Calcy

Point 1 (X1,Y1): Enter the X and Y values of the first point. The values can be in the form of a fraction (2/3, note the forward slash), a decimal, or a whole number. Mixed numbers will need to be converted to fractions before entering (for 1-1/2, enter 3/2). Note that fractions will be converted to decimals.

Point 2 (X2,Y2): Enter the X and Y values of the second point. The values can be in the form of a fraction (2/3, note the forward slash), a decimal, or a whole number. A mixed number will need to be converted to a fraction before entering (for 1-1/2, enter 3/2). Note that fractions will be converted to decimals.

Δ X: This is the difference or change between X2 and X1 and is often referred to as the run. If X2 is to the left of X1, the run will be a negative number. If X2 is to the right of X1, the run will be a positive number.

Δ Y: This is the difference or change between Y2 and Y1 and is often referred to as the rise. If Y2 is below Y1, the rise will be a negative number. If Y2 is above Y1, the rise will be a positive number.

Slope m: This is the rise (Δ Y) divided by the run (Δ X). If the slope is positive, it means the line is going up from left to right. If the slope is negative it means the line is going down from right to left. The higher the absolute value of the slope, the steeper the line.

Angle θ: This is the angle the line forms with the X axis, which is based on the arc tangent of the slope.

Distance d: This is the distance between the entered points. For a vertical line the distance is the absolute value of the change in Y. For a horizontal line the distance is the absolute value of the change in X. For all other lines, distance is calculated using the distance formula (pythagorean theorem to calculate the length of side of a triangle, a.k.a, the hypotenuse).

Y-intercept b: This is the point at which the line crosses the Y axis.

Equation y = mx - b: This is the calculated equation of the straight line that passes through the entered points. m stands for slope and b stands for Y-intercept.

Math Tutors

[ Return to Top of Calculator ] [ Return to Top of Page ] Calcy pointing up



> > Slope Calculator



+1 Free-Online-Calculator-Use.com
+1 Page Site
Help


Protected by Copyscape Online Plagiarism Detection
Calcy with money image
Top Ten Home
Money Calculators

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. This will insure you'll always know what I've been up to and where you can find me!

* indicates required
Online Pocket Calc
Help





Online math problem solver image
Find a Local Math Tutor Today