Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Slope (m)
2
Y-Intercept (b) = 0
Equation y = 2x + 0
Rise (Δy) 4
Run (Δx) 2

What This Calculator Does

Given any two distinct points on a straight line, this calculator finds the slope (m) and the y-intercept (b), then assembles the full slope-intercept equation \(y = mx + b\). It works for positive, negative, fractional, and zero slopes, and detects vertical lines where the slope is undefined.

How to Use It

Enter the coordinates of your first point (x₁, y₁) and your second point (x₂, y₂). The calculator computes the change in y (rise) and the change in x (run), divides them to get the slope, then substitutes back to find where the line crosses the y-axis.

The Formula Explained

The slope measures steepness: $$m = \frac{y_2 - y_1}{x_2 - x_1}$$ Once you know m, the y-intercept follows from rearranging \(y = mx + b\) at the first point: $$b = y_1 - m \cdot x_1$$ If \(x_2 = x_1\) the run is zero, so the line is vertical and its slope is undefined (the equation becomes \(x = \text{constant}\)).

Line on a coordinate plane showing rise over run between two points and the y-intercept
Slope is the rise over the run between two points; b is where the line crosses the y-axis.

Worked Example

For points (1, 2) and (3, 6): rise = 6 − 2 = 4, run = 3 − 1 = 2, so $$m = \frac{4}{2} = 2$$ Then \(b = 2 - 2 \cdot 1 = 0\). The line is \(y = 2x\).

Worked example line plotted through two given points on a grid
Plotting the two example points and the resulting line.

FAQ

What if the two points are the same? A single point does not define a unique line — enter two different points.

Why is my slope undefined? When \(x_1\) equals \(x_2\) the line is vertical; vertical lines have no slope-intercept form.

What does a slope of 0 mean? A horizontal line; y stays constant and b equals that y value.

Last updated: