ALGEBRA & COORDINATE GEOMETRY
Slope Intercept Calculator
Find the slope and y-intercept of the line through two points, then write the equation in y = mx + b form.
How slope-intercept form works
A non-vertical straight line can be written as y = mx + b, where m is the slope and b is the y-intercept.
For two points (x₁,y₁) and (x₂,y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁). Once m is known, the intercept is b = y₁ − mx₁.
Worked example
For (1,2) and (4,8), the slope is (8 − 2)/(4 − 1) = 6/3 = 2. Substituting (1,2) gives b = 2 − 2(1) = 0, so the equation is y = 2x.
Vertical lines need special handling
If x₁ = x₂, the denominator in the slope formula is zero. The line is vertical and has equation x = x₁; it does not have a finite slope or a slope-intercept form y = mx + b. The calculator reports this case instead of dividing by zero.
How to use it
- Enter the x- and y-coordinates of the first point.
- Enter the coordinates of the second point.
- Use two distinct points and calculate.
- Check the resulting equation against both points.
Common mistakes
- Keep the point order consistent in both numerator and denominator.
- Do not divide by zero when the two x-values are equal.
- Do not confuse the y-intercept with the y-coordinate of the first point.
FAQ
Can two identical points define a unique line?
No. Infinitely many lines pass through one point, so two identical coordinate pairs do not determine a unique line.
What does a negative slope mean?
A negative slope means y decreases as x increases along the line.
What is the y-intercept?
It is the value of y where the line crosses the y-axis, corresponding to x = 0.
Interpreting slope and intercept
The slope describes the change in y for each one-unit increase in x. A slope of 2 means y rises by two units whenever x increases by one; a slope of −0.5 means y falls by half a unit. The units of slope are y-units per x-unit, which matters when coordinates represent physical measurements rather than abstract numbers.
The y-intercept is where the line meets the vertical axis, so its coordinate is (0, b). If zero is outside the meaningful range of your data, the intercept may be mathematically valid but not useful for interpreting the real-world situation. A line fitted to measured data is also different from a line calculated exactly through two points: measurement noise may require regression instead.
Related math tools
Triangle Calculator · Average Calculator · Math Calculator Hub