Cramer's Rule Calculator

Enter the coefficients of the system of linear equations (2x2, 3x3, 4x4) to solve it using Cramer's rule step by step with a graph.

Quick Examples

Rate this tool

How to Use the Calculator

This online Cramer's rule solver is an algebraic tool designed to solve systems of linear equations. In addition to giving you the direct solution to the problem, the system generates the step-by-step mathematical work and, for two-variable systems, provides a graphical representation of the situation.

How to enter your data:

  1. Select the system size: use the main menu to choose the dimensions of your problem. The tool supports 2x2 (two equations and two variables), 3x3, and up to 4x4 systems.
  2. Fill in the coefficients: enter the numerical values attached to each variable and the constant terms in the corresponding boxes. If a variable is missing from your system, simply leave the cell empty; the math engine will automatically assume its coefficient is 0.

Once the input data is processed, the calculator will structure the answer into the following sections:

1. Quick answer
In a highlighted first block, you will get the diagnosis and the direct solution to your system. If the system has a unique solution (consistent and independent), you will see the exact values for each variable. If the main determinant is zero, the tool will inform you whether it is an inconsistent system (no solution) or a consistent and dependent system (infinite solutions, an analytical deduction that the algorithm applies specifically in the 2x2 mode).

2. Step-by-step solution
Next, the detailed procedure will be displayed, applying the algebraic method to solve your system and diagnose its nature:

  • Matrix extraction: the system will isolate the information from your problem by setting up the square coefficient matrix (A) and the constant column matrix (B).
  • Main determinant: the first calculation step will be to find the determinant of the system matrix (Δ).
  • Variable determinants: the algorithm will build new matrices by replacing the column corresponding to each variable with matrix B, thus calculating the individual determinants (Δx, Δy, Δz, etc.).
  • Final calculation and diagnosis: with all the obtained values, the solver will evaluate the results to reach an analytical conclusion:
    - If Δ ≠ 0: the system will apply the final formula for each variable (for example: x = Δx / Δ), obtaining the reduced values for a consistent and independent system.
    - If Δ = 0 and at least one of the variable determinants is non-zero: the step-by-step process will logically conclude that it is an inconsistent system (no solution).
    - If Δ = 0 and all variable determinants are also zero: the analysis will depend on the dimension of the problem. For 2x2 systems, the calculator will confirm that it is a consistent and dependent system (infinite solutions). However, for 3x3 or 4x4 systems, it will conclude that, based on Cramer's rule, we can only deduce that the system is not consistent and independent; to state whether it has infinite solutions or none, other methods such as Gaussian elimination would be required.

3. Interactive graph
When solving systems of two equations with two variables, the results will include an interactive Cartesian coordinate system at the bottom. The tool will graph both equations as lines. You will be able to visually verify the result geometrically: whether the lines intersect at one point (unique solution), are parallel (inconsistent system), or overlap by tracing the exact same line (consistent and dependent system).

Solved Exercises

The following are examples of problems solved by the calculator.

Solve the following 2x2 system using Cramer's rule: 2x + 3y = 8, x - 2y = -3.

Result

The solution to the system of equations is:

$$ \displaystyle \begin{cases} \displaystyle x = 1 \\[1em] \displaystyle y = 2 \end{cases} $$

Step-by-step solution

1. Identify the system to solve and its matrices.

The system of equations we are working with is:

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

We extract the coefficient matrix (the numbers multiplying the variables):

$$ \displaystyle A = \begin{bmatrix} 2 & 3 \\[0.5em] 1 & -2 \end{bmatrix} $$

We extract the constant matrix (the numbers on the right side of the equals sign):

$$ \displaystyle B = \begin{bmatrix} 8 \\[0.5em] -3 \end{bmatrix} $$

2. Calculate the system determinant (Δ).

We find the determinant of matrix A.

$$ \displaystyle \Delta = |A| = \begin{vmatrix} 2 & 3 \\[0.5em] 1 & -2 \end{vmatrix} \\[0.8em] \Delta = (2)\left(-2\right) - (3)(1) \\[0.8em] \Delta = -7 $$

Since Δ ≠ 0, the system is consistent and independent, meaning it has a unique solution.

3. Calculate the determinant for x (Δx).

In the system's matrix A, we replace the column corresponding to the variable x with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{x} = \begin{vmatrix} 8 & 3 \\[0.5em] -3 & -2 \end{vmatrix} \\[0.8em] \Delta_{x} = (8)\left(-2\right) - (3)\left(-3\right) \\[0.8em] \Delta_{x} = -7 $$

4. Calculate the determinant for y (Δy).

In the system's matrix A, we replace the column corresponding to the variable y with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{y} = \begin{vmatrix} 2 & 8 \\[0.5em] 1 & -3 \end{vmatrix} \\[0.8em] \Delta_{y} = (2)\left(-3\right) - (8)(1) \\[0.8em] \Delta_{y} = -14 $$

5. Find the values of the variables.

We divide the determinant of each variable by the system determinant to find the value of each variable.

Value of x:

$$ \displaystyle x = \dfrac{\Delta_{x}}{\Delta} \\[0.8em] x = \dfrac{-7}{-7} \\[0.8em] x = 1 $$

Value of y:

$$ \displaystyle y = \dfrac{\Delta_{y}}{\Delta} \\[0.8em] y = \dfrac{-14}{-7} \\[0.8em] y = 2 $$

Therefore, the solution to the system is:

$$ \displaystyle \begin{cases} \displaystyle x = 1 \\[1em] \displaystyle y = 2 \end{cases} $$

6. Geometric interpretation.

The system can be represented graphically as two lines intersecting at a single point (the solution).

Graph on the Cartesian coordinate system of two intersecting lines representing equations of a 2x2 linear system. Example 1.
Graph of the system's solution
Find the solution to the linear system x/2 + y = 3, x - y/3 = 1.

Result

The solution to the system of equations is:

$$ \displaystyle \begin{cases} \displaystyle x = \frac{12}{7} \approx 1.71 \\[1em] \displaystyle y = \frac{15}{7} \approx 2.14 \end{cases} $$

Step-by-step solution

1. Identify the system to solve and its matrices.

The system of equations we are working with is:

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

We extract the coefficient matrix (the numbers multiplying the variables):

$$ \displaystyle A = \begin{bmatrix} \frac{1}{2} & 1 \\[0.5em] 1 & -\frac{1}{3} \end{bmatrix} $$

We extract the constant matrix (the numbers on the right side of the equals sign):

$$ \displaystyle B = \begin{bmatrix} 3 \\[0.5em] 1 \end{bmatrix} $$

2. Calculate the system determinant (Δ).

We find the determinant of matrix A.

$$ \displaystyle \Delta = |A| = \begin{vmatrix} \frac{1}{2} & 1 \\[0.5em] 1 & -\frac{1}{3} \end{vmatrix} \\[0.8em] \Delta = \left(\frac{1}{2}\right)\left(-\frac{1}{3}\right) - (1)(1) \\[0.8em] \Delta = -\frac{7}{6} \approx -1.17 $$

Since Δ ≠ 0, the system is consistent and independent, meaning it has a unique solution.

3. Calculate the determinant for x (Δx).

In the system's matrix A, we replace the column corresponding to the variable x with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{x} = \begin{vmatrix} 3 & 1 \\[0.5em] 1 & -\frac{1}{3} \end{vmatrix} \\[0.8em] \Delta_{x} = (3)\left(-\frac{1}{3}\right) - (1)(1) \\[0.8em] \Delta_{x} = -2 $$

4. Calculate the determinant for y (Δy).

In the system's matrix A, we replace the column corresponding to the variable y with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{y} = \begin{vmatrix} \frac{1}{2} & 3 \\[0.5em] 1 & 1 \end{vmatrix} \\[0.8em] \Delta_{y} = \left(\frac{1}{2}\right)(1) - (3)(1) \\[0.8em] \Delta_{y} = -\frac{5}{2} = -2.5 $$

5. Find the values of the variables.

We divide the determinant of each variable by the system determinant to find the value of each variable.

Value of x:

$$ \displaystyle x = \dfrac{\Delta_{x}}{\Delta} \\[0.8em] x = \dfrac{-2}{-\frac{7}{6}} \\[0.8em] x = \frac{12}{7} \approx 1.71 $$

Value of y:

$$ \displaystyle y = \dfrac{\Delta_{y}}{\Delta} \\[0.8em] y = \dfrac{-\frac{5}{2}}{-\frac{7}{6}} \\[0.8em] y = \frac{15}{7} \approx 2.14 $$

Therefore, the solution to the system is:

$$ \displaystyle \begin{cases} \displaystyle x = \frac{12}{7} \approx 1.71 \\[1em] \displaystyle y = \frac{15}{7} \approx 2.14 \end{cases} $$

6. Geometric interpretation.

The system can be represented graphically as two lines intersecting at a single point (the solution).

Graph on the Cartesian coordinate system of two intersecting lines representing equations of a 2x2 linear system. Example 2.
Use Cramer's rule to solve the linear system x + 2y = 4, 2x + 4y = 5.

Result

The given system is inconsistent (it has no solution).

Step-by-step solution

1. Identify the system to solve and its matrices.

The system of equations we are working with is:

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

We extract the coefficient matrix (the numbers multiplying the variables):

$$ \displaystyle A = \begin{bmatrix} 1 & 2 \\[0.5em] 2 & 4 \end{bmatrix} $$

We extract the constant matrix (the numbers on the right side of the equals sign):

$$ \displaystyle B = \begin{bmatrix} 4 \\[0.5em] 5 \end{bmatrix} $$

2. Calculate the system determinant (Δ).

We find the determinant of matrix A.

$$ \displaystyle \Delta = |A| = \begin{vmatrix} 1 & 2 \\[0.5em] 2 & 4 \end{vmatrix} \\[0.8em] \Delta = (1)(4) - (2)(2) \\[0.8em] \Delta = 0 $$

Since Δ = 0, the system is either consistent and dependent (infinite solutions) or inconsistent (no solution). To find out which case it is, we proceed to calculate the determinants for the variables.

3. Calculate the determinant for x (Δx).

In the system's matrix A, we replace the column corresponding to the variable x with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{x} = \begin{vmatrix} 4 & 2 \\[0.5em] 5 & 4 \end{vmatrix} \\[0.8em] \Delta_{x} = (4)(4) - (2)(5) \\[0.8em] \Delta_{x} = 6 $$

4. Determine the type of system.

By evaluating the results, we observe that the system determinant is zero and at least one variable determinant is non-zero. This means the system is inconsistent and has no solution.

5. Geometric interpretation.

The system can be represented graphically as two parallel lines that never intersect (no solution).

Graph on the Cartesian coordinate system of two parallel lines representing equations of a 2x2 linear system. Example 3.
Find the solution set of the system x + y + z = 6, 2x - y + z = 3, x + 2y - z = 2 by applying Cramer's rule.

Result

The solution to the system of equations is:

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

Step-by-step solution

1. Identify the system to solve and its matrices.

The system of equations we are working with is:

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

We extract the coefficient matrix (the numbers multiplying the variables):

$$ \displaystyle A = \begin{bmatrix} 1 & 1 & 1 \\[0.5em] 2 & -1 & 1 \\[0.5em] 1 & 2 & -1 \end{bmatrix} $$

We extract the constant matrix (the numbers on the right side of the equals sign):

$$ \displaystyle B = \begin{bmatrix} 6 \\[0.5em] 3 \\[0.5em] 2 \end{bmatrix} $$

2. Calculate the system determinant (Δ).

We find the determinant of matrix A.

$$ \displaystyle \Delta = |A| = \begin{vmatrix} 1 & 1 & 1 \\[0.5em] 2 & -1 & 1 \\[0.5em] 1 & 2 & -1 \end{vmatrix} \\[0.8em] \Delta = 7 $$

Since Δ ≠ 0, the system is consistent and independent, meaning it has a unique solution.

3. Calculate the determinant for x (Δx).

In the system's matrix A, we replace the column corresponding to the variable x with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{x} = \begin{vmatrix} 6 & 1 & 1 \\[0.5em] 3 & -1 & 1 \\[0.5em] 2 & 2 & -1 \end{vmatrix} \\[0.8em] \Delta_{x} = 7 $$

4. Calculate the determinant for y (Δy).

In the system's matrix A, we replace the column corresponding to the variable y with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{y} = \begin{vmatrix} 1 & 6 & 1 \\[0.5em] 2 & 3 & 1 \\[0.5em] 1 & 2 & -1 \end{vmatrix} \\[0.8em] \Delta_{y} = 14 $$

5. Calculate the determinant for z (Δz).

In the system's matrix A, we replace the column corresponding to the variable z with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{z} = \begin{vmatrix} 1 & 1 & 6 \\[0.5em] 2 & -1 & 3 \\[0.5em] 1 & 2 & 2 \end{vmatrix} \\[0.8em] \Delta_{z} = 21 $$

6. Find the values of the variables.

We divide the determinant of each variable by the system determinant to find the value of each variable.

Value of x:

$$ \displaystyle x = \dfrac{\Delta_{x}}{\Delta} \\[0.8em] x = \dfrac{7}{7} \\[0.8em] x = 1 $$

Value of y:

$$ \displaystyle y = \dfrac{\Delta_{y}}{\Delta} \\[0.8em] y = \dfrac{14}{7} \\[0.8em] y = 2 $$

Value of z:

$$ \displaystyle z = \dfrac{\Delta_{z}}{\Delta} \\[0.8em] z = \dfrac{21}{7} \\[0.8em] z = 3 $$

Therefore, the solution to the system is:

$$ \displaystyle \begin{cases} \displaystyle x = 1 \\[1em] \displaystyle y = 2 \\[1em] \displaystyle z = 3 \end{cases} $$
Solve the 3x3 linear system applying Cramer's rule: x + y = 2, y + z = 3, x + z = 4.

Result

The solution to the system of equations is:

$$ \displaystyle \begin{cases} \displaystyle x = \frac{3}{2} = 1.5 \\[1em] \displaystyle y = \frac{1}{2} = 0.5 \\[1em] \displaystyle z = \frac{5}{2} = 2.5 \end{cases} $$

Step-by-step solution

1. Identify the system to solve and its matrices.

The system of equations we are working with is:

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

We extract the coefficient matrix (the numbers multiplying the variables):

$$ \displaystyle A = \begin{bmatrix} 1 & 1 & 0 \\[0.5em] 0 & 1 & 1 \\[0.5em] 1 & 0 & 1 \end{bmatrix} $$

We extract the constant matrix (the numbers on the right side of the equals sign):

$$ \displaystyle B = \begin{bmatrix} 2 \\[0.5em] 3 \\[0.5em] 4 \end{bmatrix} $$

2. Calculate the system determinant (Δ).

We find the determinant of matrix A.

$$ \displaystyle \Delta = |A| = \begin{vmatrix} 1 & 1 & 0 \\[0.5em] 0 & 1 & 1 \\[0.5em] 1 & 0 & 1 \end{vmatrix} \\[0.8em] \Delta = 2 $$

Since Δ ≠ 0, the system is consistent and independent, meaning it has a unique solution.

3. Calculate the determinant for x (Δx).

In the system's matrix A, we replace the column corresponding to the variable x with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{x} = \begin{vmatrix} 2 & 1 & 0 \\[0.5em] 3 & 1 & 1 \\[0.5em] 4 & 0 & 1 \end{vmatrix} \\[0.8em] \Delta_{x} = 3 $$

4. Calculate the determinant for y (Δy).

In the system's matrix A, we replace the column corresponding to the variable y with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{y} = \begin{vmatrix} 1 & 2 & 0 \\[0.5em] 0 & 3 & 1 \\[0.5em] 1 & 4 & 1 \end{vmatrix} \\[0.8em] \Delta_{y} = 1 $$

5. Calculate the determinant for z (Δz).

In the system's matrix A, we replace the column corresponding to the variable z with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{z} = \begin{vmatrix} 1 & 1 & 2 \\[0.5em] 0 & 1 & 3 \\[0.5em] 1 & 0 & 4 \end{vmatrix} \\[0.8em] \Delta_{z} = 5 $$

6. Find the values of the variables.

We divide the determinant of each variable by the system determinant to find the value of each variable.

Value of x:

$$ \displaystyle x = \dfrac{\Delta_{x}}{\Delta} \\[0.8em] x = \dfrac{3}{2} = 1.5 $$

Value of y:

$$ \displaystyle y = \dfrac{\Delta_{y}}{\Delta} \\[0.8em] y = \dfrac{1}{2} = 0.5 $$

Value of z:

$$ \displaystyle z = \dfrac{\Delta_{z}}{\Delta} \\[0.8em] z = \dfrac{5}{2} = 2.5 $$

Therefore, the solution to the system is:

$$ \displaystyle \begin{cases} \displaystyle x = \frac{3}{2} = 1.5 \\[1em] \displaystyle y = \frac{1}{2} = 0.5 \\[1em] \displaystyle z = \frac{5}{2} = 2.5 \end{cases} $$
Find the solution (if it exists) to the following linear system using Cramer's rule: x + y + z = 1, x + y + z = 2, 2x - y + z = 3

Result

The given system is inconsistent (it has no solution).

Step-by-step solution

1. Identify the system to solve and its matrices.

The system of equations we are working with is:

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

We extract the coefficient matrix (the numbers multiplying the variables):

$$ \displaystyle A = \begin{bmatrix} 1 & 1 & 1 \\[0.5em] 1 & 1 & 1 \\[0.5em] 2 & -1 & 1 \end{bmatrix} $$

We extract the constant matrix (the numbers on the right side of the equals sign):

$$ \displaystyle B = \begin{bmatrix} 1 \\[0.5em] 2 \\[0.5em] 3 \end{bmatrix} $$

2. Calculate the system determinant (Δ).

We find the determinant of matrix A.

$$ \displaystyle \Delta = |A| = \begin{vmatrix} 1 & 1 & 1 \\[0.5em] 1 & 1 & 1 \\[0.5em] 2 & -1 & 1 \end{vmatrix} \\[0.8em] \Delta = 0 $$

Since Δ = 0, the system is either consistent and dependent (infinite solutions) or inconsistent (no solution). To find out which case it is, we proceed to calculate the determinants for the variables.

3. Calculate the determinant for x (Δx).

In the system's matrix A, we replace the column corresponding to the variable x with the constant matrix B and calculate the determinant:

$$ \displaystyle \Delta_{x} = \begin{vmatrix} 1 & 1 & 1 \\[0.5em] 2 & 1 & 1 \\[0.5em] 3 & -1 & 1 \end{vmatrix} \\[0.8em] \Delta_{x} = -2 $$

4. Determine the type of system.

By evaluating the results, we observe that the system determinant is zero and at least one variable determinant is non-zero. This means the system is inconsistent and has no solution.

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.