System of Linear Equations Calculator

Select the number of equations and variables, then enter the coefficients of the linear system to solve it step by step.

x + y + z =
x + y + z =
x + y + z =

Quick Examples

Rate this tool

How to Use the Calculator

This online system of linear equations solver is a linear algebra tool designed to solve systems of any dimension, from 2×2 to 6×6, including both square and rectangular systems (overdetermined or underdetermined). By default, the math engine solves the problem step by step using Gaussian elimination, operating with exact fractions and radicals to avoid rounding errors.

Setup and data entry:

  1. Set the system dimensions: use the top dropdown menus to select the number of equations (from 2 to 6) and the number of variables (from 2 to 6). For systems with up to 3 variables, the letters x, y, and z are used; for 4 or more variables, the grid automatically adapts to x1, x2, ..., x6.
  2. Choose the input format: by default, you can enter coefficients directly into the linear equation layout. If you prefer, check the "Enter as an augmented matrix" box to hide the variables and work directly in the [A | b] matrix representation without losing any data you have already typed.
  3. Fill in the coefficients: enter integers, decimals, or exact fractions (such as 1/2 or -3/4). If a variable does not appear in an equation, you can enter 0 or leave the field blank, as the solver treats empty fields as zero. If a variable has a unit coefficient, explicitly enter 1 or -1.

When you click the solve button, the tool organizes the output into clear sections:

1. Quick answer and system classification
In the main result card, you will get an immediate diagnosis of the linear system:

  • Consistent and independent system: has a unique solution, displaying the exact value of each variable. For 2×2 systems, the intersection point P(x, y) is also shown.
  • Consistent and dependent system: has infinitely many solutions. The calculator expresses the general parametric solution using standard free parameters (t, s, u, v, w ∈ ℝ).
  • Inconsistent system: has no solution, automatically detecting any contradictory equation during row reduction.

2. Interactive 2D graph (2×2 systems)
When you solve a system of 2 equations in 2 variables, an interactive Cartesian coordinate plane is rendered, plotting both lines in distinct colors and highlighting their point of intersection (if one exists), allowing you to visually verify whether the lines are intersecting, parallel, or coincident.

3. Step-by-step solution via Gaussian elimination
The analytical breakdown displays the entire procedure in a structured sequence:

  1. System setup and augmented matrix: displays the formal system with curly braces and builds its corresponding augmented matrix.
  2. Forward elimination: performs row swaps (whenever a pivot is zero) and elementary row operations to eliminate all entries below each pivot, highlighting the active pivot in bold at every stage.
  3. Back substitution: starting from the row echelon form, solves for the variables from bottom to top (or in terms of free parameters when there are infinitely many solutions).

4. Solving with alternative methods
At the bottom of the solution, if your system dimensions are compatible, the tool provides shortcuts to open the exact same problem preloaded in other specialized calculators:

Worked Examples

The following are sample problems solved by the calculator.

Example 1

Solve the following system of linear equations in three variables:

$$ \displaystyle \begin{cases} 2x + y - z = 1 \\[0.5em] x - y + 2z = 3 \\[0.5em] 3x + 2y + z = 4 \end{cases} $$

Result

The system is consistent and independent and has a unique solution:

$$ \displaystyle x = 1, \quad y = 0, \quad z = 1 $$

Step-by-step solution

1. Set up the system of equations

Write the linear system with its corresponding variables:

$$ \displaystyle \begin{cases} 2x + y - z = 1 \\[0.5em] x - y + 2z = 3 \\[0.5em] 3x + 2y + z = 4 \end{cases} $$

2. Construct the augmented matrix

Represent the variable coefficients and constants in an augmented matrix:

$$ \displaystyle \left[ \begin{array}{ccc|c} 2 & 1 & -1 & 1 \\[0.5em] 1 & -1 & 2 & 3 \\[0.5em] 3 & 2 & 1 & 4 \end{array} \right] $$

3. Create zeros below the pivot in column 1

Take the pivot at position (1, 1) and eliminate the entries below it in column 1.

Subtract 1/2 times row 1 from row 2.

$$ \displaystyle F_{2} \rightarrow F_{2} - \frac{1}{2}F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{2} & 1 & -1 & 1 \\[0.5em] 0 & -\frac{3}{2} & \frac{5}{2} & \frac{5}{2} \\[0.5em] 3 & 2 & 1 & 4 \end{array} \right] $$

Subtract 3/2 times row 1 from row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} - \frac{3}{2}F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{2} & 1 & -1 & 1 \\[0.5em] 0 & -\frac{3}{2} & \frac{5}{2} & \frac{5}{2} \\[0.5em] 0 & \frac{1}{2} & \frac{5}{2} & \frac{5}{2} \end{array} \right] $$

4. Create zeros below the pivot in column 2

Take the pivot at position (2, 2) and eliminate the entries below it in column 2.

Add 1/3 times row 2 to row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} + \frac{1}{3}F_{2} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} 2 & 1 & -1 & 1 \\[0.5em] 0 & \boldsymbol{-\frac{3}{2}} & \frac{5}{2} & \frac{5}{2} \\[0.5em] 0 & 0 & \frac{10}{3} & \frac{10}{3} \end{array} \right] $$

5. Apply back substitution and conclude

The matrix is now in row echelon form. Solve for the variables from bottom to top:

From row 3, solve for z:

$$ \displaystyle \displaystyle \frac{10}{3}z = \frac{10}{3} \\[0.5em] \displaystyle \boxed{z = 1} $$

Substitute into row 2 and solve for y:

$$ \displaystyle \displaystyle -\frac{3}{2}y + \frac{5}{2}z = \frac{5}{2} \\[0.5em] \displaystyle -\frac{3}{2}y + \frac{5}{2}(1) = \frac{5}{2} \\[0.5em] \displaystyle \boxed{y = 0} $$

Substitute into row 1 and solve for x:

$$ \displaystyle \displaystyle 2x + y - z = 1 \\[0.5em] \displaystyle 2x + (0) - (1) = 1 \\[0.5em] \displaystyle \boxed{x = 1} $$
Example 2

Find the solution set of the following 3x3 system of equations with fractional coefficients using Gaussian elimination:

$$ \displaystyle \begin{cases} \frac{1}{2}x + \frac{1}{4}y + z = 3 \\[0.5em] x - \frac{1}{2}y + 2z = 8 \\[0.5em] 2x + y - z = -\frac{1}{2} \end{cases} $$

Result

This is a consistent and independent system whose unique solution is:

$$ \displaystyle x = 2, \quad y = -2, \quad z = \frac{5}{2} $$

Step-by-step solution

1. Set up the system of equations

Start with the linear system of three equations in three variables:

$$ \displaystyle \begin{cases} \frac{1}{2}x + \frac{1}{4}y + z = 3 \\[0.5em] x - \frac{1}{2}y + 2z = 8 \\[0.5em] 2x + y - z = -\frac{1}{2} \end{cases} $$

2. Construct the augmented matrix

Write the augmented matrix with the variable coefficients and constant terms:

$$ \displaystyle \left[ \begin{array}{ccc|c} \frac{1}{2} & \frac{1}{4} & 1 & 3 \\[0.5em] 1 & -\frac{1}{2} & 2 & 8 \\[0.5em] 2 & 1 & -1 & -\frac{1}{2} \end{array} \right] $$

3. Create zeros below the pivot in column 1

Use the pivot at position (1, 1) to eliminate the entries below it in the first column.

Subtract 2 times row 1 from row 2.

$$ \displaystyle F_{2} \rightarrow F_{2} - 2F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{\frac{1}{2}} & \frac{1}{4} & 1 & 3 \\[0.5em] 0 & -1 & 0 & 2 \\[0.5em] 2 & 1 & -1 & -\frac{1}{2} \end{array} \right] $$

Subtract 4 times row 1 from row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} - 4F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{\frac{1}{2}} & \frac{1}{4} & 1 & 3 \\[0.5em] 0 & -1 & 0 & 2 \\[0.5em] 0 & 0 & -5 & -\frac{25}{2} \end{array} \right] $$

4. Create zeros below the pivot in column 2

Since the entry below the pivot (2, 2) is already zero, the matrix is already in row echelon form without needing any operations on this column.

5. Apply back substitution and conclude

With the matrix in row echelon form, solve the equations from the bottom row up to the first:

From row 3, obtain the value of z:

$$ \displaystyle \displaystyle -5z = -\frac{25}{2} \\[0.5em] \displaystyle \boxed{z = \frac{5}{2}} $$

From row 2, directly solve for y:

$$ \displaystyle \displaystyle -y = 2 \\[0.5em] \displaystyle \boxed{y = -2} $$

Substitute both results into row 1 to calculate x:

$$ \displaystyle \displaystyle \frac{1}{2}x + \frac{1}{4}y + z = 3 \\[0.5em] \displaystyle \frac{1}{2}x + \frac{1}{4}(-2) + \left(\frac{5}{2}\right) = 3 \\[0.5em] \displaystyle \boxed{x = 2} $$
Example 3

Determine the values of the variables and the point of intersection of the lines associated with the following 2x2 system of equations:

$$ \displaystyle \begin{cases} 3x - 2y = 4 \\[0.5em] x + 4y = 6 \end{cases} $$

Result

The system is consistent and independent and admits a unique solution:

$$ \displaystyle x = 2, \quad y = 1 $$

Geometrically, both lines intersect at the point:

$$ \displaystyle P\left(2,\; 1\right) $$

Step-by-step solution

1. Set up the system of equations

Write down the linear system of two equations in two variables:

$$ \displaystyle \begin{cases} 3x - 2y = 4 \\[0.5em] x + 4y = 6 \end{cases} $$

2. Construct the augmented matrix

Express the system in its augmented matrix form:

$$ \displaystyle \left[ \begin{array}{cc|c} 3 & -2 & 4 \\[0.5em] 1 & 4 & 6 \end{array} \right] $$

3. Create zeros below the pivot in column 1

Select the pivot (1, 1) and eliminate the entry below it in the first column.

Subtract 1/3 times row 1 from row 2.

$$ \displaystyle F_{2} \rightarrow F_{2} - \frac{1}{3}F_{1} $$
$$ \displaystyle \left[ \begin{array}{cc|c} \boldsymbol{3} & -2 & 4 \\[0.5em] 0 & \frac{14}{3} & \frac{14}{3} \end{array} \right] $$

4. Apply back substitution and conclude

Once the matrix is in row echelon form, solve for the variables in reverse order:

From row 2, find y:

$$ \displaystyle \displaystyle \frac{14}{3}y = \frac{14}{3} \\[0.5em] \displaystyle \boxed{y = 1} $$

Substitute this value into row 1 to obtain x:

$$ \displaystyle \displaystyle 3x - 2y = 4 \\[0.5em] \displaystyle 3x - 2(1) = 4 \\[0.5em] \displaystyle \boxed{x = 2} $$
Graphical representation of the system of equations 3x - 2y = 4 and x + 4y = 6 intersecting at the point (2, 1)
Example 4

Find the general solution of the following 3x3 system of linear equations using Gaussian elimination:

$$ \displaystyle \begin{cases} x + 2y - z = 3 \\[0.5em] 2x + 4y + z = 9 \\[0.5em] 3x + 6y = 12 \end{cases} $$

Result

The system is consistent and dependent, meaning it has infinitely many solutions expressed parametrically as:

$$ \displaystyle x = -2 t+4, \quad y = t, \quad z = 1 \quad (t \in \mathbb{R}) $$

Step-by-step solution

1. Set up the system of equations

Start with the system of three linear equations in three variables:

$$ \displaystyle \begin{cases} x + 2y - z = 3 \\[0.5em] 2x + 4y + z = 9 \\[0.5em] 3x + 6y = 12 \end{cases} $$

2. Construct the augmented matrix

Transfer the coefficients and constant terms into an augmented matrix:

$$ \displaystyle \left[ \begin{array}{ccc|c} 1 & 2 & -1 & 3 \\[0.5em] 2 & 4 & 1 & 9 \\[0.5em] 3 & 6 & 0 & 12 \end{array} \right] $$

3. Create zeros below the pivot in column 1

With the pivot at position (1, 1), reduce the entries below it in column 1 to zero.

Subtract 2 times row 1 from row 2.

$$ \displaystyle F_{2} \rightarrow F_{2} - 2F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{1} & 2 & -1 & 3 \\[0.5em] 0 & 0 & 3 & 3 \\[0.5em] 3 & 6 & 0 & 12 \end{array} \right] $$

Subtract 3 times row 1 from row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} - 3F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{1} & 2 & -1 & 3 \\[0.5em] 0 & 0 & 3 & 3 \\[0.5em] 0 & 0 & 3 & 3 \end{array} \right] $$

4. Create zeros below the pivot in column 3

Take the pivot at position (2, 3) to eliminate the entry below it in column 3.

Subtract row 2 from row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} - F_{2} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} 1 & 2 & -1 & 3 \\[0.5em] 0 & 0 & \boldsymbol{3} & 3 \\[0.5em] 0 & 0 & 0 & 0 \end{array} \right] $$

5. Apply back substitution and conclude

With the matrix in row echelon form and a zero row, parameterize the free variable and solve for the leading variables:

Define the free parameter in the real numbers:

$$ \displaystyle y = t, \quad t \in \mathbb{R} $$

From row 2, calculate z:

$$ \displaystyle \displaystyle 3z = 3 \\[0.5em] \displaystyle \boxed{z = 1} $$

Substitute into row 1 and solve for x in terms of the parameter:

$$ \displaystyle \displaystyle x + 2y - z = 3 \\[0.5em] \displaystyle x + 2t - (1) = 3 \\[0.5em] \displaystyle \boxed{x = -2 t+4} $$
Example 5

Determine the consistency and analyze the existence of solutions for the following linear system:

$$ \displaystyle \begin{cases} x + y - 2z = 4 \\[0.5em] 2x - y + z = 1 \\[0.5em] 3x - z = 10 \end{cases} $$

Result

The system is inconsistent (has no solution), because row reduction leads to an impossible equation.

Step-by-step solution

1. Set up the system of equations

Write the linear equations that make up the system:

$$ \displaystyle \begin{cases} x + y - 2z = 4 \\[0.5em] 2x - y + z = 1 \\[0.5em] 3x - z = 10 \end{cases} $$

2. Construct the augmented matrix

Form the augmented matrix by arranging the variable coefficients and the constants column:

$$ \displaystyle \left[ \begin{array}{ccc|c} 1 & 1 & -2 & 4 \\[0.5em] 2 & -1 & 1 & 1 \\[0.5em] 3 & 0 & -1 & 10 \end{array} \right] $$

3. Create zeros below the pivot in column 1

Take the pivot at (1, 1) and create zeros in the rest of the first column.

Subtract 2 times row 1 from row 2.

$$ \displaystyle F_{2} \rightarrow F_{2} - 2F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{1} & 1 & -2 & 4 \\[0.5em] 0 & -3 & 5 & -7 \\[0.5em] 3 & 0 & -1 & 10 \end{array} \right] $$

Subtract 3 times row 1 from row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} - 3F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{1} & 1 & -2 & 4 \\[0.5em] 0 & -3 & 5 & -7 \\[0.5em] 0 & -3 & 5 & -2 \end{array} \right] $$

4. Create zeros below the pivot in column 2

Use the pivot at (2, 2) to eliminate the entry below it in column 2.

Subtract row 2 from row 3.

$$ \displaystyle F_{3} \rightarrow F_{3} - F_{2} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} 1 & 1 & -2 & 4 \\[0.5em] 0 & \boldsymbol{-3} & 5 & -7 \\[0.5em] 0 & 0 & 0 & 5 \end{array} \right] $$

5. Analyze the consistency of the system

We conclude that the system has no solutions because the last row represents a mathematical contradiction:

$$ \displaystyle 0 = 5 $$
Example 6

Solve the following rectangular system of two equations in three variables (2x3) using Gaussian elimination:

$$ \displaystyle \begin{cases} x + y + z = 6 \\[0.5em] 2x - y + 3z = 9 \end{cases} $$

Result

The system is consistent and dependent (it has infinitely many solutions) and its general parametric expression is:

$$ \displaystyle x = -\frac{4 t}{3}+5, \quad y = \frac{t}{3}+1, \quad z = t \quad (t \in \mathbb{R}) $$

Step-by-step solution

1. Set up the system of equations

Write the underdetermined linear system in three variables:

$$ \displaystyle \begin{cases} x + y + z = 6 \\[0.5em] 2x - y + 3z = 9 \end{cases} $$

2. Construct the augmented matrix

Arrange the coefficients and constant terms inside the augmented matrix:

$$ \displaystyle \left[ \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\[0.5em] 2 & -1 & 3 & 9 \end{array} \right] $$

3. Create zeros below the pivot in column 1

Take the pivot at position (1, 1) and reduce the entry below it in the first column to zero.

Subtract 2 times row 1 from row 2.

$$ \displaystyle F_{2} \rightarrow F_{2} - 2F_{1} $$
$$ \displaystyle \left[ \begin{array}{ccc|c} \boldsymbol{1} & 1 & 1 & 6 \\[0.5em] 0 & -3 & 1 & -3 \end{array} \right] $$

4. Apply back substitution and conclude

With the matrix in row echelon form, assign a parameter to the free variable and solve for the leading variables:

Assign the free parameter in the real numbers:

$$ \displaystyle z = t, \quad t \in \mathbb{R} $$

From row 2, solve for y in terms of t:

$$ \displaystyle \displaystyle -3y + z = -3 \\[0.5em] \displaystyle -3y + t = -3 \\[0.5em] \displaystyle \boxed{y = \frac{t}{3}+1} $$

Substitute into row 1 to find x:

$$ \displaystyle \displaystyle x + y + z = 6 \\[0.5em] \displaystyle x + \left(\frac{t}{3}+1\right) + t = 6 \\[0.5em] \displaystyle \boxed{x = -\frac{4 t}{3}+5} $$

Related Tools

Daniel Machado

Professor of Mathematics, graduated from the Faculty of Exact, Chemical and Natural Sciences of the National University of Misiones (UNAM). Developer and creator of RigelUp, dedicated to building tools for mathematical learning.