Stuck on a Linear Equation? Start Here
Maya, a 17-year-old high school student in Chicago, stares at her homework. The problem gives her a line passing through (1, 4) and (3, 10) and asks for the equation in three different forms. She tries to remember which formula goes where. Slope first, then intercept, then rearrange. The numbers blur together. Sound familiar? Linear equations show up everywhere in algebra, and the form y = mx + b is the one most teachers reach for first. This calculator solves that exact problem in seconds, and it shows every step so you can follow along instead of guessing.
What This Calculator Does & Why It Matters
The linear equation solver works two ways. In the single-variable mode you enter any three of the four values in y = mx + b and it finds the missing one. Want the slope? Enter x, y, and b. Need the y-intercept? Enter x, y, and m. In the Two Points mode you type in (x1, y1) and (x2, y2) and the tool returns the slope, the y-intercept, and the full equation.
Beyond the basic answer, the calculator converts the line into three standard forms: slope-intercept, standard (Ax + By = C), and point-slope. It also reports the x-intercept and y-intercept and builds a small table of values so you can plot the line yourself. If you only need the slope from two coordinates, the Slope Calculator is a lighter option. If you already have a point and a slope and want the equation, the Point Slope Calculator handles that directly.
How the Calculation Works
A linear equation in two variables describes a straight line. The slope-intercept form packs two pieces of information into one compact expression.
y = mx + b
m = slope = (change in y) / (change in x)
b = y-intercept (the y value when x = 0)
The slope m tells you how steep the line is and which direction it tilts. The intercept b tells you where the line crosses the y-axis. Together they fix the line completely.
Finding Slope From Two Points
When you know two points on the line, the slope comes from the ratio of vertical change to horizontal change.
m = (y2 - y1) / (x2 - x1)
Once you have m, plug either point back into the equation to solve for b.
b = y1 - m * x1
Converting to Standard Form
Standard form writes the equation as Ax + By = C, where A, B, and C are integers (ideally). Starting from y = mx + b, move the x term to the left side.
y = mx + b
-mx + y = b
Ax + By = C with A = -m, B = 1, C = b
If m and b are fractions, multiply every term by the common denominator to clear the fractions. Many textbooks also prefer A to be positive, so multiply through by -1 when needed.
Point-Slope Form
Point-slope form is handy when you know one point and the slope but do not yet have the intercept.
y - y1 = m(x - x1)
How to Use the Calculator
- Pick a mode at the top: solve for x, y, m, b, or use Two Points.
- In a solve-for mode, enter the three known values. The field for the variable you are solving is disabled.
- In Two Points mode, enter x1, y1, x2, and y2.
- Read the solved value in the highlighted box at the top of the results.
- Check the three equation forms, both intercepts, the table of values, and the step-by-step working.
- Use the Copy Result button to paste the answer into your notes or homework.
Example Calculations
Example 1: Maya's Homework
Maya enters the two points from her homework: (1, 4) and (3, 10). The slope is m = (10 - 4) / (3 - 1) = 6 / 2 = 3. The y-intercept is b = 4 - 3 * 1 = 1. So the slope-intercept form is y = 3x + 1. In standard form that becomes -3x + y = 1, or 3x - y = -1 if you prefer a positive A. The point-slope form using (1, 4) is y - 4 = 3(x - 1). The x-intercept is where y = 0, so x = -1/3, giving the point (-0.3333, 0). The y-intercept is (0, 1).
Example 2: Solving for b
Devin, a 20-year-old community college student, knows a line passes through (2, 11) with a slope of 4. He needs the y-intercept. He switches to Solve for b, enters x = 2, y = 11, m = 4. The calculator rearranges to b = y - mx and computes b = 11 - 4 * 2 = 11 - 8 = 3. The full equation is y = 4x + 3. The standard form is -4x + y = 3, and the x-intercept is (-0.75, 0).
Real-World Scenarios
Cost Analysis for a Small Business
Rina runs a bakery. Her fixed monthly costs are $1,200 for rent and utilities. Each cake she sells costs $8 in ingredients and labor. The total monthly cost follows a linear equation where b = 1200 (fixed cost) and m = 8 (cost per cake). The equation is y = 8x + 1200, where x is the number of cakes and y is the total cost in dollars. If she wants to keep total costs under $2,000, she solves 2000 = 8x + 1200 for x and gets x = 100 cakes. The x-intercept (-150, 0) has no physical meaning here because negative production is impossible, which is a good reminder that math models need real-world context.
Temperature Conversion
The relationship between Celsius and Fahrenheit is linear. Water freezes at 0 C and 32 F, and boils at 100 C and 212 F. Treating Celsius as x and Fahrenheit as y, the two points are (0, 32) and (100, 212). The slope is m = (212 - 32) / (100 - 0) = 180 / 100 = 1.8. The y-intercept is b = 32. So F = 1.8C + 32, the familiar conversion formula. This is a clean example of how two known points pin down a line that describes a physical relationship.
Equipment Depreciation
A delivery van loses value in a straight line over time. It is worth $35,000 new (year 0) and $7,000 after 7 years. Using the points (0, 35000) and (7, 7000), the slope is m = (7000 - 35000) / (7 - 0) = -28000 / 7 = -4000. The y-intercept is 35000. The equation is y = -4000x + 35000, where x is years and y is value in dollars. The negative slope means the value drops $4,000 per year. The x-intercept is where y = 0, so x = 8.75, meaning the van reaches zero book value after about 8 years and 9 months.
Common Mistakes to Avoid
- Swapping rise and run: Slope is change in y over change in x. Reversing them gives the reciprocal, which is a different line entirely. Always compute (y2 - y1) on top and (x2 - x1) on the bottom.
- Mixing up the two points when subtracting: Use the same point as the "first" point in both the numerator and denominator. Mixing (y2 - y1) with (x1 - x2) flips the sign of the slope.
- Forgetting that a vertical line has no slope: When x1 equals x2, the denominator is zero and the slope is undefined. The equation is x = (constant), not y = mx + b. This is different from a slope of zero, which is a horizontal line.
- Dropping the sign on b: A negative y-intercept still belongs in the equation. y = 3x - 5 is correct. Writing y = 3x + 5 moves the line up by 10 units and gives wrong answers for every x.
Limitations
This tool handles straight lines only. It does not solve quadratic, cubic, exponential, or any nonlinear equations. For curves, the slope changes at every point and a single m value cannot describe the whole function. The calculator also works in two dimensions, so it cannot model lines in 3D space or parametric forms. Vertical lines are reported correctly as x = (constant), but they do not have a slope-intercept form because the slope is undefined. For systems of equations with two unknowns, you need a separate solver that handles simultaneous linear equations.
Authoritative Research and Resources
- Khan Academy - Forms of Linear Equations - Free video lessons and practice problems covering slope-intercept, standard, and point-slope forms. A solid starting point for students who want worked examples alongside the theory.
- LibreTexts - Linear Functions (OpenStax) - An open-access college algebra textbook chapter on linear functions, including detailed derivations of each equation form and real-world modeling examples.
- NIST - Metric SI Units - The National Institute of Standards and Technology reference for unit conversions, useful when linear equations model physical quantities and you need consistent units across the slope and intercept.