Linear Equation and System Solver
Solve a system of linear equations (2×2, 3×3, up to 5×5) exactly with fractions, every Gaussian elimination row operation, Cramer's rule and a check.
Type equations such as 2x + 3y = 7 or 1/2a − b = 0,5. Up to 5 equations and 5 unknowns; the grid below follows square systems.
Coefficient grid
Coefficients on the left, constants after =. An empty cell counts as 0.
Solution
–
Gauss–Jordan elimination
Cramer's rule
Check in the original equations
How to solve a system of equations with this tool
- Type your equations in Equations (one per line), for example
2x + 3y = 7andx − y = 1. Unknowns can be any letters (x, y, z, a, b…) or names such as x1 and x2. Coefficients may be integers, decimals (0.5) or fractions (1/2 or (1/2)x), and constants may appear on both sides:3x + 4 = 2x − 1works. - The answer appears as you type. Solve does the same, Example loads a classic 3 × 3 system, Clear empties everything and Copy copies the solution.
- Prefer a table? Open Coefficient grid, choose the Grid size (2 × 2 to 5 × 5) and fill in the coefficients, with the constants in the column after the = sign. An empty cell counts as 0. The grid and the equations stay in sync.
- Read the result and the explanations below it: Gauss–Jordan elimination with every row operation and the matrix after each one, Cramer’s rule for 2 × 2 and 3 × 3 systems, and Check in the original equations.
Every calculation is exact: the tool works with fractions, never with rounded decimals, so 1/3 stays 1/3. A decimal approximation is shown next to fractional answers.
Gaussian elimination, step by step
The system is first written as an augmented matrix: one row per equation, one column per unknown, and the constants after a vertical bar. Three row operations change the matrix without changing the solutions:
- swap two rows (R₁ ↔ R₂);
- multiply a row by a non-zero number (R₁ → R₁ ÷ 2);
- add a multiple of another row (R₂ → R₂ − 3R₁).
The tool works column by column. It picks a pivot, preferring an entry equal to 1 or −1 to avoid fractions, swaps it into place, divides the row so the pivot becomes 1, then clears the rest of the column in every other row. This is the Gauss–Jordan variant: at the end the matrix is in reduced row echelon form and the solution can be read directly from the last column.
One, none or infinitely many solutions
- One solution: every unknown has a pivot. The rank equals the number of unknowns.
- No solution: a row becomes 0 = 5 (zero coefficients, non-zero constant). The equations contradict each other; for two unknowns the lines are parallel.
- Infinitely many solutions: some unknowns have no pivot. They become free parameters (t, s…) and the other unknowns are expressed in terms of them, for example x = 1 + t, y = 5 − 2t, z = t. Each value of t gives one solution.
Cramer’s rule
For a square system Ax = b with det(A) ≠ 0, each unknown equals det(Aᵢ) ÷ det(A), where Aᵢ is A with column i replaced by the constants. The tool shows the determinants: ad − bc for 2 × 2, and the expansion along the first row for 3 × 3. When det(A) = 0 the rule does not apply, and the elimination tells you whether there is no solution or infinitely many. For larger systems elimination is much faster, so Cramer’s rule is only shown up to 3 × 3.
Frequently asked questions
Can it solve a single linear equation?
Yes. Type one equation such as 3x + 4 = 2x − 1 and the tool gives x = −5. With one equation in two unknowns, it gives the general solution with a parameter.
What size of system is supported?
Up to 5 equations and 5 unknowns. The number of equations may differ from the number of unknowns; the grid is for square systems, the text area accepts any shape.
Why are the answers fractions?
Because they are exact. Rounded decimals would accumulate errors during elimination. The decimal value is shown next to each fraction.
How do I enter a missing unknown in an equation?
Just leave it out: x + z = 3 means the coefficient of y is 0. In the grid, leave the cell empty or type 0.
What does the rank mean?
The rank is the number of pivots, that is the number of independent equations. With n unknowns, rank n means one solution; a smaller rank means free parameters, unless the system is inconsistent.
Can I use a comma as the decimal separator?
It is safer to use a point (0.5). A comma followed by exactly three digits, as in 1,500, is read as a thousands separator; 1,5 is read as 1.5. To put two equations on one line, separate them with a semicolon.
Related tools
- Quadratic Equation Solver Solve any quadratic equation ax² + bx + c = 0 with the discriminant, exact roots in radical form, complex roots, vertex form, factored form and a graph.
- Fraction Calculator Free fraction calculator that adds, subtracts, multiplies, divides and simplifies fractions and mixed numbers, with step-by-step working.
- Ratio and Proportion Solver Solve a proportion A:B = C:D for any missing term by cross-multiplication, and simplify ratios like 12:18:24 or 1.5:2 to whole numbers, with steps.