Matrix Equation Solver — Ax = b

Solve Ax = b for a square matrix A and vector b, with every row-reduction step shown. Detects unique, no-solution, and infinite-solution cases. Exact fractions, no rounding. Dimensions up to 6×6.

For a 2-variable system with the working shown differently, see the System of Equations Solver (Cramer's rule).

Solve A x = b (augmented [A | b]) A b x₁ x₂ x unique solution

How to Solve Ax = b

Enter the entries of the square matrix A and the vector b — whole numbers, decimals, and fractions like 1/2 are all accepted.

1

Set the size

Pick a size from 1×1 to 6×6. A must be square to solve Ax = b, and b automatically matches the number of rows in A.

2

Fill in A and b

Type a value into each cell of A and each entry of b. The result updates as you type, and every value is kept as an exact fraction rather than a rounded decimal.

3

Read the solution and steps

If a unique solution exists, x1 through xn appear first. Otherwise the calculator reports no solution or infinitely many solutions, followed by every row operation applied to the augmented matrix [A|b].

Frequently Asked Questions

How do you solve Ax = b for a matrix A?
Form the augmented matrix [A|b] by appending the vector b as an extra column to A, then row-reduce it using elementary row operations. If the left side reduces to the identity matrix, the last column gives the unique solution x. This calculator performs and shows every row operation used.
What does it mean when Ax = b has no solution?
The system Ax = b has no solution when row reduction produces a row whose coefficients are all zero but whose right-hand side is not, an impossible equation such as 0 = 5. That means the equations are inconsistent and no vector x can satisfy all of them at once. Geometrically, in two dimensions it is a pair of parallel lines that never meet. In the language of rank, the augmented matrix has a higher rank than A itself.
What does it mean when Ax = b has infinitely many solutions?
If the rank of A is less than the number of unknowns, at least one variable is free to take any value, and each choice gives a different valid solution. That produces infinitely many solutions rather than a single one. This happens when A is singular but the system is still consistent, so no contradictory row appears during elimination. The solution set is then described by one particular solution plus any multiple of the free directions.
Why does this calculator use fractions instead of decimals?
Matrix entries are stored and combined as exact fractions using integer arithmetic, so a value like 1/3 stays exact instead of rounding to 0.3333. Row reduction involves many divisions and subtractions, and floating-point errors compound quickly across those steps. Near-singular systems are the worst case, where a small error in a pivot can shift the answer substantially. Exact fractions keep every step and the final solution vector mathematically precise.