Slope Intercept Form Calculator: Equation, Intercepts, and Graph
Every straight line comes down to two numbers: its slope and its y-intercept. Give this slope intercept form calculator two points, a point and a slope, or a standard-form equation, and it pulls both out and writes the line as y = mx + b. You get the full equation, both intercepts, a graph, and each step behind the answer.
How to use the slope intercept form calculator
Pick the tab that matches what you already have, type your numbers in, and press Calculate. Nothing needs rearranging first. The calculator reads your input and does the rest.
- Choose a tab: Two Points, Point & Slope, Slope Intercept, or Standard Form (Ax + By = C).
- Enter your values in the fields for that tab. Fractions, decimals, negatives, and vertical lines all work.
- Click Calculate. The slope intercept form calculator returns the slope (m), the y-intercept (b), both the x- and y-intercepts, the equation written three ways, a plot of the line, and every step.
- Click Reset to clear the fields and start a new problem.
If you just want to see how it works, tap one of the “Try one” samples above the buttons. It fills in real values so you can watch the full answer appear. Most problems solve in a few seconds.
What is slope intercept form?
Slope intercept form is the most common way to write the equation of a straight line. It looks like this: y = mx + b.
The form is popular because it shows two things about the line right away: its slope (m) and its y-intercept (b). It only works for straight lines, so you won’t see squared terms or powers in it, just x and y. For example, y = 3x + 2 is a line with a slope of 3 and a y-intercept of 2.
Every straight line on a graph describes how the up-and-down position (y) is tied to the left-and-right position (x). It captures that link in one short equation. Once you know m and b, you can draw the line, find any point on it, or compare it to other lines. That’s why it shows up so often in algebra, graphing, and word problems.

What the slope (m) tells you
The slope is how steep the line is. It measures how much y goes up or down each time x moves one step to the right, often called “rise over run.” A positive slope means the line goes up from left to right, and a negative slope means it goes down. A slope of 3, for example, means y rises by 3 every time x increases by 1. The bigger the number, the steeper the line. Slope is also called the gradient.
What the y-intercept (b) tells you
The y-intercept is where the line crosses the y-axis. It’s the value of y when x is 0, written as the point (0, b). You can think of it as the line’s starting point, before the slope tilts it. In y = 3x + 2, the y-intercept is 2, so the line crosses the y-axis at (0, 2). Change b and the whole line shifts up or down without changing its steepness.
Slope intercept formula and its derivation
The formula is y = mx + b, where m is the slope and b is the y-intercept (both explained in the section above). One thing worth knowing: in the UK and some other countries it’s written y = mx + c, with c standing in for b. The letter changes, the math doesn’t.
Where the formula comes from
You can build it from any two points on the line, (x₁, y₁) and (x₂, y₂). Both points fit y = mx + b, so you can write two equations:
y₁ = m·x₁ + b
y₂ = m·x₂ + b
Subtract the first from the second, and b cancels out:
y₂ − y₁ = m(x₂ − x₁)
Divide by (x₂ − x₁) to get the slope:
m = (y₂ − y₁) / (x₂ − x₁)
Then put m back into either equation to find b:
b = y₁ − m·x₁
Drop both into y = mx + b and you’ve got the line’s equation.
How to find the slope intercept form (equation of a line)
What you do depends on what you start with. There are three common cases: you have two points, you have one point and the slope, or you already have the slope and the y-intercept. The last case is instant, substitute both values into y = mx + b. A slope of 4 and a y-intercept of 6, for example, give y = 4x + 6.
Find the slope between two points
When you only have two points, find the slope first. Apply the slope formula from above: m = (y₂ − y₁) / (x₂ − x₁). For the points (3, −4) and (6, 8), that is m = (8 − (−4)) / (6 − 3) = 12 / 3 = 4.
Solve for the y-intercept (b)
With the slope known, substitute it and either point into y = mx + b, then solve for b. Using (3, −4) and m = 4: −4 = 4(3) + b, which gives b = −16. The finished equation is y = 4x − 16. If you started with the slope and a point, begin here and skip the slope step.
Special cases: zero and undefined slope
A horizontal line has a slope of 0, so the term mx drops out and the equation is simply y = b. A vertical line is different: both points share the same x-coordinate, so the denominator (x₂ − x₁) equals 0 and the slope is undefined. For that reason a vertical line cannot be written in this form and is expressed as x = a constant instead, such as x = 3.

How to find the x-intercept and y-intercept
The y-intercept is the b in y = mx + b, the point (0, b) where the line crosses the y-axis, as covered above. The x-intercept is its counterpart on the x-axis: the value of x where the line crosses it, which is the point where y = 0.
To find it, set y to 0 and solve for x:
0 = mx + b
x = −b / m
So the x-intercept is the point (−b/m, 0). Taking our earlier line y = 4x − 16, that gives x = −(−16) / 4 = 4, so the line crosses the x-axis at (4, 0). This works for any line with a nonzero slope.
The exception is a horizontal line, where m = 0. Dividing by 0 is undefined, so a horizontal line has no x-intercept unless it lies right on the x-axis. The calculator reports both intercepts automatically, so you can read them off without solving by hand.
How to convert standard form to slope intercept form
Standard form writes a line as Ax + By = C, where A, B, and C are constants. To reach y = mx + b, isolate y on one side. The steps are the same every time.
Start by moving the Ax term to the right: By = −Ax + C. Then divide every term by B: y = −(A/B)x + C/B.
That is the form, with slope m = −A/B and y-intercept b = C/B. Take 3x + 4y = 12: subtract 3x to get 4y = −3x + 12, then divide by 4 to get y = −(3/4)x + 3. So the slope is −3/4 and the y-intercept is 3.
One condition: B cannot be 0, because dividing by 0 is undefined. If B = 0 the line is vertical (x = a constant) and cannot be written this way. On the calculator, choose the Standard Form tab and it does the rearranging for you.
Point slope form vs slope intercept form
Point slope form is another way to write a line, used when you know one point and the slope: y − y₁ = m(x − x₁), where (x₁, y₁) is the point and m is the slope. The y = mx + b form centers on the y-intercept, which makes it better for graphing. Point slope form centers on any point, so it is useful before you have found b. To convert, expand and solve for y: from (3, −4) with slope 4, y + 4 = 4(x − 3) gives y = 4x − 16.
How to graph a line from y = mx + b
Once a line is in this form, you can graph it in two moves: plot the y-intercept, then use the slope to step to a second point.
- Plot the y-intercept (0, b) on the y-axis. For y = 3x + 2, that is (0, 2).
- Read the slope as rise over run. A slope of 3 means 3/1, so go up 3 and right 1 to reach a second point at (1, 5).
- Draw a straight line through both points and extend it in both directions.
For a negative slope, step down for the rise instead of up. The calculator plots the line automatically, so you can check your graph against it.
Examples of y = mx + b
The best way to get comfortable with y = mx + b is to work it through from each starting point. Here are three worked examples, one for each common case.
Example 1: From two points, (1, 5) and (3, 1).
First find the slope: m = (1 − 5) / (3 − 1) = −4 / 2 = −2. Next substitute one point to find b: 5 = −2(1) + b, so b = 7. The equation is y = −2x + 7. The slope is negative, which tells you the line falls as it moves from left to right.
Example 2: From one point and a slope, point (4, 3) with slope 1/2.
The slope is already known, so go straight to b. Substitute the point into y = mx + b: 3 = (1/2)(4) + b, which gives b = 1. The equation is y = (1/2)x + 1. A fractional slope works the same way, it just means y rises half a unit for every full unit of x.
Example 3: From a slope and y-intercept, slope 6 and y-intercept −2.
This is the fastest case, since both values are already in hand. Drop them straight into the formula: y = 6x − 2. No slope calculation or solving for b is needed.
You can check any of these by entering the same values into the calculator above, which returns the equation, both intercepts, and the graph.
Real-world uses of slope and intercepts
The form earns its keep because it links an equation to a straight line, so it fits any situation where one quantity changes at a steady rate against another.
A clear example comes from motion. Put time on the x-axis and distance on the y-axis for an object moving at a steady speed. The slope is the speed, the y-intercept (b) is the starting distance at time zero, and the x-intercept is the moment the distance reaches zero. Read together, the two intercepts tell you where the motion began and when it reached the reference point.
The same pattern appears well beyond physics:
- Budgeting: a starting balance plus a fixed weekly cost or saving fits y = mx + b, where b is the opening amount and m is the weekly change.
- Engineering and science: many formulas assume a linear relationship, so the form is a fast way to model and read them.
- Graphing: it turns any linear equation into a picture you can read at a glance.

Common mistakes to avoid
A few small slips trip up most people with y = mx + b. Watch for these:
- Swapping m and b. The number multiplied by x is the slope; the number on its own is the y-intercept. In y = 5x + 2, the slope is 5, not 2.
- Sign errors on a negative slope. A downward line needs a minus sign, so y = −3x + 1, not y = 3x + 1.
- Flipping rise over run. Slope is rise over run (change in y over change in x), not the other way around.
- Subtracting points in a different order. Keep x and y in the same order in m = (y₂ − y₁)/(x₂ − x₁). Reversing one but not the other flips the sign.
- Forcing a vertical line into this form. A vertical line has an undefined slope and is written as x = a constant, never as y = mx + b.
- Misreading a fractional slope. A slope of 1/2 means y rises 1 for every 2 steps in x, not 2 for every 1.
Frequently asked questions
Is slope intercept form the same as standard form?
No. Slope intercept form is y = mx + b, built around the slope and y-intercept. Standard form is Ax + By = C, with integer coefficients. They describe the same line in different layouts, and you can convert between them using the steps in the conversion section above.
How are m and b found from two points?
For points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁), and the y-intercept is b = y₁ − m·x₁. Substitute both into y = mx + b to get the equation.
What does an undefined slope mean?
It means the line is vertical. When x₁ = x₂, the slope formula divides by zero, which is undefined, so the line is written as x = a constant instead of y = mx + b.
What is the slope of a line at a 45 degree angle?
The slope is 1. Slope equals tan(α), where α is the angle the line makes with the x-axis, and tan(45°) = 1.
Does the calculator work with fractions or decimals?
Yes. You can enter fractions or decimals, and the result stays exact, so the values do not have to be whole numbers.
Can I use it for parallel or perpendicular lines?
Yes, with one extra step. Parallel lines share the same slope, and perpendicular lines have slopes that are negative reciprocals, so if one slope is m, the other is −1/m. Find the slope, adjust it by that rule, then enter the new values.
Is the calculator free to use?
Yes. It is free, with no sign-up or account needed.
Reviewed for accuracy by Ghulam Abbas, qualified surveyor (MIGC).