Sizely
Slope Calculator

Slope Calculator

Slope calculator: find the slope of a line through two points as rise over run, plus its angle, the distance between the points, and Δx and Δy.

Alize Mendez

Written by

Alize Mendez

Updated

There was an error with your calculation.

Slope Calculator
Slope
Slope (m) 1.75
Angle (θ) 1.05165rad or 60.25512°
Distance (d) 8.062258
Delta x (Δx) 4
Delta y (Δy) 7

Slope calculator at a glance#

What is the slope of a line?#

Slope measures how steep a line is and the direction it tilts. It's calculated as the change in y (rise) divided by the change in x (run) between any two points on the line. A slope of 2 means the line ascends 2 units for each 1 unit it moves to the right.

How do you find the slope between two points?#

To find the slope, subtract the y-coordinates, subtract the x-coordinates in the same sequence, and then divide: m = (y2 − y1) ÷ (x2 − x1). Here, (x1, y1) is the first point and (x2, y2) is the second. Enter both points in the calculator above, and it will provide the slope m, the line's angle, the distance between the points, and the changes Δx and Δy.

What is the slope of the line through (7, −4) and (4, 8)?#

The slope is −4. Calculate the rise as 8 − (−4) = 12 and the run as 4 − 7 = −3, so m = 12 ÷ (−3) = −4. The negative sign means the line descends as you move rightward.

What slope means: rise over run#

Imagine you're walking along a line from left to right. The rise describes how far you move up or down, while the run is how far you move across. Slope is the ratio of these two, usually written as the letter m:

m = rise ÷ run = Δy ÷ Δx

The Greek letter Δ (delta) means "change in", so Δy is the change in y and Δx the change in x. OpenStax Elementary Algebra 2e also defines slope as the ratio of rise to run.

Consider the points (3, 2) and (7, 9), the example used on this page and the default in the calculator. Moving from (3, 2) to (7, 9), the line advances 4 units to the right and 7 units upward. Here, the rise is 7, the run is 4, giving a slope of 7/4, which is 1.75. For every 1 unit across, the line ascends 1.75 units.

Graph of the points (3, 2) and (7, 9) on a grid from 0 to 10 with a right triangle under the line: run 4, rise 7, slope 7 ÷ 4 = 1.75, angle about 60.26° and distance √65, about 8.06
The run is 4, the rise is 7, so the slope is 7/4 = 1.75.

Slope remains constant on a straight line. Selecting another pair of points on this line, such as (3, 2) and (5, 5.5), the ratio still equals 1.75, because the rise is 3.5 and the run is 2.

How to find the slope from two points#

The slope formula turns rise over run into a calculation you can use with any two points (x1, y1) and (x2, y2):

m = (y2 − y1) ÷ (x2 − x1)

In this formula, x1 and y1 are the coordinates of the first point, while x2 and y2 are the coordinates of the second point, and m is the slope. You can find the slope by following these four steps:

  1. Label the points by calling (3, 2) the first point, so x1 = 3 and y1 = 2, and by calling (7, 9) the second point, so x2 = 7 and y2 = 9.
  2. Calculate the rise: y2 − y1 = 9 − 2 = 7.
  3. Find the run in the same order: x2 − x1 = 7 − 3 = 4.
  4. Divide the rise by the run to obtain the slope: m = 7 ÷ 4 = 1.75. Keep it as the fraction 7/4 if you need the simplest form.

You can choose either point as the first one. The key is consistency in applying the same order in both the numerator and the denominator. Starting from (7, 9) instead gives (2 − 9) ÷ (3 − 7) = −7 ÷ −4 = 1.75, the same slope. An error to watch out for is mixing the order, like in (9 − 2) ÷ (3 − 7), which changes the sign and gives −1.75. The calculator above demonstrates the same concept: swapping the points changes the signs of Δx and Δy, but the slope remains unchanged.

The calculator displays its answers in decimals, so 7/4 appears as 1.75. For an answer in fractions, simplify the rise over run on your own. If a hiking trail ascends 78 feet over 1,150 feet horizontally, the slope is 78/1,150. Dividing both the numerator and the denominator by 2 simplifies it to 39/575, or approximately 0.0678. The simplifying fractions calculator can perform this reduction for any fraction.

Positive, negative, zero and undefined slope#

The sign of the slope gives the direction of the line, while its value shows the steepness.

  • A positive slope means the line ascends from left to right, similar to the line through points (3, 2) and (7, 9), with a slope m = 7/4.
  • A negative slope means the line descends from left to right, as seen in the line through (7, −4) and (4, 8), with m = −4.
  • A zero slope belongs to a horizontal line where every point has the same y-value, making the rise 0 and m = 0. An example is the line y = 2.
  • An undefined slope describes a vertical line where each point shares the same x-value, so the run is 0, and division by zero has no answer. The line x = 3 is an example.
Four graphs: a rising line with slope 7/4, a falling line with slope −4, the horizontal line y = 2 with slope 0, and the vertical line x = 3 with an undefined slope
Rising, falling, flat and vertical lines.

The larger the absolute value, the steeper the line. A slope of −4 is steeper than 1.75 because 4 is greater than 1.75. For a vertical line, the calculator says the slope is undefined and shows an angle of 90°, or −90° if the second point is below the first.

Slope, angle and distance#

Alongside m, the calculator provides related values for the same two points.

The angle θ measures the line's tilt from the positive x-axis: θ = arctan(m). With a slope of 1.75, θ = arctan(1.75) ≈ 60.26°, also given in radians as 1.05165. A negative slope gives a negative angle, so the line through (7, −4) and (4, 8) comes to about −75.96°.

The distance d is the segment length between the points, being the hypotenuse of the rise and run triangle. The Pythagorean theorem calculates it as d = √(Δx² + Δy²) = √(4² + 7²) = √65 ≈ 8.062258. Here, Δx and Δy are simply the run and rise, 4 and 7.

This calculator can run these calculations in reverse as well. By selecting Slope, you input a starting point, a slope, and a distance, and it provides the angle along with the Δx and Δy you cover when moving that distance on the line. Starting from (3, 2) with a slope of 1.75 and a distance of 8.062258, it calculates Δx = 4 and Δy = 7, bringing you back to (7, 9). You can select Angle to do the same using an angle in degrees instead of a slope. An angle of 45° gives a slope of 1, as tan 45° = 1.

Slope as a percent grade#

For roads, ramps, and trails, slope is usually given as a percent grade instead of a ratio. To find the percent grade, multiply the slope by 100:

percent grade = (rise ÷ run) × 100

A road with a 4% grade rises 4 feet for every 100 feet of horizontal distance, making the slope 0.04. The hiking trail mentioned earlier, at 78 ÷ 1,150, is approximately a 6.78% grade. The example line with a slope of 1.75 works out to a 175% grade. This explains why percent grade is mostly used for gentle slopes. The calculator doesn't automatically convert to a percent, so you'll need to multiply its slope by 100.

Wheelchair ramps are a well-known example. According to the ADA Standards for Accessible Design, ramp runs must not have a running slope steeper than 1:12, which means no more than 1 unit of rise per 12 of run. Existing buildings short on space may use 1:10 for rises up to 6 inches (15 cm), or 1:8 for rises up to 3 inches (7.5 cm). The 1:12 limit is a slope of about 0.0833, a grade of about 8.33%, and an angle of approximately 4.76°. A ramp that rises 30 inches (76.2 cm) requires at least 360 inches (914.4 cm), or 30 feet, of run.

Roof pitch is measured differently, using inches of rise per 12 inches of run. So, a roof with a 6/12 pitch has a slope of 0.5. The roofing calculator operates directly with pitch measurements.

Common slopes as a grade and an angle#

In the table, common slopes are shown as a rise-to-run ratio, a decimal, a percent grade, and an angle. Each angle is calculated as the arctangent of the slope.

Common slopes as a grade and an angle
Rise : RunSlope (m)Percent GradeAngle
1 : 200.055%2.86°
1 : 120.08338.33%4.76°
1 : 100.110%5.71°
1 : 40.2525%14.04°
1 : 20.550%26.57°
3 : 40.7575%36.87°
1 : 11100%45°
7 : 41.75175%60.26°
2 : 12200%63.43°
4 : 14400%75.96°

Where slope is used#

  • Rates of change: On a distance versus time graph, the slope shows speed. For example, a car traveling 120 miles in 2 hours has a slope of 60 miles per hour on that chart. This principle is the basis for the velocity calculator.
  • Construction and access: Slope specifications for ramps, driveways, and drainage often use ratios or percent grades to set maximum or minimum slopes.
  • Roads and trails: Signs on steep roads display the percent grade.
  • Algebra: In the equation of a line, slope is denoted by m. Lines with equivalent slopes are parallel, and those whose slopes multiply to −1 are perpendicular.

Sources#

Frequently asked questions#

Is slope rise over run or run over rise?#

Slope is rise over run. This means the vertical change is on top and the horizontal change is on the bottom. If you calculate run over rise, you get the reciprocal. For instance, you'd have 4/7 instead of 7/4.

Why is the slope of a vertical line undefined?#

For a vertical line, the x value doesn't change, making the run 0. Since slope involves dividing by the run, and division by zero is undefined, the slope is undefined. A horizontal line behaves differently. Its rise is 0, so its slope is 0.

How do you find the slope of a line like y = 76x + 67?#

When a line is in the form y = mx + b, the slope is the coefficient of x. So for y = 76x + 67, the slope is 76. For y = −2x + 5, the slope is −2. If x stands alone, as in y = x + 3, the slope is 1.

What does a slope of 0.6 mean?#

A slope of 0.6 means the line rises 0.6 units for every 1 unit it moves to the right. This is the same as 3 units up for every 5 across. As a percent grade, that's 60%, and the angle is arctan(0.6), about 30.96°.

Can a slope be a fraction or a decimal?#

Yes. 7/4 and 1.75 are the same slope. A fraction makes it easy to see both the rise and the run, which is useful when plotting the line. A decimal simplifies comparison. The calculator displays decimals rounded to seven significant figures.