🏆 US-Registered Digital Marketing Agency
Advertisement
Advertisement
LINEAR ALGEBRA

Cramer's Rule Calculator — every determinant shown

Solve a system of 2, 3 or 4 linear equations by Cramer's rule and see the main determinant and each replaced-column determinant behind the answer.

Put the coefficients first and the constant last. Three lines of four numbers means three equations in three unknowns. Two to four equations are supported.
Comma separated. Only the first n are used.
Trailing zeros are trimmed, so whole-number solutions display cleanly.
Solution
 
 
0
Main determinant D
0
D for the 1st unknown
0
D for the 2nd unknown
0
Largest residual |Ax − b|
Tip: the residual in the last cell is the honest check. It substitutes the answer back into every original equation and reports the worst mismatch. Anything much above zero means the system is close to singular and the division has amplified rounding.
Advertisement

The Cramer's rule calculator above solves a square system of linear equations the way the rule prescribes: one main determinant for the coefficient matrix, then one more determinant for each unknown, each formed by replacing that unknown's column with the constants. Every determinant it computes is displayed, not just the final answer, because the intermediate values are what a homework question asks for and what a check by hand needs.

Arb Digital publishes free calculators that show their working rather than emitting one number. Cramer's rule is a good candidate, because the mechanical part — building four separate matrices and expanding each — is where mistakes creep in, while the conceptual part is a single line. The tool also substitutes the answer back into the original equations and reports the worst residual, which catches the failure mode that a determinant-only page cannot see.

What This Cramer's Rule Calculator Does

It accepts an augmented matrix of two, three or four equations, computes the determinant of the coefficient matrix by exact cofactor expansion, computes the replaced-column determinant for every unknown, and divides. When the main determinant is zero it does not stop at "no unique solution" — it inspects the replaced-column determinants as well, which distinguishes an inconsistent system with no solutions at all from a dependent system with infinitely many.

Three live tools sit next to this one and each has a clear boundary. Our determinant calculator computes a single determinant and stops there; it does not solve anything. Our matrix calculator does general matrix arithmetic — multiplication, transposes, inverses — without framing the problem as a system of equations. Our system of equations calculator solves the same systems by elimination and stops at three unknowns, and elimination is a different method that produces a different set of intermediate values. This page is specifically the determinant route, extended to four unknowns, with every determinant on display.

How to Use It

  1. Write each equation in standard form. All variables on the left in the same order, the constant alone on the right. An equation like 3x = 7 − 2y must be rearranged to 3x + 2y = 7 first.
  2. Type one line per equation. Coefficients in order, then the constant. A missing variable is a zero, and leaving it out shifts every column.
  3. Keep the matrix square. Three equations need four numbers each; four equations need five. Cramer's rule applies only when the number of equations equals the number of unknowns.
  4. Name your variables if you like. The labels feed straight into the solution line so the output reads like the question.
  5. Check the residual. A residual of zero means the solution satisfies every original equation exactly. A large one is a warning, not a rounding curiosity.

The Formula and How It's Calculated

For a system written as Ax = b with A square and det(A) ≠ 0, Cramer's rule states that xₕ = det(Aₕ) ÷ det(A), where Aₕ is A with its i-th column replaced by the constant vector b. Every unknown is an independent quotient of two determinants, which is the property that makes the rule useful when you want one variable and not the rest.

Work the default through. The system is 2x + y − z = 8, −3x − y + 2z = −11 and −2x + y + 2z = −3. Expanding the coefficient matrix along its first row gives D = 2(−2 − 2) − 1(−6 + 4) + (−1)(−3 − 2) = −8 + 2 + 5 = −1. Replacing the first column with the constants gives Dₓ = −2, the second gives Dₖ = −3, and the third gives Dₛ = 1. Dividing each by D = −1 gives x = 2, y = 3 and z = −1, which you can substitute straight back into all three equations to confirm.

The determinant itself is computed by cofactor expansion rather than by row reduction, so for integer inputs the intermediate values stay exact and match what you would get by hand. Wolfram MathWorld's entry on Cramer's rule derives the general n-dimensional statement and the conditions under which it holds.

Advertisement

What a Zero Main Determinant Actually Tells You

Cramer's rule requires det(A) ≠ 0. When the main determinant is zero the coefficient matrix is singular, the rows are linearly dependent, and the rule cannot divide. But "no unique solution" is two very different situations, and the replaced-column determinants tell them apart.

If D = 0 and at least one Dₕ is non-zero, the system is inconsistent: the equations contradict each other and there is no solution. Geometrically, in three variables, you have planes arranged so that no point lies on all of them — parallel planes, or three planes meeting in a triangular prism. If D = 0 and every Dₕ is also zero, the equations are dependent: at least one carries no information the others did not already supply, and the solution set is an infinite line or plane rather than a point.

The calculator reports which of the two you have. That distinction matters far more than the fact that the rule failed, because it tells you whether to look for an error in your data or to accept that the system genuinely under-determines the answer. Our linear independence calculator tests the same dependence condition on a set of vectors directly, without the constants attached.

Why Cramer's Rule Is Taught but Rarely Used in Practice

The rule is exact, elegant and completely explicit, which makes it excellent for teaching and for algebraic derivations. It is also the wrong tool for solving large systems numerically, for two independent reasons that are worth knowing.

The first is cost. Solving an n × n system needs n + 1 determinants. Computed by cofactor expansion, each determinant costs on the order of n factorial operations, so a 10 × 10 system becomes astronomically expensive while Gaussian elimination handles the same problem in a fraction of a second. Even with determinants computed efficiently by LU factorisation, the rule still does several times the work of solving the system once directly.

The second reason is accuracy. Each unknown is a ratio of two determinants that were computed independently. When the matrix is close to singular, both determinants are small, and the relative error in their quotient can be far larger than the error in either one. Elimination with partial pivoting keeps error under control in a way that separate determinant division does not. MIT's 18.06 Linear Algebra course on OpenCourseWare covers both the rule and the elimination methods that replace it in computation. This is exactly why this page reports a residual: it makes the accuracy question visible instead of leaving it implicit.

Where the Rule Genuinely Wins

Two situations still favour Cramer's rule, and neither is about speed. The first is when you want one unknown and do not care about the others. Elimination forces you to solve the whole system before back-substitution gives you anything; Cramer's rule delivers a single variable as one quotient. In circuit analysis, where a mesh-current formulation might have six unknowns and you only need the current in one branch, that is a real saving in hand calculation.

The second is symbolic work. When the entries are letters rather than numbers, elimination produces branching cases depending on whether each pivot is zero, and the algebra becomes unmanageable. Cramer's rule gives a closed-form expression for each unknown as a ratio of two determinants, which can then be differentiated, examined for sign, or taken to a limit. That is why the rule survives in economics and in engineering derivations long after it has been retired from numerical code. Once you have the closed form, our matrix inverse calculator shows the closely related adjugate construction, since the inverse is the adjugate divided by exactly the determinant D this page computes.

Reading a Small Determinant as a Warning

A determinant that is not zero but is small relative to the size of the entries is a near-singular system, and near-singular systems are unstable in a way that a clean-looking answer hides. Change one coefficient in the third decimal place and the solution can move substantially. The equations describe planes that are almost parallel, so the point where they meet is poorly pinned down.

This matters whenever the coefficients are measured rather than exact. A regression normal-equation system built from highly correlated predictors is exactly this situation, which is why collinear predictors produce wildly unstable coefficients. If the residual reported above is not essentially zero, or if D is tiny next to the entries you typed, treat the individual numbers in the solution with suspicion even though the arithmetic was performed correctly. Our linear regression calculator is where that instability shows up most often in practice.

There is a quick sanity test you can do without any extra machinery. Scale every equation so its largest coefficient is 1, then recompute. If D is now far below one in magnitude — say under a thousandth — the system is ill-conditioned regardless of how tidy the original numbers looked. A determinant of 25 on a matrix whose entries run to 3 is healthy; a determinant of 0.004 on the same matrix is not. The absolute size of D means nothing on its own, which is why comparing it to the scale of the entries is the check worth doing.

Need the model behind your reporting checked?

Arb Digital builds attribution and forecasting models that report their own uncertainty instead of presenting one confident number.

Browse All Free Tools Talk To Our Team

Common Mistakes to Avoid

  • Omitting a zero coefficient — an equation without y still needs a 0 in the y column, or every later column shifts and the determinants are computed from the wrong matrix.
  • Replacing a row instead of a column — the constants go into the column belonging to the unknown you are solving for, never into a row.
  • Forgetting to rearrange first — variables must all be on the left and the constant alone on the right before any coefficient is read off.
  • Applying the rule to a non-square system — Cramer's rule needs exactly as many equations as unknowns, and no amount of determinant arithmetic rescues an under- or over-determined system.
  • Treating D = 0 as a single outcome — it means no solution when some replaced determinant is non-zero, and infinitely many when all of them vanish.

Related Free Tools From Arb Digital

Compute a single determinant with the determinant calculator, do general matrix arithmetic with the matrix calculator, solve the same systems by elimination with the system of equations calculator, invert a matrix with the matrix inverse calculator, or test a vector set for dependence with the linear independence calculator. The full free online tools hub lists every mathematics tool we publish.

Frequently Asked Questions

What is Cramer's rule?

It solves a square system of linear equations by dividing determinants. Each unknown equals the determinant of the coefficient matrix with that unknown's column replaced by the constants, divided by the determinant of the coefficient matrix itself.

When can Cramer's rule not be used?

When the system is not square, or when the determinant of the coefficient matrix is zero. A zero determinant means the rows are linearly dependent and there is no unique solution to divide out.

What does it mean if the main determinant is zero?

If at least one replaced-column determinant is non-zero the system is inconsistent and has no solution. If every replaced-column determinant is also zero the equations are dependent and there are infinitely many solutions.

How many determinants does the rule need?

One more than the number of unknowns. A three-variable system needs four determinants in total: the main one plus one for each variable.

Is Cramer's rule faster than elimination?

No. For anything beyond about three unknowns it is substantially slower, because the number of determinants and the cost of each both grow with the size of the system.

Why does the calculator report a residual?

Because dividing two independently computed determinants can amplify rounding error when the system is close to singular. Substituting the answer back into the original equations is the direct way to see whether that happened.

Does this work with decimal or negative coefficients?

Yes. Any real numbers are accepted, including negatives and decimals. Integer inputs give exact determinants, and decimal inputs are handled to the precision you choose.

Advertisement
Advertisement

Take it further