Skip to content
Back to Math Tools

Slope Calculator (m = Rise / Run & y = mx + b)

Solve for line slope m from any two points (x1, y1) and (x2, y2) or rise-over-run inputs. Instantly get the exact reduced fraction slope, slope-intercept (y = mx + b) and point-slope equations, segment distance, midpoint, incline angle, and engineering percent grade.

Line Slope, Point-Slope & Rise-Over-Run Solver

Compute exact fraction slope, y = mx + b equation, angle, distance, midpoint, and grade percentage

Enter coordinates (x1, y1) and (x2, y2) or rise/run values above to calculate slope, equation of a line, angle, and distance.

Click Load Sample to solve (2, 3) to (8, 15) and check a 1:12 ADA ramp slope.

Slope Formulas, Line Forms & Worked Examples

Slope quantifies rate of change across coordinate geometry, calculus secant lines, roof framing, road civil engineering, and wheelchair ramp design. Because rise equals vertical displacement (Delta y = y2 - y1) and run equals horizontal displacement (Delta x = x2 - x1), keeping consistent point order prevents inverted signs.

How to Find Slope Step by Step

  1. Select Two Points or Rise Over Run Mode: Choose Two Points mode for coordinate geometry, or switch to Rise Over Run mode for construction grades, drainage pipes, and wheelchair ramps.
  2. Enter Coordinates (x1, y1) and (x2, y2): Type your starting and ending coordinate values (integers, negatives, or decimals), or click Load Sample to test (2, 3) to (8, 15).
  3. Review Exact Fraction Slope & Line Equations: Inspect reduced fraction slope, decimal slope, point-slope form, y = mx + b slope-intercept form, and both axis intercepts.
  4. Verify Angle, Distance, Grade % & Visualization: Check the dynamic SVG rise-over-run triangle alongside segment distance, midpoint, perpendicular slope, and ADA 1:12 grade status.

Worked Example 1: Two Points (2, 3) & (8, 15)

Subtract coordinates: Rise = 15 - 3 = 12; Run = 8 - 2 = 6. Divide Rise by Run to get slope m = 12 / 6 = 2. Find y-intercept b = 3 - 2(2) = -1, giving slope-intercept form y = 2x - 1, segment distance 13.4164, midpoint (5, 9), and perpendicular slope -1/2.

Worked Example 2: Construction & ADA Ramp Grade

A patio doorway sits 18 inches above the driveway. At the ADA maximum slope of 1:12 (8.33% grade), horizontal run must be at least 18 x 12 = 216 inches (18 feet). Entering Rise = 18 and Run = 216 yields slope 1/12 (0.0833), 4.76 degree angle, and 8.33% grade.

Slope Application / Line TypeSlope (m / Ratio)Grade %Incline Angle
Flat Horizontal Linem = 00.00%0.00 deg
Landscape Drainage Swale (Min Pipe)1/4 in per ft (~1:48)2.08%1.19 deg
ADA Maximum Wheelchair Ramp1:12 (0.0833)8.33%4.76 deg
Standard 4:12 Residential Roof Pitch4/12 = 1/3 (0.3333)33.33%18.43 deg
45-Degree Diagonal (y = x)m = 1 (1:1)100.00%45.00 deg

Accuracy, Edge Cases & Common Algebra Mistakes

  • Swapping Numerator and Denominator (Run over Rise): Always put vertical Y changes in the numerator and horizontal X changes in the denominator. Swapping (x2 - x1) on top inverts the true slope from 2 to 1/2.
  • Reversing Point Order Halfway Through Subtraction: If you subtract y2 - y1 on top, you must subtract x2 - x1 in the exact same order on bottom. Computing (y2 - y1) / (x1 - x2) flips the slope sign from positive to negative.
  • Mixing Units in Construction Grades: For Rise Over Run ramps or drain pipes, convert feet to inches (or meters to centimeters) before entering values so both Rise and Run share identical units.

Coordinate geometry logic reviewed by the NepaCalc Math & Engineering Team under our Editorial & Verification Policy.

Frequently Asked Questions

What is the slope formula for two points?

The slope m between two coordinates (x1, y1) and (x2, y2) is m = (y2 - y1) / (x2 - x1), often taught as Rise over Run (Delta y / Delta x). A positive slope rises left-to-right, a negative slope falls left-to-right, zero slope is horizontal, and division by zero gives an undefined vertical line.

How do you convert two points into slope-intercept form (y = mx + b)?

First solve for slope m = (y2 - y1) / (x2 - x1). Next substitute m and either coordinate pair into y = mx + b to solve for the y-intercept b = y1 - m * x1. Finally write the line equation as y = mx + b.

How do you calculate slope percentage and ramp grade?

Slope percentage (or grade %) equals |Rise / Run| x 100. For example, a wheelchair ramp rising 12 inches over a 144-inch horizontal run has slope 12 / 144 = 1/12 = 0.0833, which equals 8.33% grade (matching the maximum ADA 1:12 accessibility ramp standard).

What is the difference between zero slope and undefined slope?

A horizontal line (such as y = 5, between (2, 5) and (9, 5)) has zero vertical rise (0 / 7 = 0), so its slope equals 0. A vertical line (such as x = 4, between (4, 1) and (4, 8)) has zero horizontal run (7 / 0), which is mathematically undefined.

How do parallel and perpendicular slopes relate to line slope m?

Parallel lines always share the exact same slope (m2 = m1) and different y-intercepts. Perpendicular lines intersect at 90 degrees and have negative reciprocal slopes (m2 = -1 / m1), provided neither line is vertical.