Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Linear Algebra formulas

Cramer’s rule

Express each coordinate of a unique square-system solution using determinants.

Linear Algebra · Systems
$$A\mathbf x=\mathbf b,\qquad x_i=\frac{\det(A_i)}{\det(A)}$$

Cramer’s rule is one of 2 systems formulas in the linear algebra section of this library, and it is used at high school · university level.

Why cramer’s rule works

Determinants measure volume, and replacing one column of A with b builds the box you would get after the solution has scaled that column. Comparing the new volume with the original one leaves precisely the coordinate that did the scaling, so each unknown pops out as a ratio of two determinants.

What each symbol means

$A_i$ replaces column $i$ of $A$ with $\mathbf b$.

Cramer’s rule: when it holds

$A$ must be square and $\det(A)\ne0$; elimination is usually faster for large systems.

When it stops applying

The rule breaks the moment det A = 0, because every coordinate would need a division by zero. That case is exactly when the system has no unique solution, so the rule has nothing to report and you must switch to row reduction to see whether there are none or infinitely many.

Cramer’s rule: a worked example

For a two-variable system, replace one coefficient column at a time and divide its determinant by $\det(A)$.

The mistake to avoid

What people do: Students swap b into a row of the matrix rather than into a column.

Why it goes wrong: Each column of A holds the coefficients of one variable, so only a column swap corresponds to solving for that variable. A row swap mixes different equations together and gives a meaningless number.

Do this instead: Replace the column belonging to the unknown you want. For x + y = 5 and x − y = 1, det A = −2, replacing the first column gives −6 so x = 3, and replacing the second gives −4 so y = 2.

Cramer’s rule: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $A_i$ replaces column $i$ of $A$ with $\mathbf b$.
  3. Check the conditions before substituting. $A$ must be square and $\det(A)\ne0$; elimination is usually faster for large systems.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most linear algebra slips.

Where this formula fits

Subject
Linear Algebra formulas — 17 entries in this library
Topic
Systems
Level
High school · University

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where cramer’s rule comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about cramer’s rule

Is it faster than elimination?

Only for very small systems. It needs n + 1 determinants, and the cost of determinants grows far faster than elimination does, so by 4 by 4 it is already the slower choice.

Can I use it on a system with more equations than unknowns?

No. The rule needs a square coefficient matrix with a nonzero determinant. Overdetermined systems get handled by least squares instead.

Why is it still taught?

Because it gives each unknown as a clean formula in the coefficients rather than a procedure. That matters in proofs and in theory work, where you need to see how a solution depends on the inputs.

Can I use it to find just one variable?

Yes, and that is where it shines. If a problem asks only for z, you compute two determinants and skip the rest, while elimination would make you solve for everything.

Stuck on a problem?

Work a cramer’s rule problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.