🧮
🧮 Math & statistics

System of Linear Equations Solver (n × n, Gauss-Jordan)

Results update as you type.

Your numbers

Understanding the system of linear equations solver (Gauss-Jordan) — concept and principle

This solver handles any number of linear equations in any number of unknowns. You enter the augmented matrix [A | b], one row per equation, with the coefficients of x₁, x₂, … followed by the right-hand side, and the calculator reduces it to reduced row echelon form (RREF). It reports a unique solution, "infinitely many solutions" or "no solution", together with the rank of the matrix. Such systems appear in circuit analysis, chemical equation balancing and curve fitting.

Gauss-Jordan elimination of a 3 × 3 systemThe augmented matrix [2 1 −1 | 8; −3 −1 2 | −11; −2 1 2 | −3] reduces to the identity with 2, 3, −1 on the right.Row-reduce to the answerx₁x₂x₃=21−18−3−12−11−212−3swap · scale · add rows10020103001−1x₁ = 2x₂ = 3x₃ = −1
When the left block becomes 1s on the diagonal, the right column is the solution.

How it is calculated

Gauss-Jordan elimination applies three row operations, none of which changes the solution set:

Working column by column, the method makes a pivot of 1 and clears every other entry in that column to 0. At the end, each pivot row reads xᵢ = value. The rank is the number of pivots.

The principle

Each row operation replaces the equations with an equivalent set: anything that solves the old system solves the new one, and the steps can be reversed. So the RREF is just the same system written in the simplest possible way. The rank counts how many equations are truly independent. A square system with full rank has an invertible A and the unique solution x = A⁻¹b.

Worked example

  1. Input rows: [2 1 −1 | 8], [−3 −1 2 | −11], [−2 1 2 | −3].
  2. R1 ÷ 2 gives [1 ½ −½ | 4]. Then R2 + 3R1 → [0 ½ ½ | 1] and R3 + 2R1 → [0 2 1 | 5].
  3. R2 × 2 → [0 1 1 | 2]. Then R1 − ½R2 → [1 0 −1 | 3] and R3 − 2R2 → [0 0 −1 | 1].
  4. R3 × (−1) → [0 0 1 | −1]. Then R1 + R3 → [1 0 0 | 2] and R2 − R3 → [0 1 0 | 3].
  5. Result: x1 = 2, x2 = 3, x3 = −1, rank 3. Check in row 1: 2·2 + 3 − (−1) = 8.

How to read the result

Rank equal to the number of unknowns means every variable is pinned down. A lower rank means some equations are combinations of others.

Common mistakes

Keep in mind: Computation is in floating-point arithmetic with a small tolerance for deciding what counts as zero. Nearly singular systems can be misclassified or give inaccurate values; for scientific work, also check the condition number.

Frequently asked questions

What is the difference between Gaussian and Gauss-Jordan elimination?

Gaussian elimination stops at row echelon form and finishes by back-substitution; Gauss-Jordan continues until every pivot column is clear above and below.

Can there be more equations than unknowns?

Yes. The system is solvable only if the extra equations are consistent; otherwise the solver reports no solution.

What does the rank tell me?

It is the number of independent equations.

Sources: G. Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press · G. H. Golub and C. F. Van Loan, Matrix Computations, Johns Hopkins University Press

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →