Gaussian Elimination Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

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:

How to enter your system (mapping equations to aij and bi)

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:

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

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:

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:

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:

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

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.

Enter coefficients to solve.

Embed this calculator

Copy and paste the HTML below to add the Gaussian Elimination Calculator – Solve 2x2 and 3x3 Linear Systems to your website.