Slope Calculator

Find the slope between two points, along with the line equation, the y-intercept, the angle of inclination, and the slope as a percentage grade. Enter two points and the calculator updates as you type. Everything runs in your browser, nothing is uploaded.

Find the slope between two points

Enter the first point and the second point. Whole numbers and decimals are both allowed.

Enter all four numbers to see the slope.

Privacy: everything runs in your browser, nothing is uploaded.

Worked example

Take the points (1, 2) and (4, 8). First, find how far the line goes up and how far it goes across. The rise is 8 minus 2, which is 6. The run is 4 minus 1, which is 3. So the slope is (8-2)/(4-1) = 6/3 = 2.

Next, find the y-intercept. The line equation is y = mx + b, where m is the slope. Using the first point, 2 = 2 x 1 + b, so b = 0. That gives the equation y = 2x + 0. In plain words, for every step to the right, the line rises by 2, and it crosses the vertical axis at zero.

Finally, the angle of inclination is about 63.4 degrees, because the angle whose tangent is 2 is about 63.4 degrees. The slope as a percentage grade is 2 x 100 = 200%, which means the line rises 200 units for every 100 units it moves to the right.

How to use this calculator

  1. Enter the first point: type the x1 value in the first box and the y1 value in the second box.
  2. Enter the second point: type the x2 value and the y2 value in the next two boxes.
  3. Read the results as they update, or click Calculate slope to refresh the result.
  4. Use Clear to empty all four boxes and start again with a new pair of points.
  5. Try a pair of points from your homework or a real measurement, such as the start and end of a ramp, and check the slope, equation, and angle together.

How it works

Slope is a simple idea: it tells you how steep a line is. Imagine walking along a line from the first point to the second point. The rise is how far you go up or down, and the run is how far you go to the right. The slope is the rise divided by the run. That is why slope is often described as rise over run.

If the line goes up as you move to the right, the rise is positive and the slope is positive. If the line goes down as you move to the right, the rise is negative and the slope is negative. A flat line has no rise at all, so its slope is zero. A line that goes straight up has no run at all, so you cannot divide by zero, and its slope is undefined.

The line equation y = mx + b puts this idea into a short formula. Here, m is the slope, x is a point along the horizontal axis, and b is where the line crosses the vertical axis. Once you know m and b, you can find y for any x. The angle of inclination is the angle between the line and a flat horizontal line. A slope of 1 gives an angle of 45 degrees, because the line rises exactly as much as it runs. A larger slope gives a steeper angle, closer to 90 degrees, while a slope near zero gives an angle near zero degrees.

The percentage grade is another way to say the same thing. Multiply the slope by 100. A slope of 0.5 becomes a 50% grade, which means the line rises 50 units for every 100 units it runs. Road signs and ramps often use percentage grades, because they are easy to compare at a glance.

Frequently asked questions

What is slope?

Slope is a number that describes how steep a line is and which way it leans. It is found by dividing the change in height by the change in horizontal distance between two points on the line. A slope of 2 means the line rises 2 units for every 1 unit it moves to the right. A slope of 0.5 means it rises half a unit for every unit it moves to the right.

What does undefined slope mean?

Undefined slope means the line goes straight up, with both points sharing the same x value. The slope formula needs you to divide by the change in x, and that change is zero here, so you cannot divide by zero. The calculator therefore says the slope is undefined, and it explains that the line goes straight up. A vertical line still has an equation, such as x = 3, and its angle is 90 degrees, but it has no slope number.

Can slope be negative?

Yes. A negative slope means the line goes downhill as you move to the right. For example, the points (0, 5) and (2, 1) give a slope of (1-5)/(2-0) = -4/2 = -2. The line falls 2 units for every unit it moves to the right. Negative slopes are common in real life, from a road going down a hill to a price falling over time, and the angle and percentage grade will be negative in the same way.

What is the difference between slope and gradient?

For a straight line, slope and gradient mean the same thing. Both describe rise over run, and both use the letter m in the equation y = mx + b. In school maths, the word slope is more common in the United States, while gradient is more common in the United Kingdom and in some other countries. In more advanced maths, gradient can also describe a slope in several directions at once, but for a simple straight line on a graph, you can use either word and get the same answer.

Scroll to Top