What the slope calculator does
Enter two points, (x₁, y₁) and (x₂, y₂), and the calculator gives the slope of the line through them, the y-intercept, the equation in y = mx + b form, and the straight-line distance between the points. It is the calculation behind gradients on a graph, rates of change in data, and physical slopes — ramps, roofs, drains, roads — where slope is expressed as a ratio, a percentage or an angle. Runs in your browser.
The formulas
Slope m = (y₂ − y₁) / (x₂ − x₁) rise over run
Intercept b = y₁ − m·x₁
Equation y = m·x + b
Distance d = √( (x₂ − x₁)² + (y₂ − y₁)² )
Points (2, 3) and (6, 11):
m = (11 − 3) / (6 − 2) = 8 / 4 = 2
b = 3 − 2 × 2 = −1
y = 2x − 1
d = √(16 + 64) = 8.94Reading the slope
| Slope | Meaning |
|---|---|
| Positive | Line rises left to right; y increases as x increases |
| Negative | Line falls left to right |
| 0 | Horizontal line; y is constant |
| Undefined (x₁ = x₂) | Vertical line; the calculator reports it rather than dividing by zero |
| |m| > 1 | Steeper than 45° |
| |m| < 1 | Flatter than 45° |
| Two lines with equal slopes | Parallel |
| Slopes whose product is −1 | Perpendicular |
Slope as percentage and angle
Percent grade = m × 100 slope 0.08 = 8% grade
Angle = arctan(m) slope 0.08 = 4.6°; slope 1 = 45°
Ratio = 1 : (1 / m) slope 0.08 = 1 : 12.5| Application | Typical slope | As grade / angle |
|---|---|---|
| Wheelchair ramp (ADA max) | 1:12 | 8.3% / 4.8° |
| Drainage pipe minimum | 1:40 to 1:80 | 1.25–2.5% |
| Road, steep hill sign | ≥ 1:10 | 10% / 5.7° |
| Driveway comfortable max | 1:8 | 12.5% / 7.1° |
| Roof, low pitch | 2:12 | 16.7% / 9.5° |
| Roof, standard pitch | 6:12 | 50% / 26.6° |
| Stairs (typical) | 7:11 | 64% / 32.5° |
Slope as rate of change
On a graph of anything against time, the slope is the rate: distance vs time gives speed, cost vs units gives marginal cost, temperature vs time gives the heating rate. Two readings are enough for an average rate over the interval, which is exactly what this calculator computes. Fitting a slope through many noisy points is linear regression — a spreadsheet's SLOPE() function — and is the natural next step when you have more than two.
Common uses
- Finding the equation of a line from two points on a graph for homework or a report.
- Working out the fall on a drain or gutter run from two level readings.
- Checking a ramp or path meets accessibility limits.
- Converting a roof pitch between ratio, percent and degrees.
- Estimating a trend — growth per month from two data points.
- Getting the distance between two coordinates on a plan.