Gaussian Elimination Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Introduction: What this Gaussian Elimination Calculator does

This Gaussian Elimination Calculator solves small systems of linear equations in two or three unknowns. You enter the coefficients of your equations in the fields labeled a11, a12, …, and the constant terms in the fields labeled b1, b2, b3. The tool then applies Gaussian elimination with partial pivoting to compute the solution.

The calculator supports:

It automatically detects whether your system has:

Formula: How to enter your system (mapping equations to a ij and b i )

Write your system in the standard form

Equation 1: a11·x + a12·y + a13·z = b1
Equation 2: a21·x + a22·y + a23·z = b2
Equation 3: a31·x + a32·y + a33·z = b3

Then fill in the form as follows:

  • a11: coefficient of x in Equation 1
  • a12: coefficient of y in Equation 1
  • a13: coefficient of z in Equation 1 (use 0 for 2×2 systems)
  • b1: constant term in Equation 1
  • a21, a22, a23, b2: same pattern for Equation 2
  • a31, a32, a33, b3: same pattern for Equation 3

For a 2×2 system in variables x and y, you can either:

  • Leave the a13, a23, and all third-row entries as 0, or
  • Use only the first two equations and ignore the third row.

Gaussian elimination in matrix form

Mathematically, we start from the matrix equation A·x = b, where A is the coefficient matrix, x is the vector of unknowns, and b is the vector of constants. For a 3×3 system,

( a11a12a13 a21a22a23 a31a32a33 ) ( x y z ) = ( b1 b2 b3 )

We form the augmented matrix [A | b] and use row operations to turn A into an upper triangular matrix (zeros below the main diagonal). The allowed row operations are:

  • Swap two rows
  • Multiply a row by a nonzero constant
  • Add a multiple of one row to another row

These operations do not change the set of solutions. Once the matrix is upper triangular, the calculator performs back substitution to obtain x, y, and z.

Interpreting the results

After you click the solve button, the calculator reports:

  • Unique solution: specific numeric values for each variable (for example, x = 2, y = -1, z = 0.5).
  • No solution: the equations are inconsistent (for example, one row reduces to something like 0·x + 0·y + 0·z = 5).
  • Infinitely many solutions: at least one equation is a linear combination of the others (for example, a row reduces to 0·x + 0·y + 0·z = 0 and not all variables can be solved uniquely).

When there is a unique solution, you can substitute the reported values back into the original equations to verify they satisfy each equation within normal rounding error.

Worked example (2×2 system)

Consider the system:

Equation 1: 2x + 1y = 5
Equation 2: 1x + 3y = 7

Step 1: Map to the form fields

Write the equations as

2x + 1y + 0z = 5
1x + 3y + 0z = 7

Enter:

  • a11 = 2, a12 = 1, a13 = 0, b1 = 5
  • a21 = 1, a22 = 3, , b2 = 7
  • Set the entire third row (a31, a32, a33, b3) to 0

Step 2: Gaussian elimination

The augmented matrix is

[ 2 1 | 5 ]
[ 1 3 | 7 ]

Swap rows if needed to choose a good pivot. Here we can keep the current order. Eliminate the first variable from the second row:

Row2 ← Row2 − (1/2)·Row1
[ 2 1 | 5 ]
[ 0 2.5 | 4.5 ]

Step 3: Back substitution

From the second row we get 2.5y = 4.5, so y = 4.5 / 2.5 = 1.8. Substitute into the first equation:

2x + 1.8 = 5 ⇒ 2x = 3.2 ⇒ x = 1.6.

The calculator returns approximately x = 1.6 and y = 1.8. (If a third variable z is present in your system, you will also see a value for z.)

Comparison with other methods

Method Typical use Pros for 2×2 / 3×3 systems Cons / limitations
Gaussian elimination (this calculator) Numeric solutions for small linear systems Systematic, works in general, identifies no/infinitely many solutions Numeric rounding; not symbolic; designed for up to 3×3 here
Substitution Hand calculations in basic algebra Intuitive for small systems; easy to show steps by hand Becomes messy for 3×3 or larger; harder to automate
Matrix inverse (A−1b) Theory and small exact examples Elegant formula when A is invertible Requires invertible matrix; computing the inverse is more work than elimination alone
LU / QR factorization Large or repeated systems in numerical computing Efficient and stable for big matrices or many right-hand sides Overkill for simple 2×2 and 3×3 homework-style problems

Limitations and assumptions

  • System size: this tool is designed for 2×2 and 3×3 linear systems only.
  • Numeric input: coefficients and constants are treated as real numbers. Extremely large or tiny magnitudes may suffer from floating-point rounding.
  • Partial pivoting: the calculator uses row swaps to avoid dividing by very small pivots, but highly ill-conditioned systems can still produce unstable results.
  • Singular systems: when the coefficient matrix is singular or nearly singular, the tool will indicate no solution or infinitely many solutions instead of producing arbitrary numbers.
  • No symbolic output: solutions are numeric approximations, not exact fractions or algebraic expressions.

Within these limits, Gaussian elimination is a reliable and standard method for solving small systems, making this calculator a practical companion for algebra courses and introductory linear algebra.

How to use this calculator

  1. Enter a11 coefficient using the unit or time period shown by the field.
  2. Enter a12 coefficient using the unit or time period shown by the field.
  3. Enter a13 coefficient using the unit or time period shown by the field.
  4. Run the calculation and compare the output with a second scenario before acting on it.
Enter coefficients to solve.

Arcade Mini-Game: Gaussian Elimination Calculator Calibration Run

Use this quick arcade run to practice separating useful scenario inputs from common planning mistakes before you rely on the calculator output.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch useful inputs and avoid bad assumptions.