Free slope calculator
Find the slope between two points and the equation of the line — enter (x₁, y₁) and (x₂, y₂) to see slope, y-intercept, and line equation, updated live, as you type.
On this page10 sections
m = (y₂−y₁)/(x₂−x₁). Vertical line (x₁=x₂) is undefined.
Results are estimates. Consult a professional.
How the slope calculator works
Slope measures the steepness and direction of a straight line. Given any two points on the line, slope is the ratio of the vertical change (rise) to the horizontal change (run). Once the slope is known, the full line equation can be written in slope-intercept form or point-slope form.
Worked example: points (1, 2) and (4, 8)
Given two points (1, 2) and (4, 8), calculate the slope, then write the line equation using the slope-intercept form.
Slope types and their interpretations
The sign and magnitude of slope convey direction and steepness at a glance.
| Slope (m) | Direction | Real-world analogy |
|---|---|---|
| m > 0 | Rises left to right (positive) | Walking uphill |
| m < 0 | Falls left to right (negative) | Walking downhill |
| m = 0 | Horizontal (flat) | Walking on level ground |
| m undefined | Vertical (infinite steepness) | A cliff face — x₁ = x₂ |
| |m| > 1 | Steeper than 45° | Steep ramp |
| |m| < 1 | Shallower than 45° | Gentle incline |
Undefined slope occurs when the two x-coordinates are identical (vertical line).
Tips for working with slope
These tips cover the errors most commonly made when computing or interpreting slope.
- Keep the order consistent — always subtract the coordinates in the same order: (y₂−y₁)/(x₂−x₁). Reversing both numerator and denominator gives the same result; reversing only one flips the sign.
- Check for vertical lines early — if x₁ = x₂ the slope is undefined (division by zero); the line is vertical and cannot be written in slope-intercept form.
- Convert to slope-intercept for graphing — y = mx+b makes it easy to plot: start at (0, b) and move right 1 unit and up m units for each subsequent point.
- Parallel lines share the same slope — two lines are parallel if m₁ = m₂ and perpendicular if m₁ × m₂ = −1.
- Use slope in real contexts — a road with slope 0.06 rises 6 cm per 100 cm of horizontal distance, which is a 6% grade.
Accuracy and limitations
Slope calculations are exact for integer or simple fractional inputs. For decimal coordinates, results carry standard floating-point precision (≈15 significant digits). The slope formula applies only to straight lines; curved functions have a slope that varies at every point and requires calculus (the derivative) to compute. When both points are identical, neither slope nor a unique line is defined.
Key terms
About this calculator
Part of our math calculators suite — explore all calculators.