Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Slope-Intercept Equation
y = 3x - 1
y = mx + b
Slope (m) 3
Y-intercept (b) -1

What Is Slope-Intercept Form?

Slope-intercept form is the most common way to write the equation of a straight line: \(y = mx + b\), where \(m\) is the slope (how steep the line is) and \(b\) is the y-intercept (where the line crosses the vertical axis). This calculator takes any two points on the line and instantly returns m, b, and the full equation.

Line on a coordinate grid showing slope and y-intercept
The slope-intercept form \(y = mx + b\) shows the line's slope (m) and where it crosses the y-axis (b).

How to Use It

Enter the coordinates of two distinct points, \((x_1, y_1)\) and \((x_2, y_2)\). The calculator computes the slope and then the intercept. Make sure x₁ and x₂ are different — if they are equal the line is vertical and cannot be written in slope-intercept form.

The Formula Explained

The slope is the change in y divided by the change in x: \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\). Once you have m, substitute one point back into \(y = mx + b\) and solve for the intercept: \(b = y_1 - m \cdot x_1\).

$$y = m\,x + b$$$$\text{where}\quad \left\{ \begin{aligned} m &= \dfrac{y_2 - y_1}{x_2 - x_1} \\ b &= y_1 - m \cdot x_1 \end{aligned} \right.$$
Two points on a line with rise and run forming the slope formula
Slope m is the rise (change in y) divided by the run (change in x) between two points.

Worked Example

Take the points \((1, 2)\) and \((3, 8)\). Slope $$m = \frac{8 - 2}{3 - 1} = \frac{6}{2} = 3.$$ Intercept $$b = 2 - 3 \cdot 1 = -1.$$ So the equation is \(y = 3x - 1\).

FAQ

What if the two points are the same? You need two different points to define a unique line.

What does a slope of 0 mean? A horizontal line; the equation becomes \(y = b\).

Why can't a vertical line use this form? Its slope is undefined (division by zero), so it is written as \(x = \text{constant}\) instead.

Last updated: