Skip to main content

DigitalCalculators.net

Slope Calculator

Find the slope between two points, with the line equation, angle, distance and midpoint.

Results

ItemValue

Steps

StepWorking
Answers are rounded to 6 decimal places.

Quick Answer

Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). Between the points (1, 2) and (4, 8), the rise is 6 and the run is 3, so the slope is 2. The line equation is y = 2x + 0.

Last updated: 2 November 2026 ·How we calculate this: the two-point slope formula

Table of Contents

How This Slope Calculator Works

Slope measures how steep a line is. Enter two points, and the calculator finds the slope, the line equation in y = mx + b form, the angle, the distance between the points, and the midpoint.

Quick explanation: m = rise ÷ run.

  • Positive slope: the line rises from left to right.
  • Negative slope: the line falls from left to right.
  • Zero: a flat line. A vertical line has an undefined slope.

How to Use the Slope Calculator

  1. Enter the x and y values of the first point.
  2. Enter the x and y values of the second point.
  3. Press Calculate.
  4. Read the slope, the line equation, the angle, the distance and the midpoint.
  5. Check the steps table to follow the working.

Core Formulas

  • Slope: m = (y₂ − y₁) ÷ (x₂ − x₁)
  • Y-intercept: b = y₁ − m × x₁
  • Angle: arctan(m)
  • Distance: √((x₂ − x₁)² + (y₂ − y₁)²)
  • Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)

Key Terms

  • Slope (m): how steep a line is: the change in y divided by the change in x.
  • Rise: the vertical change between two points.
  • Run: the horizontal change between two points.
  • Y-intercept (b): the point where the line crosses the y-axis.
  • Slope-intercept form: a line written as y = mx + b.
  • Midpoint: the point exactly halfway between two points.
  • Parallel and perpendicular lines: parallel lines have equal slopes. Perpendicular slopes multiply to −1.

Worked Example

Find the slope between (0, 0) and (2, −1).

  • Rise = −1 − 0 = −1
  • Run = 2 − 0 = 2
  • Slope = −1 ÷ 2 = −0.5
  • Equation: y = −0.5x + 0

Real-Life Examples

  • Road grade: a road that climbs 30 m over 500 m has a slope of 0.06, a 6% grade, or an angle of about 3.43°.
  • Wheelchair ramp: US ADA guidance limits most ramps to a slope of 1:12. That is about 8.33%, or 4.76°.
  • Roof pitch: a 6/12 roof rises 6 in for every 12 in across, a slope of 0.5 or about 26.57°.
  • Rate of change: if a phone plan costs $40 for 2 GB and $55 for 5 GB, the slope is (55 − 40) ÷ (5 − 2) = $5 per GB.

Slope vs Grade vs Angle

  • Slope: rise ÷ run, as a number such as 0.25.
  • Grade: slope × 100, as a percentage such as 25%. Used for roads and paths.
  • Angle: arctan(slope), in degrees, such as 14.04°.
  • Pitch: rise per 12 units of run, such as 3/12. Used for roofs in the US.

Slope, Grade, Angle and Pitch

SlopeGradeAngleRoof pitch
0.055.00%2.86°0.6/12
0.08338.33%4.76°1/12
0.110.00%5.71°1.2/12
0.2525.00%14.04°3/12
0.550.00%26.57°6/12
0.7575.00%36.87°9/12
1100.00%45.00°12/12
2200.00%63.43°24/12

Common Mistakes

  • Mixing the order: subtract x and y in the same point order.
  • Dropping a negative: take care when subtracting a negative number.
  • Dividing by zero: if both x values match, the line is vertical.
  • Swapping rise and run: slope is change in y over change in x, not the other way round.
  • Confusing slope with angle: a slope of 1 is 45°, but a slope of 2 is not 90°.

Frequently Asked Questions

Multiply the slope by 100. A slope of 0.06 is a 6% grade.

It rises 6 units for every 12 across, so the slope is 0.5 and the angle is about 26.57°.

It is 0, because the y value stays the same as x changes.

It is the negative reciprocal. If one line has a slope of 2, a line at right angles to it has a slope of −1/2.

Yes. A slope of 2/3 means the line rises 2 units for every 3 units across. It is the same as about 0.667.

Rearrange it into y = mx + b. The number in front of x is the slope.

Subtract the y values, subtract the x values in the same order, then divide: m = (y₂ − y₁) ÷ (x₂ − x₁).

It means the line is flat, because y does not change.

It is the slope of a vertical line. The run is 0, and you cannot divide by 0.

It is the slope-intercept form of a line. m is the slope, and b is where the line crosses the y-axis.

Take the arctangent of the slope. A slope of 1 is an angle of 45°.

References & Sources

SourceUsed ForLink
Wikipedia, Slope Definition and formula for slope. https://en.wikipedia.org/wiki/Slope
Wikipedia, Linear equation Slope-intercept form. https://en.wikipedia.org/wiki/Linear_equation