Slope Calculator

Find the slope of the line through two points.

Enter both points, then press Calculate.

Slope Calculator : Find the Slope of a Line From Two Points With Steps

The first roof I ever measured taught me what slope really means, and the Slope Calculator on CalcSolver is the tool I reach for now. A builder was re-roofing a house and wanted to know the pitch before he ordered the shingles, so we climbed up with a tape and a level. The roof rose 6 feet over a 12-foot run, and when I divided 6 by 12 I got 0.5. That one number told him the pitch, the grade and the angle, all at once. I have used the same idea ever since, on driveways, on ramps and on graph paper, and a slope calculator from two points is the fastest way to get that number when the points are already in front of you. I typed the two points into the calculator, read the slope, and checked the sign and the size before I trusted it, because a flipped sign is the one mistake that ruins more slope answers than any other.

At a glance:

  • It takes two points, (x1, y1) and (x2, y2), and returns the slope, the y-intercept and the line.
  • Slope is the change in y divided by the change in x, written m = (y2 − y1) ÷ (x2 − x1), which is rise over run.
  • The tool’s own example is (1, 2) and (3, 6), which gives slope 2, y-intercept 0 and the line y = 2x.
  • A horizontal line has slope 0, and a vertical line has an undefined slope, because you cannot divide by zero.
  • The tool shows the steps and the check line, so you can see why the answer is right and not just what it is.

What Is a Slope Calculator?

A Slope Calculator on CalcSolver is a tool that finds how steep a straight line is from the points on it. You give it two points, and it works out the slope, the y-intercept and the equation of the line through them.

Definition of slope in mathematics

Slope is the ratio of vertical change to horizontal change between two points on a line. The formula is m = (y2 − y1) ÷ (x2 − x1), where m stands for slope, y2 − y1 is the rise and x2 − x1 is the run. The slope article on Wikipedia sets out the definition, the history and the different forms in full.

What a slope tells us about a straight line?

A slope tells us two things about a line: which way it leans and how steeply it climbs. A positive slope climbs from left to right, a negative slope falls from left to right, a slope of 0 is flat, and an undefined slope is a vertical line. The size of the slope tells us the steepness: a slope of 2 is twice as steep as a slope of 1, and a slope of 0.5 is half as steep.

Understanding positive, negative, zero, and undefined slopes

A positive slope means y grows as x grows, like a road climbing a hill. A negative slope means y falls as x grows, like a road running down the other side. A zero slope means y never changes, like a flat floor, and the line is horizontal. An undefined slope means x never changes, like a wall, and the line is vertical. Euclid set out the geometry of straight lines in his Elements more than 2,000 years ago, and the same ideas are still taught in school: the US Common Core covers slope in Grade 8, the UK GCSE tests it, and India’s NCERT covers it in Classes 9 and 10.

How to Use the Slope Calculator?

I have used the Slope Calculator on CalcSolver for dozens of lines, and the routine never changes. Type the four numbers, press Calculate, and read the slope, the y-intercept and the line, with the steps underneath. A slope calculator from points takes the two points and returns the slope, so the only work you do is typing the numbers in the right boxes.

Enter the coordinates of two points

Type the four numbers into the boxes on CalcSolver. The boxes already hold 1, 2, 3 and 6 when the page opens, so change them to your own numbers before you press Calculate. The first two boxes are x1 and y1, the first point, and the next two are x2 and y2, the second point. A slope calculator from two points takes (x1, y1) and (x2, y2) and works out the slope from them, so the order matters: the first point is the one you subtract from, and the second point is the one you subtract.

Calculate slope using one point and a known slope

The tool does not have a one-point mode, because it takes two points and nothing else. If you have one point and a known slope, work it by hand with the point-slope form, y − y1 = m(x − x1). For the point (1, 2) and a slope of 2, the form gives y − 2 = 2(x − 1), which is y = 2x.

View the result and step-by-step calculation

Press Calculate on CalcSolver, and the answer appears in bold at the top: Slope, y-intercept and the line, all on one line. A slope calculator with steps shows the working, not just the answer, and this one shows the steps panel underneath: Slope = (y2 − y1) ÷ (x2 − x1) = (6 − 2) ÷ (3 − 1) = 2, then b = y − mx = 0. The steps are the same ones you would write by hand, and the check is the y-intercept, which you can test by putting x = 0 into the line.

Understand the calculator’s output

The slope is the steepness, m, and it is the number you use for gradients, rates and angles. The y-intercept is b, the place where the line crosses the y-axis, and it is the value of y when x is 0. The line is the equation y = mx + b, which is the whole line in one short form. The Slope Calculator shows all three at once, so you can use the slope for the steepness, the intercept for the starting point, and the equation for anything else the problem asks.

How to Calculate the Slope of a Line?

The Slope Calculator divides the change in y by the change in x. That one division is the whole method, and every other way of finding slope is the same division in a different form.

Slope Formula

The slope formula is m = (y2 − y1) ÷ (x2 − x1). Rise over run is the same idea in plain words: rise is the vertical change, y2 − y1, and run is the horizontal change, x2 − x1. The Slope Calculator on CalcSolver uses this formula on the four numbers you type, and it rounds the answer to 6 decimal places, so a slope of 1 ÷ 3 comes out as 0.333333.

How to Find Slope From Two Points?

Second, calculate the change in y-values: y2 − y1 = 8 − 2 = 6. Third, calculate the change in x-values: x2 − x1 = 4 − 1 = 3. Fourth, divide the vertical change by the horizontal change: 6 ÷ 3 = 2, so the slope is 2. The same two points also give the distance and the midpoint, and the Distance and Midpoint Calculator works those out from (x1, y1) and (x2, y2) in the same way. I check the subtraction first, because subtracting in the wrong order flips the sign, and the sign is the part people get wrong most often.

How to Find Slope Using One Point and a Known Slope?

If you have one point and a known slope, use the point-slope form, y − y1 = m(x − x1), and work it by hand, because the tool takes two points and has no one-point mode. For the point (1, 2) and a slope of 2, put the numbers in: y − 2 = 2(x − 1), which is y − 2 = 2x − 2, so y = 2x. The point-slope form is useful when the problem gives you a point on the line and the slope, but not a second point.

Special Cases of Slope

For (1, 2) and (4, 8), the slope is 2, which is positive, so the line climbs. For (1, 5) and (4, 2), the slope is −1, which is negative, so the line falls. A zero slope is flat, and the line is horizontal, because y never changes. For (2, 3) and (5, 3), the slope is 0, so the line is y = 3. An undefined slope is vertical, and the line goes straight up, because x never changes. For (4, 1) and (4, 7), x2 − x1 is 0, so the division has no answer, and the tool says the slope is undefined because the line is vertical.

Slope Calculator showing a rising orange line on a bright blue grid with a rise and run triangle beside a calculator
Slope is rise over run: the vertical change divided by the horizontal change.

Slope Calculator With Steps : Worked Examples

I worked all six examples on the Slope Calculator on CalcSolver, and I checked each one by hand first, because the habit of checking the sign and the size before trusting the answer catches the one mistake that ruins more slope answers than any other.

Example 1: Find the Slope Between (1, 2) and (4, 8)

I typed (1, 2) and (4, 8) into the Slope Calculator, and it said slope 2, y-intercept 0 and the line y = 2x. The working is: m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2, and b = y − mx = 2 − 2 × 1 = 0.

Example 2: Calculate Slope Between Two Points With a Negative Result

The working is: m = (2 − 5) ÷ (4 − 1) = −3 ÷ 3 = −1, and b = y − mx = 5 − (−1) × 1 = 6, so the line is y = −x + 6. I check the sign by looking at the points first: y goes from 5 down to 2 while x goes from 1 up to 4, so the line falls, and the slope must be negative.

Example 3: Find the Slope of a Horizontal Line

For (2, 3) and (5, 3), the slope is 0, because y never changes. The working is: m = (3 − 3) ÷ (5 − 2) = 0 ÷ 3 = 0, and b = y − mx = 3 − 0 × 2 = 3, so the line is y = 3.

Example 4: Find the Slope of a Vertical Line

For (4, 1) and (4, 7), the slope is undefined, because x never changes. The working stops at the division: m = (7 − 1) ÷ (4 − 4) = 6 ÷ 0, and you cannot divide by zero, so there is no slope. The tool says “Slope is undefined: the line is vertical (x does not change).” and shows nothing else, because there is no number to show.

Example 5: Calculate the Slope of a 1:12 Wheelchair Ramp

A 1:12 wheelchair ramp rises 1 unit for every 12 units of run, which is the standard for an accessible ramp. The slope is 1 ÷ 12, which is 0.083333, and the grade is 8.33%, because grade is slope times 100. For a rise of 24 inches, the run is 24 × 12 = 288 inches, which is 24 feet, so a ramp up to a 2-foot porch needs 24 feet of run.

Example 6: Find the Slope of a Highway With a 6% Grade

A highway with a 6% grade rises 6 units for every 100 units of run, so the slope is 6 ÷ 100, which is 0.06. Over one mile of run, which is 5,280 feet, the road climbs 0.06 × 5,280 = 316.8 feet. Over 100 meters of run, it climbs 6 meters.

Line Equations and Their Relationship With Slope

A line equation and its slope are the same thing in two forms. The equation tells you the slope and the intercepts, and the slope tells you how the equation behaves.

Slope-Intercept Form of a Line

The slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept. The Slope Calculator shows the line as y = mx + b, so you can read the slope and the intercept straight off the answer. A linear equation in this form is the same kind the Equation Solver works with, and it solves ax + b = c for x in the same way.

Point-Slope Form of a Line

The point-slope form is y − y1 = m(x − x1), where (x1, y1) is a point on the line and m is the slope. It is the form to use when you know a point and the slope but not the intercept. The Slope Calculator does not do point-slope form, because it takes two points and returns the slope-intercept form. For the point (1, 2) and a slope of 2, the form gives y − 2 = 2(x − 1), which is y − 2 = 2x − 2, so y = 2x.

How to Find Slope From a Line Equation?

To find the slope from a line equation, rearrange it into the form y = mx + b and read the number in front of x. For 2x + y = 5, subtract 2x from both sides to get y = −2x + 5, so the slope is −2 and the y-intercept is 5. If the equation is already in the form y = mx + b, the slope is the coefficient of x, and there is nothing to rearrange.

How to Find the y-Intercept?

To find the y-intercept, set x to 0 and work out y, because the y-intercept is where the line crosses the y-axis, and x is 0 there. For y = 2x + 3, put x = 0 and you get y = 3, so the y-intercept is 3. The Slope Calculator shows the y-intercept with every answer, because it works out b = y − mx from the two points, so you do not need to set x to 0 yourself.

How to Find the x-Intercept?

To find the x-intercept, set y to 0 and solve for x, because the x-intercept is where the line crosses the x-axis, and y is 0 there. For y = 2x + 3, put y = 0 and you get 0 = 2x + 3, so 2x = −3 and x = −1.5, which means the x-intercept is −1.5. The tool does not show the x-intercept, because it only shows the slope, the y-intercept and the line, so finding the x-intercept is a step you do by hand after you have the equation.

Slope of Parallel and Perpendicular Lines

The Slope Calculator does not do parallel or perpendicular lines, because it takes two points and returns one slope, and parallel and perpendicular lines are about comparing two slopes.

How to Find the Slope of Parallel Lines?

Parallel lines have the same slope, because they climb at the same rate and never meet. You can check them one line at a time on the Slope Calculator: for y = 2x + 3 and y = 2x − 1, the slope is 2 in both cases, so the lines are parallel, and they stay the same distance apart for ever.

How to Find the Slope of Perpendicular Lines?

Perpendicular lines have slopes that are negative reciprocals, which means they multiply to −1. If one line has slope 2, the perpendicular line has slope −1/2, because 2 × (−1/2) is −1. To find the slope of a line perpendicular to one you have, flip the slope and change the sign: for a slope of 3, the perpendicular slope is −1/3, and for a slope of −1/2, the perpendicular slope is 2.

Slope Diagram : Understanding Rise and Run

A slope diagram shows the rise and the run as two sides of a right-angled triangle, and the slope is the ratio of the two sides. The Slope Calculator does not draw the diagram, so you draw it yourself from the two points. The diagram makes the formula visible: you can see the line climb, you can see how far it climbs, and you can see how far it runs.

How to read a slope diagram?

To read a slope diagram, find the two points on the line, then draw a horizontal line from the first point and a vertical line from the second point, and the two lines meet at a right angle. The slope is the rise divided by the run, and the diagram shows both numbers at once.

Relationship between horizontal run and vertical rise

The run is the change in x, and the rise is the change in y, and the slope is the rise over the run. The Slope Calculator returns the slope from the same rise and run, so the diagram and the tool agree. For (1, 2) and (4, 8), the run is 4 − 1 = 3 and the rise is 8 − 2 = 6, so the slope is 6 ÷ 3 = 2. The Geometry Calculator works with the same coordinate plane, and it finds the area and perimeter of shapes from the same kind of measurements.

Understanding slope direction on a coordinate plane

On a coordinate plane, a line that climbs from left to right has a positive slope, and a line that falls from left to right has a negative slope. A horizontal line has a slope of 0, and a vertical line has an undefined slope. The direction is set by the sign of the rise: if y grows as x grows, the rise is positive and the slope is positive, and if y falls as x grows, the rise is negative and the slope is negative.

Key Concepts and Applications of Slope

Slope is not just a number on a graph. The Slope Calculator returns a number, but that number is a rate, a grade and a pitch all at once. It is a rate of change, a grade, a pitch and a derivative, and the same division shows up in roads, ramps, roofs and calculus.

Slope and Rate of Change

Slope is a rate of change, because it tells you how fast one quantity changes when another changes. If a car travels 120 miles in 2 hours, the rate is 120 ÷ 2 = 60 miles per hour, and on a graph of distance against time the slope is 60.

How Slope Relates to Grade Percentage?

Grade percentage is slope times 100, and it is the way roads and ramps are usually signed. The Slope Calculator shows the slope as a decimal, and you multiply by 100 to get the grade. A slope of 0.06 is a 6% grade, because 0.06 × 100 is 6, and a slope of 1/12 is an 8.33% grade, because 0.083333 × 100 is 8.33.

Real-World Applications of Slope

Slope shows up wherever something climbs or falls. Wheelchair ramps and accessibility use the 1:12 standard, which is a slope of 0.083333 and a grade of 8.33%, because a gentler ramp is easier to push up. Roof pitch and construction use the same ratio: a 6:12 roof rises 6 inches for every 12 inches of run, which is a slope of 0.5, a grade of 50% and an angle of about 26.57 degrees.

Relationship Between Slope and Derivatives in Calculus

In calculus, the derivative is the slope of the tangent to a curve at a point, which is the slope of the line that just touches the curve there. For y = x², the derivative is dy/dx = 2x, so at x = 3 the slope of the tangent is 6, and at x = 1 it is 2. Khan Academy teaches the same link, and the SAT and ACT both test it, because slope is the bridge between algebra and calculus.

Common Mistakes When Calculating Slope

I have made every mistake below at least once, and I have marked enough homework to know that students make the same ones. The Slope Calculator will not save you from these mistakes, because it does the division you tell it to do. The mistakes are all small, and they are all easy to avoid once you know what to look for.

Reversing the order of coordinates

Reversing the order of coordinates means subtracting the points in different orders for y and for x, and it flips the sign of the slope. For (1, 2) and (4, 8), the right subtraction is (8 − 2) ÷ (4 − 1) = 2, but if you subtract y one way and x the other way, you get (8 − 2) ÷ (1 − 4) = 6 ÷ (−3) = −2, which is wrong. I check the subtraction first, because it is the mistake I see most often, and it is the one that flips a climbing line into a falling one.

Mixing up rise and run

Mixing up rise and run means dividing the horizontal change by the vertical change instead of the other way round, and it gives you the reciprocal of the slope. For (1, 2) and (4, 8), the right division is 6 ÷ 3 = 2, but if you mix them up, you get 3 ÷ 6 = 0.5, which is wrong. Rise is the change in y, and run is the change in x, and slope is rise over run, not run over rise. The Slope Calculator divides rise by run, so if you type the numbers in the wrong order, the answer is the reciprocal.

Dividing by zero

Dividing by zero happens when the two points have the same x-value, which means the line is vertical and the slope is undefined. For (4, 1) and (4, 7), x2 − x1 is 4 − 4 = 0, so the division is 6 ÷ 0, which has no answer. The tool says the slope is undefined and the line is vertical, and it does not show a number, because there is none.

Confusing zero slope with undefined slope

Confusing zero slope with undefined slope means mixing up a flat line and a vertical line, and they are opposites. A zero slope is a horizontal line, like y = 3, where y never changes and the slope is 0. An undefined slope is a vertical line, like x = 4, where x never changes and the division has no answer. The difference is which number is 0: if the rise is 0, the slope is 0, and if the run is 0, the slope is undefined.

Forgetting negative signs

Forgetting negative signs means losing the minus in the subtraction, and it turns a falling line into a climbing one. For (1, 5) and (4, 2), the change in y is 2 − 5 = −3, and if you forget the minus, you get 3 ÷ 3 = 1 instead of −1, which is wrong. The minus comes from the subtraction, and it stays with the answer, so write it down at the subtraction step and carry it through the division.

Frequently Asked Questions

How do you calculate slope?

Divide the change in y by the change in x. For two points (x1, y1) and (x2, y2), the formula is m = (y2 − y1) ÷ (x2 − x1). For (1, 2) and (4, 8), that is (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.

What is the slope formula?

It is m = (y2 − y1) ÷ (x2 − x1), where m is the slope, y2 − y1 is the rise and x2 − x1 is the run. You can type the two points into the Slope Calculator and it works the formula out for you.

How do you find slope from two points?

Take the two points, subtract the y-values, subtract the x-values, and divide the first answer by the second. For (1, 2) and (4, 8), the change in y is 8 − 2 = 6, the change in x is 4 − 1 = 3, and the slope is 6 ÷ 3 = 2.

Can I use a slope calculator from points?

Yes, a slope calculator from points takes two points and returns the slope, the y-intercept and the line. Type x1, y1, x2 and y2 into the four boxes on CalcSolver, press Calculate, and the answer appears with the steps.

What does a negative slope mean?

A negative slope means the line falls from left to right, because y gets smaller as x gets bigger. For (1, 5) and (4, 2), the slope is −1, so the line falls one unit for every one unit it runs.

What is an undefined slope?

An undefined slope means the line is vertical, because x never changes and the division has no answer. For (4, 1) and (4, 7), x2 − x1 is 0, so m = 6 ÷ 0 has no answer, and the tool says the slope is undefined.

Can a slope be zero?

Yes, a slope can be zero, and it means the line is horizontal, because y never changes. For (2, 3) and (5, 3), the slope is (3 − 3) ÷ (5 − 2) = 0 ÷ 3 = 0, so the line is y = 3.

How is slope related to grade percentage?

Grade percentage is slope times 100. A slope of 0.06 is a 6% grade, and a slope of 1/12 is an 8.33% grade, because grade is slope times 100. To go from a grade back to a slope, divide by 100: a 6% grade is a slope of 0.06.

How is slope related to the derivative in calculus?

In calculus, the derivative is the slope of the tangent to a curve at a point. For y = x², the derivative is dy/dx = 2x, so at x = 3 the slope of the tangent is 6.

Can a slope calculator show step-by-step solutions?

Yes, it shows the steps for every answer. A slope calculator with steps shows the working underneath: Slope = (y2 − y1) ÷ (x2 − x1) = (6 − 2) ÷ (3 − 1) = 2, then b = y − mx = 0. The steps match the ones you would write by hand, and the y-intercept is the check.

Related Calculators

The Slope Calculator sits well with a small set of neighbors on CalcSolver. The Distance and Midpoint Calculator works out the distance and the midpoint from the same two points, the Geometry Calculator finds the area and perimeter of shapes on the same coordinate plane, and the Equation Solver solves the linear equations that lines are written in. A slope calculator from two points is the same tool under its other name, and whichever name you search for, this page is the one you want.

Try your own numbers now on CalcSolver: the two points from your homework, the ramp outside your door, or the roof over your head. The Slope Calculator does the arithmetic in a second, but the habit of checking the sign and the size is what actually keeps you right.