🧮
🧮 Math & statistics

Cramer’s Rule Calculator (solve Ax = b with determinants)

Results update as you type.

Your numbers

Understanding the Cramer's rule calculator — concept and principle

This calculator solves a square system of linear equations Ax = b with Cramer's rule, using determinants. It shows the main determinant D, each Dᵢ with b placed in column i, and every xᵢ = Dᵢ ÷ D. Use it for 2 × 2 and 3 × 3 systems in algebra and linear algebra courses, or to check an elimination solution.

Cramer's ruleSwap b into one column at a timeD21−1−3−12−212= −1D₁81−1−11−12−312= −2x₁: −2 ÷ −1 = 2x₂: −3 ÷ −1 = 3x₃: 1 ÷ −1 = −1xᵢ = Dᵢ ÷ Dx = (2, 3, −1)
Replace column i with b, take the determinant, and divide by det A.

How it is calculated

D = det(A)

Aᵢ = A with its i-th column replaced by b; Dᵢ = det(Aᵢ)

xᵢ = Dᵢ ÷ D, for i = 1 … n

The principle

The determinant measures how A scales volume. Replacing column i by b and comparing determinants isolates the i-th unknown: because b = x₁(column 1) + … + xₙ(column n), and a determinant is linear in each column while vanishing when two columns are equal, det(Aᵢ) works out to exactly xᵢ × det(A). Dividing gives xᵢ. The formula is elegant and gives closed-form answers for symbolic systems, but it is slow for large n compared with elimination.

Worked example

Default inputs: A = [2 1 −1; −3 −1 2; −2 1 2], b = (8, −11, −3).

  1. D = det(A) = −1.
  2. D₁ = det[8 1 −1; −11 −1 2; −3 1 2] = 8(−2 − 2) − 1(−22 + 6) − 1(−11 − 3) = −32 + 16 + 14 = −2.
  3. Likewise D₂ = −3 and D₃ = 1, so Dᵢ = −2, −3, 1.
  4. xᵢ = Dᵢ ÷ D = 2, 3, −1.
  5. Solution x = (2, 3, −1), from 4 determinants.

How to read the result

Substitute the solution back: 2(2) + 3 − (−1) = 8, −3(2) − 3 + 2(−1) = −11 and −2(2) + 3 + 2(−1) = −3, all as required. A determinant D close to zero relative to the entries warns that the system is nearly singular and the answer is sensitive to small changes in the data.

Common mistakes

Keep in mind: For large or nearly singular systems, Cramer's rule is slow and numerically unreliable; use elimination or a matrix library.

Frequently asked questions

What is Cramer's rule?

A formula xᵢ = det(Aᵢ) ÷ det(A) for the solution of a square system with det(A) ≠ 0.

What if the determinant is zero?

Cramer's rule does not apply; the system has no unique solution.

Is Cramer's rule practical for big systems?

No, it needs n + 1 determinants; elimination is far cheaper.

Sources: A. Davis, P. Zachlin et al., Coordinated Linear Algebra (University of Nebraska–Lincoln), §5.3 Cramer's Rule · D. Margalit & J. Rabinoff, Interactive Linear Algebra, §4.2

Checked 9 Nov 2026. Coordinated Linear Algebra (University of Nebraska–Lincoln), §5.3 Extra Topic: Cramer’s Rule — Theorem 5.3.3 (A nonsingular: x(i) = det(A(i)(b))/det(A), A(i)(b) = A with column i replaced by b; Example 5.3.1). D. Margalit & J. Rabinoff, Interactive Linear Algebra, §4.2, Theorem 4.2.3.

🧮 All math & statistics tools →🌍 Calculators by country →