Cramer's Rule Calculator

Use this Cramer's Rule Calculator to enter values, adjust options, and review results in a compact responsive workspace.

Results are calculated automatically as you enter data.

Augmented matrix [A|b]
System Size (Variables):
3

Determinants and steps
Solution Enter a valid system.

▼ See explanations and tips below ▼

What Is Cramer's Rule?

Cramer's Rule is a determinant-based method for solving a square system of linear equations. A square system has the same number of equations as variables, so it can be written in matrix form as:

$$ A\mathbf{x} = \mathbf{b} $$

Here, \(A\) is the coefficient matrix, \(\mathbf{x}\) is the column of unknown variables, and \(\mathbf{b}\) is the column of constants on the right side of the equations.

The main idea is simple: instead of using substitution or elimination to solve for each variable, Cramer's Rule compares determinants. First, it finds the determinant of the coefficient matrix. Then, for each variable, it replaces that variable's coefficient column with the constants column and finds a new determinant.

When the original determinant is not zero, each variable is found by dividing one replacement determinant by the original determinant.

Cramer's Rule is especially useful for understanding how determinants connect to systems of equations. It shows that a nonzero determinant means the coefficient matrix is invertible, so the system has one unique solution. A zero determinant means Cramer's Rule cannot produce a unique result, and the system must be checked another way.


Why Cramer's Rule Matters

Cramer's Rule matters because it connects three important ideas in algebra and linear algebra:

  • Solving systems of linear equations
  • Determinants of square matrices
  • Whether a system has one solution, no solution, or infinitely many solutions

For small systems, Cramer's Rule gives a clear formula for each variable. This makes it helpful in classwork, examples, and checking answers. It also helps explain why the determinant of the coefficient matrix is so important: if that determinant is zero, the equations do not determine one unique point of intersection.

For larger systems, Cramer's Rule is usually not the fastest hand or computer method because it requires several determinant calculations. Gaussian elimination, row reduction, matrix inverses, or numerical linear algebra methods are often more efficient. Still, Cramer's Rule remains valuable because it gives a direct formula and a strong conceptual link between determinants and solutions.


Key Terms to Know

  • Linear system: A set of linear equations involving the same variables.
  • Square system: A system with \(N\) equations and \(N\) variables.
  • Coefficient matrix \(A\): The matrix made from the variable coefficients only.
  • Constants vector \(\mathbf{b}\): The column of right-hand-side constants.
  • Augmented matrix \([A \mid \mathbf{b}]\): The coefficient matrix with the constants column attached.
  • Determinant \(\det(A)\): A number associated with a square matrix. For Cramer's Rule, it tells whether the coefficient matrix can produce a unique solution.
  • Replacement determinant \(D_i\): The determinant found by replacing column \(i\) of \(A\) with \(\mathbf{b}\).
  • Rank: The number of independent rows or columns in a matrix. Rank helps classify singular systems.
  • Singular matrix: A square matrix with determinant \(0\).
  • Consistent system: A system with at least one solution.
  • Inconsistent system: A system with no solution.
  • Dependent system: A system whose equations do not determine one unique solution, often because one equation repeats information from another.

How Cramer's Rule Works

Suppose a square linear system is written as:

$$ A\mathbf{x} = \mathbf{b} $$

For an \(N \times N\) coefficient matrix \(A\), define:

$$ D = \det(A) $$

For each variable \(x_i\), create a new matrix \(A_i\) by replacing column \(i\) of \(A\) with the constants vector \(\mathbf{b}\). Then define:

$$ D_i = \det(A_i) $$

If \(D \ne 0\), Cramer's Rule gives:

$$ x_i = \frac{D_i}{D} $$

This formula works because replacing a column isolates how much of that column is needed to build the constants vector. The determinant acts like a scale factor. Dividing the replacement determinant by the original determinant gives the corresponding variable value.

For a two-variable system,

$$ \begin{aligned} a_1x + b_1y &= c_1 \\ a_2x + b_2y &= c_2 \end{aligned} $$

The coefficient determinant is:

$$ D = \begin{vmatrix} a_1 & b_1 \\ a_2 & b_2 \end{vmatrix} = a_1b_2 - a_2b_1 $$

The replacement determinants are:

$$ D_x = \begin{vmatrix} c_1 & b_1 \\ c_2 & b_2 \end{vmatrix} \quad \text{and} \quad D_y = \begin{vmatrix} a_1 & c_1 \\ a_2 & c_2 \end{vmatrix} $$

When \(D \ne 0\), the solution is:

$$ x = \frac{D_x}{D} \quad \text{and} \quad y = \frac{D_y}{D} $$

When \(D = 0\), the fractions in Cramer's Rule involve division by zero, so the rule cannot give one unique solution. In that case, rank is a better diagnostic tool:

  • If \(\operatorname{rank}(A) < \operatorname{rank}([A \mid \mathbf{b}])\), the system is inconsistent and has no solution.
  • If \(\operatorname{rank}(A) = \operatorname{rank}([A \mid \mathbf{b}]) < N\), the system is dependent and has infinitely many solutions.
  • If \(\operatorname{rank}(A) = \operatorname{rank}([A \mid \mathbf{b}]) = N\), the system has a unique solution. For a square system, this is the same situation as \(\det(A) \ne 0\).

Examples of Cramer's Rule in Practice

Example 1: A two-variable system

Solve:

$$ \begin{aligned} 2x + y &= 8 \\ 5x - 3y &= 1 \end{aligned} $$

The coefficient matrix and constants vector are:

$$ A = \begin{bmatrix} 2 & 1 \\ 5 & -3 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 8 \\ 1 \end{bmatrix} $$

First find the coefficient determinant:

$$ D = \begin{vmatrix} 2 & 1 \\ 5 & -3 \end{vmatrix} = 2(-3) - 5(1) = -11 $$

Because \(D \ne 0\), the system has a unique solution.

For \(x\), replace the first column with the constants column:

$$ D_x = \begin{vmatrix} 8 & 1 \\ 1 & -3 \end{vmatrix} = 8(-3) - 1(1) = -25 $$

So:

$$ x = \frac{D_x}{D} = \frac{-25}{-11} = \frac{25}{11} $$

For \(y\), replace the second column with the constants column:

$$ D_y = \begin{vmatrix} 2 & 8 \\ 5 & 1 \end{vmatrix} = 2(1) - 5(8) = -38 $$

So:

$$ y = \frac{D_y}{D} = \frac{-38}{-11} = \frac{38}{11} $$

The solution is:

$$ \left(x, y\right) = \left(\frac{25}{11}, \frac{38}{11}\right) $$

Example 2: A three-variable system

Consider this system:

$$ \begin{aligned} 2x_1 - x_2 + 3x_3 &= 9 \\ x_1 + x_2 + x_3 &= 6 \\ 3x_1 - 2x_2 + x_3 &= 7 \end{aligned} $$

The coefficient matrix and constants vector are:

$$ A = \begin{bmatrix} 2 & -1 & 3 \\ 1 & 1 & 1 \\ 3 & -2 & 1 \end{bmatrix}, \quad \mathbf{b} = \begin{bmatrix} 9 \\ 6 \\ 7 \end{bmatrix} $$

The coefficient determinant is:

$$ D = \det(A) = -11 $$

The replacement determinants are:

$$ D_1 = -31, \quad D_2 = -17, \quad D_3 = -18 $$

Therefore:

$$ x_1 = \frac{D_1}{D} = \frac{-31}{-11} = \frac{31}{11} $$
$$ x_2 = \frac{D_2}{D} = \frac{-17}{-11} = \frac{17}{11} $$
$$ x_3 = \frac{D_3}{D} = \frac{-18}{-11} = \frac{18}{11} $$

So the solution is:

$$ \left(x_1, x_2, x_3\right) = \left(\frac{31}{11}, \frac{17}{11}, \frac{18}{11}\right) $$

As decimals, this is approximately:

$$ \left(x_1, x_2, x_3\right) \approx \left(2.81818182, 1.54545455, 1.63636364\right) $$

Example 3: A dependent system

Consider:

$$ \begin{aligned} x + 2y &= 3 \\ 2x + 4y &= 6 \end{aligned} $$

The second equation is just twice the first equation. The coefficient determinant is:

$$ D = \begin{vmatrix} 1 & 2 \\ 2 & 4 \end{vmatrix} = 1(4) - 2(2) = 0 $$

Cramer's Rule cannot give one unique solution. The ranks are:

$$ \operatorname{rank}(A) = 1 \quad \text{and} \quad \operatorname{rank}([A \mid \mathbf{b}]) = 1 $$

The ranks match, but they are less than the number of variables. The system is dependent and has infinitely many solutions.


Example 4: An inconsistent system

Now change only the second constant:

$$ \begin{aligned} x + 2y &= 3 \\ 2x + 4y &= 7 \end{aligned} $$

The left side of the second equation is still twice the left side of the first, but the right side is not twice \(3\). The coefficient determinant is still \(0\), but the ranks are different:

$$ \operatorname{rank}(A) = 1 \quad \text{and} \quad \operatorname{rank}([A \mid \mathbf{b}]) = 2 $$

Because the augmented matrix has higher rank than the coefficient matrix, the system is inconsistent and has no solution.


How to Interpret the Result

A unique-solution result means the displayed values of \(x_1, x_2, \ldots, x_N\) solve the entered system within the calculator's numerical precision.

The determinant \(D = \det(A)\) is the key value. When it is nonzero, Cramer's Rule can divide each replacement determinant by \(D\) to find the variables. A larger or smaller determinant is not automatically “better” or “worse”; what matters for uniqueness is whether the determinant is zero or nonzero.

Each \(D_i\) value shows what happens when the \(i\)th coefficient column is replaced with the constants vector. The displayed formula:

$$ x_i = \frac{D_i}{D} $$

shows exactly how that variable was calculated.

When the coefficient matrix is rank-deficient, the rank values explain the status of the system:

Result pattern Meaning
\(D \ne 0\) Unique solution by Cramer's Rule
\(D = 0\) and \(\operatorname{rank}(A) = \operatorname{rank}([A \mid \mathbf{b}])\) Dependent system with infinitely many solutions
\(D = 0\) and \(\operatorname{rank}(A) < \operatorname{rank}([A \mid \mathbf{b}])\) Inconsistent system with no solution

Displayed decimals may be rounded for readability. A value shown as a terminating decimal may represent a fraction or a repeating decimal in exact form.


Common Mistakes and Misconceptions

One common mistake is forgetting the constants column when pasting an augmented matrix. A valid augmented matrix for \(N\) variables must have \(N\) rows and \(N + 1\) columns: \(N\) coefficient columns plus one constants column.

Another mistake is confusing the coefficient matrix \(A\) with the augmented matrix \([A \mid \mathbf{b}]\). Cramer's Rule uses \(\det(A)\) as the denominator. The augmented matrix is useful for organizing the system and checking ranks, but it is not the determinant used in the denominator.

Some users also expect Cramer's Rule to return one solution even when \(\det(A) = 0\). It cannot do that. A zero determinant means the coefficient matrix is singular, so the system either has no solution or has infinitely many solutions. Rank checks are needed to tell those cases apart.

Rounding is another source of confusion. For nearly singular systems, a very small determinant can make the solution sensitive to small input changes. Rounding the input, rounding intermediate values, or using decimal approximations can noticeably affect the displayed result.

Finally, pasted data should contain plain numeric values. Row labels, variable names, brackets, and fraction strings such as 1/2 are not the same as decimal numbers in this calculator's input format.


When to Use Cramer's Rule

Use Cramer's Rule when the system is square and you want a determinant-based solution method. It is especially appropriate for:

  • Learning how determinants solve linear systems
  • Solving small \(2 \times 2\) or \(3 \times 3\) systems by hand
  • Checking a system with the same number of equations and variables
  • Comparing determinant-based methods with elimination or matrix inverse methods
  • Understanding why a zero determinant prevents a unique solution

For large systems, systems with many zero coefficients, or systems that need high numerical stability, row-reduction methods are usually more practical. Cramer's Rule remains useful as a formula and teaching tool, even when another method is faster for computation.


Limitations and Things to Keep in Mind

Cramer's Rule applies directly to square systems. It is not designed for systems with a different number of equations and variables.

This calculator supports systems from \(2 \times 2\) through \(6 \times 6\). It works with finite real-number entries and treats blank coefficient or constant cells as \(0\). It does not support complex numbers, symbolic coefficients, or pasted fraction strings such as 1/2. To avoid silently rounding a large whole-number literal, the paste importer rejects integer tokens outside JavaScript's safe-integer range; use explicit scientific notation when a floating-point approximation is intended.

The calculations are numerical, not exact symbolic algebra. To avoid confusing an underflowed or overflowed determinant with a singular matrix, the calculator classifies the system from row-scaled pivot ranks and shows the relative pivot threshold used for that numerical check. A small scaled pivot can still make the solution sensitive to input changes.

Most determinant and solution values are displayed with up to 8 decimal places, and very large or very small values may be displayed in exponential notation. That formatting helps readability, but it can hide exact fractional values or tiny numerical differences.

Because the calculator uses unitless coefficients and constants, it does not attach physical units to the output. If your equations come from a real-world problem, the units of the variables must come from the model you entered, not from Cramer's Rule itself.

For graded assignments, engineering work, scientific modeling, finance, safety-related calculations, or official decisions, double-check the setup and verify the result with an appropriate method or qualified professional.


How to Use This Calculator

  1. Choose the system size from 2 to 6 variables.
  2. Enter each equation's coefficients under \(x_1, x_2, \ldots, x_N\).
  3. Enter each equation's right-hand-side value in the Constant \(b\) column.
  4. Optionally paste an augmented matrix with \(N\) rows and \(N + 1\) columns. Rows should be separated by line breaks, and values may be separated by commas, spaces, semicolons, or tabs.
  5. Review the solution, the determinant \(D\), the replacement determinants \(D_i\), the matrix ranks, and the step cards.

A pasted matrix must contain only numeric finite values. Each row must have the same number of entries, and the imported matrix must match the required augmented shape.


Frequently Asked Questions

What does \(\det(A) = 0\) mean in Cramer's Rule?

It means the coefficient matrix is singular, so the Cramer's Rule denominator is zero. The system does not have a unique determinant-based solution. It may have no solution or infinitely many solutions, depending on the ranks of \(A\) and \([A \mid \mathbf{b}]\).


Why does Cramer's Rule replace one column at a time?

Each replacement matrix tests how the constants vector fits into the role of one variable's coefficient column. The ratio \(D_i / D\) gives the amount of that variable needed in the solution, as long as the original determinant \(D\) is nonzero.


Can Cramer's Rule solve any linear system?

No. Cramer's Rule is for square systems with the same number of equations and variables. It gives a unique solution only when the determinant of the coefficient matrix is nonzero.


Why does the calculator show ranks?

Ranks help explain what happens when \(\det(A)\) is zero. If the coefficient rank and augmented rank are different, the system has no solution. If the ranks match but are less than the number of variables, the system has infinitely many solutions.


Why do I see decimals instead of exact fractions?

The calculator formats numerical results for readability. A displayed decimal may be an approximation of an exact fraction, especially when the solution involves repeating decimals such as \(31 / 11\).


Can I paste fractions like 1/2?

No. Use decimal values such as 0.5 instead. The paste input is meant for plain numeric entries separated by commas, spaces, semicolons, tabs, or line breaks.


Sources and References

Books and Open Textbooks

  1. Jay Abramson. College Algebra 2e. OpenStax, 2021. Section 7.8, “Solving Systems with Cramer's Rule.” OpenStax. Accessed June 28, 2026.
  2. Carl Stitz and Jeff Zeager. Precalculus. Section 8.5, “Determinants and Cramer's Rule.” Mathematics LibreTexts edition of Stitz-Zeager source content. Mathematics LibreTexts. Accessed June 28, 2026.
  3. Dan Margalit and Joseph Rabinoff. Interactive Linear Algebra. Section 4.1, “Determinants: Definition.” Mathematics LibreTexts edition of Georgia Tech source content. Mathematics LibreTexts. Accessed June 28, 2026.
  4. Autar Kaw. Introduction to Matrix Algebra. Section 1.5, “System of Equations.” Mathematics LibreTexts edition of Math for College source content. Mathematics LibreTexts. Accessed June 28, 2026.