Slope Calculator

Calculate the slope of a line instantly with step-by-step solutions. Choose from three input modes:

  • From two points — Enter (x₁, y₁) and (x₂, y₂) to find the slope
  • Slope-intercept form — Identify the slope from y = mx + b
  • Standard form — Convert ax + by = c to find the slope

Find slope given (x₁, y₁) and (x₂, y₂)

Point 1

Point 2

Formulas Used

Slope from two points

Slope-intercept form

Standard form to slope

How to Use This Calculator

  1. Select a mode using the buttons at the top
  2. Enter your values in the input fields
  3. See the slope immediately with a full step-by-step breakdown

Every calculation shows exactly how the answer was derived, so you can learn the method while getting your answer.

What Is Slope?

Slope measures the steepness and direction of a line. It’s often described as “rise over run” — how much the line goes up (or down) for every unit it moves to the right. A positive slope means the line goes uphill from left to right, a negative slope means it goes downhill, a zero slope is a flat horizontal line, and an undefined slope is a perfectly vertical line.

When You’ll Need Slope

Slope shows up in many practical and professional situations:

  • Carpentry and roofing — Roof pitch is expressed as slope (e.g., a 6/12 pitch rises 6 inches for every 12 inches of run). Getting the pitch right affects drainage, material choices, and building code compliance.
  • Road and highway design — Road grade is slope expressed as a percentage. A 6% grade means the road rises 6 feet for every 100 feet of horizontal distance. Steep grades affect braking distance and engine strain.
  • ADA ramp compliance — The Americans with Disabilities Act requires wheelchair ramps to have a maximum slope of 1:12 (1 inch of rise per 12 inches of run). Calculating slope correctly is essential for accessibility.
  • Landscaping and drainage — Proper grading around a building requires a slope of at least 1/4 inch per foot away from the foundation to direct water away from the structure.
  • Plumbing — Drain pipes need a specific slope (typically 1/4 inch per foot) to ensure proper flow by gravity without allowing solids to settle.

Special Cases

Vertical lines have an undefined slope because the run (horizontal change) is zero, and division by zero is undefined. A vertical line passes through points where all x-values are the same.

Horizontal lines have a slope of zero because the rise (vertical change) is zero. A horizontal line passes through points where all y-values are the same.

Want to understand the math behind slope calculations? Read our Slope with Two Points tutorial for a complete explanation with worked examples and practice problems.