NewA place value chart for any number, with decimals and the Indian system. Try it free Need help? support@printsheetlab.com

Browse all topics

Slope Calculator With Steps: Two Points, Equation and Grade

Enter two points, a rise and run, or a grade to get the slope, line equation, distance, midpoint and angle with every step shown.

A slope calculator finds how steep a line is. The slope is the rise divided by the run, m = (y₂ − y₁) ÷ (x₂ − x₁). This free slope calculator takes two points, a rise and run, or a percent grade, and gives the slope, the line equation, the distance, the midpoint, the angle and the percent grade, with every step of the working shown.

Graph for the slope calculator showing rise over run between the points (1, 2) and (5, 8): rise 6, run 4, slope 1.5
The slope calculator's core idea: slope is rise over run. Between (1, 2) and (5, 8) the rise is 6 and the run is 4, so m = 1.5.

Quick answer: slope = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁). For the points (1, 2) and (5, 8) the rise is 8 − 2 = 6 and the run is 5 − 1 = 4, so the slope is 6 ÷ 4 = 1.5 and the line is y = 1.5x + 0.5.

How to use this slope calculator

The slope calculator has three tabs at the top of the box. Pick the one that matches what you know, type the numbers, and the answer and the working update at once. There is no Calculate button to press.

  1. Two points (the default): type x₁ and y₁ for the first point and x₂ and y₂ for the second. Decimals and negative numbers work.
  2. Rise and run: type how far the line goes up (rise) and how far it goes across (run), in any unit as long as both use the same one.
  3. Grade or angle: type a percent grade, an angle in degrees, or the N in a 1 in N slope, and the slope calculator converts between all of them.
  4. Read the slope at the top, then the line equation, distance, midpoint and angle underneath, and open How it works for the steps. Tap Copy result to paste the answer into your homework or a message.

Slope formula: rise over run

The slope formula measures how much y changes when x changes. Pick any two different points on a line, (x₁, y₁) and (x₂, y₂). The vertical change is the rise and the horizontal change is the run:

m = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁)

Here m is the slope, y₂ − y₁ is the rise and x₂ − x₁ is the run. Subtract in the same order on top and bottom. If you swap the points on top, swap them on the bottom too, and the answer stays the same. The sign of the slope tells you the direction of the line:

Slope What the line does Example
Positive (m > 0) rises from left to right (1, 2) and (5, 8): m = 1.5
Negative (m < 0) falls from left to right (−3, 4) and (5, −2): m = −0.75
Zero (m = 0) is flat, a horizontal line y = k (1, 4) and (9, 4): m = 0
Undefined is vertical, a line x = k (the run is zero) (2, 1) and (2, 7): run = 0
Four lines for the slope calculator: positive, negative, zero and undefined slope
Positive, negative, zero and undefined slopes at a glance.

The larger the absolute value of the slope, the steeper the line. A slope of 1 is a 45° line, because the rise equals the run.

Slope calculator with steps: worked examples

Here are two full examples, worked the way the slope calculator with steps shows them. Type the same numbers into the tool to check each line of the working.

Example 1: a positive slope

Find the slope of the line through (1, 2) and (5, 8).

  1. Rise = y₂ − y₁ = 8 − 2 = 6.
  2. Run = x₂ − x₁ = 5 − 1 = 4.
  3. Slope m = 6 ÷ 4 = 3/2 = 1.5. The line rises from left to right.
  4. y-intercept: b = y₁ − m × x₁ = 2 − 1.5 × 1 = 0.5.
  5. Line equation: y = 1.5x + 0.5. In standard form that is 3x − 2y = −1.
  6. Distance = √(4² + 6²) = √52 = 2√13 ≈ 7.2111. Midpoint = (3, 5). Angle = arctan(1.5) ≈ 56.31°. Percent grade = 150%.

Example 2: a negative slope

Find the slope of the line through (−3, 4) and (5, −2).

  1. Rise = −2 − 4 = −6.
  2. Run = 5 − (−3) = 8. Two minus signs make a plus, so subtract a negative by adding.
  3. Slope m = −6 ÷ 8 = −3/4 = −0.75. The line falls from left to right.
  4. b = 4 − (−0.75) × (−3) = 4 − 2.25 = 1.75, so y = −0.75x + 1.75.
  5. Check with the second point: −0.75 × 5 + 1.75 = −3.75 + 1.75 = −2. It matches.
  6. Distance = √(8² + 6²) = √100 = 10. Midpoint = (1, 1). Angle ≈ −36.87°.

The most common slip is a sign error when a coordinate is negative. Put brackets around negative numbers before you subtract, as in step 2 above, and the slope calculator’s working will match yours.

Slope intercept form and point-slope form

Once you know the slope, the slope calculator also writes the equation of the line. There are three common forms, and each one is useful for a different job.

Form Pattern For (1, 2) and (5, 8) Best for
Slope intercept form y = mx + b y = 1.5x + 0.5 graphing: m is the steepness and b is where the line crosses the y-axis
Point-slope form y − y₁ = m(x − x₁) y − 2 = 1.5(x − 1) writing a line from one point and the slope
Standard form Ax + By = C 3x − 2y = −1 integer coefficients and finding intercepts fast

To change between them, expand the brackets: y − 2 = 1.5(x − 1) becomes y = 1.5x + 0.5. To find the slope from standard form Ax + By = C, use m = −A ÷ B. For 3x − 2y = −1 that is −3 ÷ (−2) = 1.5.

Slope calculator from an equation

If you already have an equation, read the slope straight from it. In y = mx + b the number in front of x is the slope: y = 4x − 7 has slope 4. If the equation is not solved for y, rearrange it first. For 6x + 3y = 12, subtract 6x to get 3y = −6x + 12, then divide by 3 to get y = −2x + 4, so the slope is −2.

Distance formula calculator and midpoint calculator

Two points also give a length and a center. This tool works as a distance formula calculator and a midpoint calculator at the same time, because both come straight from the coordinates.

Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²). This is the Pythagorean theorem applied to the run and the rise. Midpoint: M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2), the average of the x values and the average of the y values.

Points Distance working Distance Midpoint
(0, 0) and (3, 4) √(9 + 16) = √25 = 5 5 (1.5, 2)
(1, 2) and (5, 8) √(16 + 36) = √52 = 2√13 7.2111 (3, 5)
(−3, 4) and (5, −2) √(64 + 36) = √100 = 10 10 (1, 1)
(2, 3) and (6, 11) √(16 + 64) = √80 = 4√5 8.9443 (4, 7)
(−5, 2) and (7, −3) √(144 + 25) = √169 = 13 13 (1, −0.5)

When the number under the root is not a perfect square, the exact distance stays as a simplified radical such as 2√13, and the slope calculator also gives the decimal. For simplifying radicals by hand see the square root calculator, and for right triangles use the Pythagorean theorem calculator.

Special cases: horizontal, vertical and identical points

Horizontal line. If y₁ = y₂ the rise is 0, so the slope is 0 and the equation is y = y₁. Vertical line. If x₁ = x₂ the run is 0, and dividing by zero is not allowed, so the slope is undefined and the equation is x = x₁. A flat road has slope 0; a wall has an undefined slope. Identical points do not make a line, so the slope calculator asks for two different points.

Slope as percent grade, angle and ratio

Outside algebra class, slope is rarely written as a fraction. Roads use percent grade, maps and machines use degrees, and ramps use a ratio such as 1:12. All of them come from the same rise-over-run number:

  • Percent grade = slope × 100. A slope of 0.06 is a 6% grade.
  • Angle = arctan(slope). A slope of 1 is 45°, and a slope of 0.06 is about 3.43°.
  • Ratio 1 in N = 1 ÷ slope. A 6% grade is 1 in 16.67.
  • Roof pitch = slope × 12, written as x:12 (inches of rise per 12 inches of run).
Percent grade Slope (m) Angle Ratio Roof pitch
2% 0.02 1.15° 1 in 50 0.24:12
5% 0.05 2.86° 1 in 20 0.6:12
8.33% 0.0833 4.76° 1 in 12 1:12
10% 0.1 5.71° 1 in 10 1.2:12
20% 0.2 11.31° 1 in 5 2.4:12
50% 0.5 26.57° 1 in 2 6:12
100% 1 45° 1 in 1 12:12
Chart for the slope calculator converting percent grade to angle, with a 1:12 ramp and a 6:12 roof marked
Percent grade against angle: the curve flattens as the angle approaches 90 degrees.

A 100% grade is a 45° angle, not a vertical wall. Percent grade keeps growing past 100% as the line gets steeper, while the angle can never go beyond 90°. A vertical line has an infinite grade.

Slope calculator for roofs, ramps, roads and drains

Real projects use slope all the time. These examples use the Rise and run and Grade or angle tabs of the slope calculator. The numbers are exact results of the slope formula.

Job Numbers Slope Percent grade Angle
Wheelchair ramp (1:12 maximum for new ramps) 1 in 12 0.0833 8.33% 4.76°
Roof, 6:12 pitch 6 in of rise per 12 in 0.5 50% 26.57°
Driveway 2.5 ft rise over 20 ft 0.125 12.5% 7.13°
Road sign, 6% hill 316.8 ft of climb per mile 0.06 6% 3.43°
Drain line, 1/4 in per foot 0.25 in over 12 in 0.0208 2.08% 1.19°

Ramps. The U.S. ADA Standards say a ramp run must not be steeper than 1:12, with a rise of no more than 30 inches per run and a cross slope no steeper than 1:48. A 1:12 ramp climbs 1 inch for every 12 inches of run, so an 18 inch step needs at least 18 feet of ramp (rise 18, run 216 in the Rise and run tab gives 8.33%).

Roofs, roads and drains. Roof pitch is rise per 12 units of run, so 6:12 means a slope of 0.5. A 6% road grade sign means the road climbs 6 feet for every 100 feet traveled horizontally. A common rule of thumb for drain lines is 1/4 inch of fall per foot, a 2.08% slope; check your local plumbing code for the real requirement.

How do you find the slope of a line from two points?

To find the slope from two points, subtract the y values to get the rise, subtract the x values to get the run, then divide the rise by the run. For (2, 3) and (6, 11) the rise is 8, the run is 4, and the slope is 2. Use the slope calculator on this page to check any pair of points.

Slope calculator with fractions and decimals

The slope calculator accepts fractions typed as decimals and returns the exact fraction when it can. Points such as (0.5, 1.25) and (2.5, 4.75) give a slope of 3.5 ÷ 2 = 7/4 = 1.75 and the line y = 1.75x + 0.375.

Slope calculator for degrees to percentage

To change degrees to a percent grade, take the tangent of the angle and multiply by 100. For 30°, tan(30°) = 0.5774, so the grade is 57.74%. Going the other way, percent grade to degrees is arctan(grade ÷ 100). Use the Grade or angle tab to do both without a scientific calculator.

Common mistakes when finding a slope

  • Mixing the order. Subtract the points in the same order on top and bottom, or the sign flips.
  • Run over rise. The slope is rise ÷ run. A steep line must give a big number.
  • Sign errors with negatives. Subtracting a negative adds it: 5 − (−3) = 8.
  • Mixed units. Convert the rise and run to one unit first; the unit converter helps.
  • Percent versus degrees. A 45° line is a 100% grade, not 45%.

Frequently asked questions

10 quick answers

What is the slope formula?

The slope formula is m = (y₂ − y₁) ÷ (x₂ − x₁): the rise divided by the run between two points. Its sign shows whether the line rises or falls.

How do I calculate slope from two points?

Subtract the y values for the rise, subtract the x values for the run, and divide. For (1, 2) and (5, 8) the slope is 6 ÷ 4 = 1.5.

What does a slope of 0 mean?

A slope of 0 means the line is horizontal. The rise is 0 and the equation has the form y = k.

What does an undefined slope mean?

An undefined slope means the line is vertical. The run is 0, you cannot divide by 0, and the equation has the form x = k.

How do I turn slope into a percent or degrees?

Multiply the slope by 100 for a percent grade, and take the arctangent for degrees. A slope of 0.08 is an 8% grade, and a slope of 1 is 100% or 45°.

What is the slope of a 1:12 ramp?

A 1:12 ramp has a slope of 0.0833, an 8.33% grade or 4.76°. It is the steepest ramp run the U.S. ADA Standards allow for new construction.

What is the difference between slope, grade and pitch?

They all describe steepness. Slope is rise over run, grade is that number as a percent, and pitch is the roof term, written as rise per 12 units of run, such as 6:12.

How do I find the equation of a line from two points?

Find the slope m, then b = y₁ − m × x₁, and write y = mx + b. For (1, 2) and (5, 8) that is y = 1.5x + 0.5.

How do I find the distance and midpoint of two points?

Distance is √((x₂ − x₁)² + (y₂ − y₁)²) and the midpoint averages the coordinates. For (1, 2) and (5, 8) that is 2√13 ≈ 7.21 and (3, 5).

Can the slope calculator handle negative and decimal numbers?

Yes. Negative numbers and decimals both work, and the working shows each subtraction so you can check the signs.

Sources and further reading

Last updated: October 2026.