Find the equation of a line in slope-intercept form, y = mx + b. Enter two points the line passes through, or switch to the second tab to build the equation from a slope and a single point. The calculator returns the slope, the y-intercept, the x-intercept, and the full equation.
The slope intercept form calculator finds the equation of a straight line in the most widely used format in algebra: y = mx + b. Give it two points that the line passes through — or a slope and a single point — and it works out the slope (m), the y-intercept (b), and the x-intercept, then assembles the full equation for you. Slope-intercept form is the version of a line's equation you will use most often when graphing, comparing lines, or reading off a rate of change, and this tool produces it in a single step with the working shown.
Whether you are a student checking algebra homework, a teacher preparing examples, or anyone who needs the equation of a line from a couple of measurements, this calculator removes the arithmetic and the risk of sign errors. It handles whole numbers, decimals, and negatives, and it recognizes the special cases — horizontal and vertical lines — that trip people up.
Slope-intercept form writes a line's equation as y = mx + b, where:
The reason this form is so popular is that it hands you the two most useful facts about a line directly. Look at y = 2x − 1 and you can see at a glance that the line rises 2 units for every 1 unit across and crosses the y-axis at −1. No rearranging is needed to graph it or to compare it with another line.
Starting from two points, (x₁, y₁) and (x₂, y₂), the calculator uses three short formulas:
m = (y₂ − y₁) / (x₂ − x₁)
b = y₁ − m × x₁
x-intercept = −b / m
First it finds the slope as the rise over the run between the two points. Then it finds the y-intercept by substituting one of the points and the slope back into y = mx + b and solving for b. Finally, setting y = 0 gives the x-intercept, the point where the line crosses the horizontal axis. If you already know the slope, the second tab skips straight to b = y₁ − m × x₁ using your single point.
Take the two points (1, 1) and (2, 3). The calculator works through it like this:
So the line through (1, 1) and (2, 3) is y = 2x − 1, with a slope of 2, a y-intercept at (0, −1), and an x-intercept at (0.5, 0). These are the default values loaded into the calculator, so you can press Calculate to see the result immediately, then change the numbers for your own line.
Values can be whole numbers, fractions entered as decimals, or negatives. Just be consistent, and remember that the two points you enter must be different from each other.
Slope-intercept form is one of three common ways to write a linear equation, and it is easy to convert to and from the others:
Because all three describe the same line, you can always convert between them — and slope-intercept form is usually the easiest to graph from, which is why it is the default choice for so many problems.
One of the biggest advantages of y = mx + b is how quickly you can graph it. Start by plotting the y-intercept: the point (0, b) sits right on the vertical axis. From there, use the slope as rise over run to find a second point — for a slope of 2, go up 2 and right 1; for a slope of −3/4, go down 3 and right 4. Mark that second point and draw a straight line through the two. Because the y-intercept gives you a guaranteed starting point and the slope gives you the direction, no table of values is required. This is why teachers introduce slope-intercept form early: it turns graphing a line into a two-step routine.
Two kinds of line behave differently and are worth understanding:
The three numbers this calculator reports each carry real meaning. The slope is a rate of change: in a real-world graph it might represent speed (miles per hour), cost per unit, or how fast something grows or shrinks. The y-intercept is a starting value: the amount you have when x is zero, such as a flat fee before any usage, or a starting balance. The x-intercept is a break-even or zero point: the x-value at which y reaches zero, like the time a savings balance runs out or the point a profit turns to loss. Reading a line in slope-intercept form is often the quickest way to understand the story a set of data is telling.
The slope tells you the direction and steepness of a line at a glance, and its sign is the first thing to check:
Two lines with the same slope are parallel, and two lines whose slopes multiply to −1 (for example 2 and −½) are perpendicular. These quick checks make slope-intercept form a powerful tool for comparing lines, not just describing a single one.
Slope-intercept form shines when you translate a real situation into an equation. Imagine a phone plan that charges a $30 monthly fee plus $0.10 per gigabyte of data. If x is the number of gigabytes and y is the monthly bill, the equation is y = 0.1x + 30. Here the y-intercept (30) is the fixed cost you pay even with zero usage, and the slope (0.1) is the rate — the extra cost per gigabyte. To find the bill for 50 GB, substitute x = 50: y = 0.1 × 50 + 30 = $35. If instead you knew two months' bills — say (20 GB, $32) and (60 GB, $36) — you could enter them as two points and this calculator would recover the same equation, revealing both the fixed fee and the per-gigabyte rate. That is the everyday power of y = mx + b: it turns a pair of observations into a formula you can use to predict any value.
A few more lines, each solved the way the calculator does it:
Enter any of these into the matching tab to confirm the result and see the intercepts. Working through a handful of examples is the quickest way to build confidence with the form.
It is the equation of a line written as y = mx + b, where m is the slope and b is the y-intercept (the point where the line crosses the y-axis). It is the most common form for graphing and comparing lines.
First find the slope, m = (y₂ − y₁) / (x₂ − x₁). Then find the y-intercept, b = y₁ − m × x₁. Put them together as y = mx + b. This calculator does both steps for you.
Substitute the slope and any point on the line into y = mx + b and solve for b: b = y − m × x. The y-intercept is the point (0, b).
Set y = 0 and solve for x. From y = mx + b, this gives x = −b / m. The x-intercept is the point where the line crosses the horizontal axis, (−b/m, 0).
No. A vertical line has an undefined slope because the change in x is zero, so it cannot fit y = mx + b. It is written as x = a constant instead.
A horizontal line has a slope of 0, so mx disappears and the equation is simply y = b, where b is the constant height of the line.
This Slope Intercept Form Calculator is provided for educational and general informational purposes. Results are rounded for display. Verify results independently for graded work or any application where exact values matter.