Slope Calculator
Find the slope, y-intercept and equation of a line from two points, with the rise-over-run working shown.
Formula: slope m = (y₂ − y₁) ÷ (x₂ − x₁). The line equation is y = mx + b, where b = y₁ − m×x₁.
How to use the slope calculator
- Enter the two points (x₁, y₁) and (x₂, y₂).
- Press “Calculate slope”.
- Read the slope, the y-intercept and the equation of the line.
Slope calculation example
Through (1, 2) and (4, 8): slope m = (8 − 2) ÷ (4 − 1) = 2. The line is y = 2x, the distance between the points is √(3² + 6²) ≈ 6.71 and the midpoint is (2.5, 5).
Tips for using the slope calculator
- A slope of 2 means y rises 2 for every 1 along x.
- Horizontal lines have slope 0; vertical lines have an undefined slope.
- Parallel lines share a slope; perpendicular slopes multiply to −1.
Slope calculator: common questions
- What does the slope tell me?
- How steep the line is: rise over run. A positive slope rises left to right, a negative slope falls, zero is horizontal, and a vertical line has no defined slope.
- What is the y-intercept?
- Where the line crosses the y-axis (x = 0). It is the b in y = mx + b, worked out as b = y₁ − m×x₁.
- What if both points have the same x?
- The line is vertical (x = constant) and the slope is undefined, because the run (x₂ − x₁) is zero and division by zero is not allowed.
- Is my input stored?
- No. The calculation runs in your browser.
- How is slope used for roads and ramps?
- As a gradient: a rise of 1 m over 12 m is a slope of 1/12 ≈ 8.3%, a common maximum for wheelchair ramps.