Slope Intercept Form Calculator: y = mx + b From What You Have
Enter two points, a point and a slope, y = mx + b itself, or standard form Ax + By = C. You get m and b, both intercepts, the equation written three ways, a plot and every step.
How to use the slope intercept form calculator
Pick the tab that matches what is in front of you. Nothing needs rearranging first.
- Two Points. You have two coordinates the line passes through, and you want the equation that joins them.
- Point & Slope. You know how steep the line is and one point on it. The calculator finds b for you.
- Slope Intercept. You already have m and b, and you want the other forms, the intercepts and the plot that follow from them.
- Standard Form. You have Ax + By = C and want it converted, with the division and the sign change done for you.
Type your numbers and press Calculate. Fractions are read as fractions, so a slope typed as -3/4 is understood as negative three quarters, not as three separate characters. If you would rather see the tool run before typing anything, the Try one buttons above the Calculate button fill in a worked case with one press, including the vertical line case, the one that usually ends in an error message.
What you get back
One press returns everything the equation carries, not just m and b.
- The slope as a decimal, with the tidy fraction beside it when one exists. A book that says −3/4 and a screen that says −0.75 are agreeing with each other, and this panel shows both so you can see that.
- The angle in degrees, with radians one press away under More results.
- The percent grade and the ratio, for when the same line has to make sense off the graph paper.
- The y-intercept and the x-intercept as coordinates, not bare numbers, so there is no wondering which axis the figure belongs to.
- The equation of the line written three ways: slope intercept, point slope and standard form, worked out together so all three describe the same line. A plain sentence above them says what the numbers mean.
- A plot with your points marked and the rise and run drawn on, so a sign mistake shows up as a line leaning the wrong way.
- The working, step by step, in a panel you can open or ignore, and Copy, Download and Print buttons that take the whole answer with them.
How precise the numbers are
The slope is shown to six decimal places, everything else to four or five, and nothing is rounded before it is used again. The angle, the grade and the intercepts all come from the full value, not from the shortened number on screen.
The equations get one further guarantee. A slope that never ends as a decimal, like one third, is printed in the equation as the exact fraction: y = (1/3)x, never y = 0.3333x. Those are two different lines, and the difference between them grows with every step you move along the x-axis. Where the decimal terminates, you get the decimal you typed.
About units
Coordinates carry no units, so this calculator never asks for any. The one thing to keep straight is that both axes are in whatever scale your data uses: if x is months and y is dollars, then m is dollars per month and b is dollars. The numbers do not care, but your reading of them should.
Slope and y-intercept: what m and b actually do
Every line in slope intercept form is two instructions. b says where to start: the line crosses the y-axis at the point (0, b), because setting x to 0 wipes out the mx term and leaves y = b. m says how to move: every step of 1 to the right changes y by m. Up if m is positive, down if it is negative. That is the whole form. Everything the calculator prints is those two instructions followed to their conclusions.
Two housekeeping notes on the letters, because they change with the border and the subject. Some countries write the same equation as y = mx + c, and c there is exactly the b here. And statistics writes the fitted line as ŷ = a + bx, where b is the slope and a is the intercept, so the letter b swaps jobs the moment you open a stats textbook. Read the position in the equation, not the letter.
How to find slope intercept form with two points
Two points, two steps. Take (2, 3) and (6, 11).
- Find m. Divide the change in y by the change in x: m = (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2.
- Find b. Put m and either point into y = mx + b and solve: 3 = 2(2) + b, so b = −1.
The equation is y = 2x − 1. The word either in step two is not casual: both points sit on the same line, so both give the same b. Using (6, 11) instead gives 11 = 2(6) + b, and b is −1 again. If your two answers disagree, the line has not changed its mind. One of the substitutions has an arithmetic slip in it, and running the same points through the calculator shows you which number you should have landed on.
The same two steps write an equation in slope intercept form from any starting material. Given a point and a slope, step one is already done. Given a graph, read two clean grid crossings off it and you are back at step one. Given a table of values, any two rows are your two points.
Standard form to slope intercept form
Converting Ax + By = C means solving for y: subtract the x term, then divide everything by B. For 3x + 4y = 12, subtracting gives 4y = −3x + 12, and dividing by 4 gives y = −(3/4)x + 3. The slope is −3/4 and the y-intercept is 3. The Standard Form tab does exactly this, and the steps panel writes out both moves.
Two mistakes account for nearly every wrong conversion. The first is reading the constant as the intercept without dividing: in x + 2y = 10 the y-intercept is not 10, it is 10 ÷ 2 = 5. The number in the equation only becomes b after everything has been divided by B. The second is losing the minus sign when the x term crosses the equals sign: the 3x in 3x + 4y = 12 turns into −3x on the other side, and a slope reported as positive when the line clearly falls is the fingerprint that it did not.
The conversion also runs the other way. If you already have y = mx + b and need Ax + By = C, enter m and b on the Slope Intercept tab and read the standard form line from the equation panel, cleared of fractions and with the x term positive, the way a textbook prints it. And if your starting point is a point and a slope written as y − y₁ = m(x − x₁), that form has its own tool: the point slope form calculator starts from exactly that and hands you y = mx + b with it.
Five reasons a y = mx + b equation comes out wrong
Each of these produces an equation that looks finished and is not.
- The slope was rounded before b was solved. Round m and every x you multiply it by magnifies the error, and b quietly absorbs the lot. Through (300, 100) and (303, 101) the slope is exactly 1/3 and the line passes through the origin, b = 0. Round the slope to 0.33 first and solving gives b = 100 − 0.33 × 300 = 1, a full unit wrong, from a rounding error in the third decimal place. The further your points sit from the y-axis, the worse it gets. Carry the full value until the end, or type the fraction itself: this calculator accepts 1/3 as a slope and keeps it exact all the way through.
- The two points gave two different values of b. They cannot, so one substitution has a slip in it. See the worked example above: either point must land on the same b.
- b was read straight off Ax + By = C. The constant only becomes the intercept after dividing by B. In x + 2y = 10, b is 5, not 10.
- A sign got lost crossing the equals sign. Moving 3x to the other side makes it −3x. If the plot leans the opposite way to the line you expected, look here first.
- The line is vertical. If both of your points share one x value, there is no y = mx + b to find: the run is zero, the slope is undefined, and the line never touches the y-axis at all. It is written x = 5 instead. This calculator says so and hands you that equation rather than an error message.
Where y = mx + b turns up off the graph paper
Any quantity that starts somewhere and changes at a steady rate is this equation wearing work clothes. A ride that costs a $4 pickup fee plus 50 cents a mile is y = 0.5x + 4: the fee is b, owed before the wheels move, and the rate is m, what every extra mile adds. A phone plan with a standing charge, a tank draining at a steady rate, a spring stretching under load, all the same shape. When a word problem asks what the y-intercept represents, it is asking for the starting value before any x has happened, and when it asks for the slope it wants the per-unit rate. Matching the sentence to the two instructions is the whole exercise.
That reading is also the fastest sanity check this page offers. If your fitted phone bill says b = −40, you are claiming the company pays you $40 for using no data. Real quantities put quick bounds on both numbers, and an equation that breaks them is usually a units mix or a sign slip dressed up as an answer.
Frequently asked questions
With a negative slope like −3/4, do I go down 3 and right 4, or down 3 and left 4?
Down 3 and right 4. The minus sign belongs to the fraction as a whole, so put it on one part only: either the rise is −3 with a run of 4, or the rise is 3 with a run of −4. Down-and-right or up-and-left both trace the same falling line. Applying the minus to both parts cancels it out and draws a rising line instead, which is the usual way this goes wrong.
Which point should I plug in to find b?
Either one. Both points sit on the line, so both satisfy its equation and both give the same b. Pick whichever has friendlier numbers. If the two points hand you two different values of b, the line is not being indecisive: one of the substitutions has an arithmetic slip, and rerunning both through the calculator shows which.
Does the slope have to be a fraction?
No. The slope can be any number: whole, fraction, decimal, positive or negative. −3/4 and −0.75 are the same value, so a book answer in fractions and a calculator answer in decimals agree. Fractions survive graphing better, because 3/4 tells you directly to rise 3 for every 4 across, and they stay exact where a decimal like 1/3 would have to be cut off somewhere. That is the only sense in which fractions are preferred.
Why can a vertical line not be written in slope intercept form?
Because y = mx + b needs a slope, and a vertical line has none to offer: the run between any two of its points is zero, and dividing by zero is not defined. It also never crosses the y-axis, so there is no b either. The line through every point with x = 2 is simply written x = 2. That is its whole equation, and it is the one line the form cannot hold.
How do I write y = 4 in slope intercept form? There is no x.
It is already there. y = 4 is y = 0x + 4: a slope of zero and a y-intercept of 4, which is a horizontal line. The x has not gone missing, its coefficient is just zero, so writing it adds nothing. The same logic covers the other direction: y = 2x is y = 2x + 0, a line through the origin. A missing term means that value is zero, not that the form does not apply.
How do I find the y-intercept from a table if x = 0 is not in the table?
Treat any two rows as two points and solve as usual. Find m from the two rows, then put one row into y = mx + b and solve for b. A table reading (2, 7) and (5, 16) gives m = 9 ÷ 3 = 3, then 7 = 3(2) + b, so b = 1, even though (0, 1) appears nowhere in the table. Tables that do contain x = 0 are handing you b directly in that row: that is the lucky case, not the method.
Is b always the number I can see in the equation?
Only when the equation is already solved for y. In y = 2x − 1, yes, b is −1. In x + 2y = 10 the visible 10 is not b: divide everything by 2 first and the intercept turns out to be 5. Before trusting the number you can see, check the left side is a lone y with a coefficient of 1. If it is anything else, rearrange first, or let the Standard Form tab do the dividing.
What do m and b mean in a word problem?
m is the per-unit rate and b is the starting value. In a cost equation like y = 0.5x + 4 for a ride, the 4 is what you owe at mile zero, just for getting in, and the 0.5 is what each mile adds. If a problem asks what the y-intercept represents, describe the situation at x = 0. If it asks about the slope, describe what one more unit of x does to y.