Math & Statistics

Linear Equation Calculator

Type a linear equation such as 3(x − 2) + 5 = 2x + 7 to solve it with every step shown, using exact fractions. Or switch modes to find the equation of a line from two points or from a slope and a point, in slope-intercept, point-slope and standard form.

Free, runs in your browserUpdated October 2026
What do you want to do?
Use one letter as the variable. Brackets, fractions (x/4 or 3/4), decimals and * or implicit multiplication like 2(x + 1) are fine.
Examples
Solution
–

Step-by-step solution

    Linear Equation Calculator diagram: 3(x − 2) + 5 = 2x + 7 simplifies and solves to x = 8
    How the Linear Equation Calculator works: Solve for x step by step, or find y = mx + b from two points

    How to Use the Linear Equation Calculator

    How to use the Linear Equation Calculator: mode switch, equation box, examples and solution
    Numbered steps on the Linear Equation Calculator. Follow them in order.
    1. Choose Solve for x, Line through 2 points, or Slope and point.
    2. Type the equation with brackets, fractions or decimals.
    3. Or try an example, including no-solution and identity cases.
    4. Read the exact answer, then follow each step and the check.

    In Solve for x mode, type an equation with one variable, such as 3(x − 2) + 5 = 2x + 7. You can use brackets, fractions like x/4 or 3/4, decimals and implicit multiplication such as 2(x + 1). Any single letter works as the variable, so 0.4(y + 10) = 2y − 4 is solved for y. The answer is exact, written as a fraction when needed, with a decimal next to it.

    To find the equation of a line instead, choose Line through 2 points and enter the coordinates, or choose Slope and point. The result gives slope-intercept form, point-slope form, standard form and both intercepts, and the steps explain where each number comes from.

    How to Solve a Linear Equation

    A linear equation has the variable only to the first power. Every one of them can be solved with the same four moves, as long as you always do the same thing to both sides.

    1. Simplify each side: expand brackets and combine like terms.
    2. Move all variable terms to one side by adding or subtracting.
    3. Move all constants to the other side.
    4. Divide both sides by the coefficient of the variable.

    Finally, substitute the answer back into the original equation. If both sides give the same number, the solution is correct.

    Worked Example

    Solve 3(x − 2) + 5 = 2x + 7.

    • Expand and combine: 3x − 6 + 5 = 3x − 1, so the equation is 3x − 1 = 2x + 7.
    • Subtract 2x from both sides: x − 1 = 7.
    • Add 1 to both sides: x = 8.
    • Check: 3(8 − 2) + 5 = 23 and 2(8) + 7 = 23.

    With fractions, such as x/3 + 1/2 = 5/6, subtract 1/2 to get x/3 = 1/3, then multiply by 3 to get x = 1. Many teachers prefer multiplying every term by the least common denominator first, which gives the same answer.

    Equation of a Line From Two Points

    m = (y₂ − y₁) ÷ (x₂ − x₁)
    Slope-intercept: y = mx + b, where b = y₁ − m·x₁
    Point-slope: y − y₁ = m(x − x₁)    Standard: Ax + By = C

    For the points (1, 3) and (4, 9), the slope is (9 − 3) ÷ (4 − 1) = 6 ÷ 3 = 2. Then b = 3 − 2 × 1 = 1, so the line is y = 2x + 1. In standard form this is 2x − y = −1, and the x-intercept is −1/2.

    FormPatternLine through (1, 3) and (4, 9)
    Slope-intercepty = mx + by = 2x + 1
    Point-slopey − y₁ = m(x − x₁)y − 3 = 2(x − 1)
    StandardAx + By = C2x − y = −1

    No Solution and Infinitely Many Solutions

    If the variable terms cancel, look at what is left. A false statement such as 1 = −3, from 4x + 1 = 4x − 3, means there is no solution. A true statement such as 6 = 6, from 2(x + 3) = 2x + 6, means the equation is an identity and every number is a solution. For lines, two points with the same x value give a vertical line, x = c, whose slope is undefined.

    Clearing Fractions First

    When an equation has several fractions, multiply every term on both sides by the least common denominator before doing anything else. For x/3 + 1/2 = 5/6 the least common denominator is 6, which gives 2x + 3 = 5, so 2x = 2 and x = 1. The calculator works with exact fractions instead, but both routes always give the same answer.

    Tips and Limits

    • Type multiplication between brackets, as in 2(x + 1)(3), or use *.
    • The calculator rejects equations where the variable is squared, multiplied by itself or in a denominator, because those are not linear.
    • Decimals are converted to exact fractions, so 0.1 is treated as 1/10 and there is no rounding error.
    • For two or three equations with two or three unknowns, use a system of equations solver instead.

    Frequently asked questions

    What is a linear equation?

    A linear equation is one where the variable appears only to the first power and is not multiplied by itself. Its graph is a straight line, and in one variable it has one solution, none or infinitely many.

    How do you solve a linear equation step by step?

    Simplify both sides, move the variable terms to one side and the constants to the other by adding or subtracting, then divide by the coefficient. Check by substituting the answer back.

    How do I find the equation of a line from two points?

    Find the slope as the change in y divided by the change in x. Substitute one point into y = mx + b to find b, then write the equation as y = mx + b.

    What is standard form of a linear equation?

    Standard form is Ax + By = C, where A, B and C are integers, A is not negative, and they share no common factor. The calculator converts fractions so the coefficients are whole numbers.

    What does it mean when a linear equation has no solution?

    After simplifying, the variable terms cancel and leave a false statement such as 1 = 5. The two sides describe parallel lines with the same slope, so they never meet.

    Can I use fractions and decimals?

    Yes. Type fractions as 3/4 or x/4 and decimals as 0.25. They are converted to exact fractions, so the solution is exact, and a rounded decimal is shown next to any fraction.