Home Blog Tools

Cramer's Rule Calculator

Solve any square system of linear equations Ax = b using Cramer's Rule — with full determinant calculations for D, D1, D2, … shown step by step.

System Setup
Enter coefficients of the system Ax = b. The last column (highlighted in yellow) is the right-hand side b.
Cramer's Rule — Theory
Cramer's Rule: For a system $Ax = b$ where $A$ is an $n \times n$ matrix with $\det(A) \neq 0$, the unique solution is: $$x_i = \dfrac{D_i}{D}, \quad i = 1, 2, \ldots, n$$ where $D = \det(A)$ and $D_i = \det(A_i)$, with $A_i$ being the matrix $A$ with its $i$-th column replaced by the vector $b$.
When does Cramer's Rule apply?
• If $D \neq 0$: unique solution exists — Cramer's Rule gives it directly.
• If $D = 0$ and all $D_i = 0$: infinitely many solutions (dependent system).
• If $D = 0$ and any $D_i \neq 0$: no solution (inconsistent system).
Computational note: Cramer's Rule is elegant and exact, but computationally expensive for large $n$ (requires $n+1$ determinant calculations, each costing $O(n!)$ naively). It is most practical for $n \leq 4$ and ideal for exam problems.

Cramer's rule: how it works

For a square system Ax = b with det(A) ≠ 0, the unique solution is x(i) = det(A(i)) / det(A), where A(i) is A with its i-th column replaced by b. The rule is neat for small systems but expensive for large ones, where elimination is faster. If det(A) = 0 the rule does not apply: the system then has either no solution or infinitely many.

Common questions

When can Cramer's rule be used?

Only when the coefficient matrix is square and its determinant is not zero.

What if the determinant is zero?

Use Gauss-Jordan elimination to decide whether the system has no solution or infinitely many.

More tools: all free maths calculators · previous year papers · practice quizzes