Slope Calculator — Find Slope, Distance, and Equation from Two Points
Calculate slope (gradient) between two points, find the equation of a line, and understand rise over run. Covers positive, negative, zero, and undefined slopes.
Slope measures how steep a line is — it's one of the most fundamental concepts in algebra and appears in everything from road grades to stock charts to physics. The CalcHub Slope Calculator computes slope, distance, midpoint, and line equation from any two points.
The Slope Formula
m = (y₂ − y₁) / (x₂ − x₁)Where m = slope, (x₁, y₁) and (x₂, y₂) are two points on the line.
Also written as: m = rise / run = Δy / ΔxQuick Examples
| Point 1 | Point 2 | Rise (Δy) | Run (Δx) | Slope (m) |
|---|---|---|---|---|
| (1, 2) | (3, 6) | 4 | 2 | 2 |
| (0, 0) | (4, 4) | 4 | 4 | 1 |
| (2, 5) | (6, 3) | −2 | 4 | −0.5 |
| (1, 3) | (5, 3) | 0 | 4 | 0 (horizontal) |
| (3, 1) | (3, 7) | 6 | 0 | undefined (vertical) |
| (−2, −3) | (4, 9) | 12 | 6 | 2 |
Types of Slope
| Slope Value | Direction | Line Looks Like |
|---|---|---|
| Positive (m > 0) | Rises left to right | / |
| Negative (m < 0) | Falls left to right | \ |
| Zero (m = 0) | Horizontal | — |
| Undefined (Δx = 0) | Vertical | \ |
| m = 1 | 45° angle upward | / at 45° |
| m = −1 | 45° angle downward | \ at 45° |
Finding the Line Equation
Once you have the slope, use point-slope form:
y − y₁ = m(x − x₁)Or convert to slope-intercept form:
y = mx + bWhere b = y-intercept (where the line crosses the y-axis).
Example: Points (2, 3) and (4, 7)- Slope: m = (7−3)/(4−2) = 4/2 = 2
- Using point (2, 3): y − 3 = 2(x − 2) → y = 2x − 1
- Equation: y = 2x − 1 (slope = 2, y-intercept = −1)
Slope in Real Life
Road Grades
Road grade is slope expressed as a percentage:| Grade | Slope | What It Means |
|---|---|---|
| 5% | 0.05 | Gentle hill (most highway ramps) |
| 10% | 0.10 | Steep road (warning signs posted) |
| 15% | 0.15 | Very steep (mountain roads) |
| 25% | 0.25 | Extremely steep (San Francisco hills) |
| 100% | 1.0 | 45° angle (not drivable) |
Roof Pitch
Roof pitch is expressed as rise:12 (rise per 12 inches of run):| Pitch | Slope | Angle | Description |
|---|---|---|---|
| 2:12 | 0.167 | 9.5° | Nearly flat |
| 4:12 | 0.333 | 18.4° | Low slope |
| 6:12 | 0.500 | 26.6° | Standard residential |
| 8:12 | 0.667 | 33.7° | Steep |
| 12:12 | 1.000 | 45.0° | Very steep |
Wheelchair Ramps (ADA)
Maximum slope: 1:12 (8.33% grade or 4.76° angle). For every 1 inch of rise, you need 12 inches of ramp length. A 30-inch rise needs a minimum 30-foot ramp.Related Calculations
Distance Between Two Points
d = √((x₂−x₁)² + (y₂−y₁)²)Midpoint
M = ((x₁+x₂)/2, (y₁+y₂)/2)Parallel and Perpendicular Lines
- Parallel lines have equal slopes (m₁ = m₂)
- Perpendicular lines have negative reciprocal slopes (m₁ × m₂ = −1)
How to Use the Calculator
- Open the CalcHub Slope Calculator
- Enter Point 1 (x₁, y₁)
- Enter Point 2 (x₂, y₂)
- See: slope, distance, midpoint, angle, and line equation (both forms)
What does a slope of 0.5 mean?
For every 1 unit you move right (along x-axis), you move up 0.5 units (along y-axis). It's a gentle upward slope. In percentage terms, it's a 50% grade.
Can slope be a fraction or decimal?
Yes. Slope of 2/3 means "rise 2, run 3." It can also be written as 0.667. Fractions are often cleaner for exact work; decimals are easier to compare.
What's the slope of a circle?
A circle doesn't have a single slope — the slope changes at every point. At any given point on a circle, the slope equals the slope of the tangent line at that point, which involves calculus (derivatives).
Related Calculators
- Graphing Calculator — plot lines and curves
- Pythagorean Theorem Calculator — distance formula
- Quadratic Equation Solver — solve parabolas
- Area Calculator — geometric areas