This slope calculator finds the slope, y-intercept, line equation, and point distance from two coordinate points.
Math
Slope Calculator
Compute slope, intercept, distance and line equation from two points.
Calculator
About this calculator
Formula notes
slope m = (y₂ − y₁) / (x₂ − x₁); line equation y = mx + b with b = y₁ − m·x₁; distance = √((x₂−x₁)² + (y₂−y₁)²).
Worked examples
- Example: points (0, 0) and (3, 6) give slope 2, equation y = 2x + 0, and distance ≈ 6.708.
- Points (-2, 5) and (4, -1) give slope (-1 - 5) / (4 - (-2)) = -1 and line equation y = -x + 3.
How to use it
- Enter the coordinates of the two points.
- Read the slope and the line equation.
- Check the distance for the segment length.
Frequently asked questions
What if the two x values are equal?
When two x values are equal, the line is vertical, so the slope cannot be computed; the equation reduces to x = constant.
What does a negative slope mean?
The line falls as x increases — each unit right moves the line down by the slope's magnitude.
Limits and interpretation
- If both x-coordinates are equal, the line is vertical and slope-intercept form is undefined.
- Slope depends on axis units and scale; a visual angle on a chart is not comparable until axes use compatible scaling.