What is a slope-intercept form calculator?
A slope-intercept form calculator builds the equation of a straight line from two points that the line passes through. It returns the line written in slope-intercept form — the most common way to describe a line in algebra — together with the slope and the y-intercept on their own.
Two distinct points are enough to fix a line completely, so from them this calculator can recover both numbers that define the slope-intercept equation: how steep the line is and where it crosses the vertical axis.
Key concepts
- Point — an ordered pair that locates a position on the coordinate plane.
- Slope (m) — how steep the line is, the vertical change divided by the horizontal change between the two points.
- y-intercept (b) — the value of where the line crosses the vertical axis, i.e. where .
- Slope-intercept form — , the line written so that its slope and intercept can be read off directly.
How does the calculator work?
First find the slope from the two points and as rise over run:
Then use either point with the slope to recover the y-intercept by solving for :
Finally, the line is written in slope-intercept form:
Enter the coordinates of the two points and the calculator immediately returns , , and the full equation. If the two points lie on a vertical line, which has no defined slope and cannot be written as — the calculator leaves the results blank in that case.
Worked examples
Example 1: line through the origin
For the points and :
The equation is . A line through the origin has a y-intercept of .
Example 2: positive intercept
For the points and :
The equation is . The line crosses the vertical axis at .
Example 3: negative slope
For the points and :
The equation is . The line falls two units for every unit it moves to the right.
Example 4: horizontal line
For the points and :
The equation is , i.e. . Both points share the same , so the line is horizontal.
Practical uses
- Algebra and graphing — read off the slope and intercept directly to sketch the line by hand.
- Statistics — express a fitted regression line as , where the slope is the average change in per unit change in .
- Physics — turn two measured data points into a linear model, for example position against time at constant velocity.
- Geometry problems — once you have the slope from the slope calculator or a point from the midpoint calculator, this calculator gives the line’s full equation; for a single point and a known slope use the point-slope form calculator instead.
Notes
- The order of the two points does not matter: swapping and negates both the rise and the run, leaving the slope unchanged.
- A vertical line has no slope-intercept form. Its equation is simply , and the calculator leaves the results empty.
- A horizontal line has slope , so and the equation reduces to .
- The two points must be different. If both points are identical, infinitely many lines pass through them and the line is not determined.