Cramer's Rule Calculator - Linear Systems & Determinants

Solve 2×2 and 3×3 systems of linear equations using Cramer's Rule. Enter the coefficient matrix and constants to get exact solutions with determinant steps.

Select the system size, enter the coefficient matrix and constants vector, then click Solve to see the solution and all intermediate determinants.

Cramer's Rule Calculator - Linear Systems & Determinants
Solve 2×2 and 3×3 systems of linear equations using Cramer's Rule. Enter the coefficient matrix and constants to get exact solutions with determinant steps.

Enter rows separated by semicolons (;) and elements by commas (,)

Enter constants separated by commas (,)

About the Cramer's Rule calculator

Cramer's Rule is a theorem in linear algebra that provides an explicit formula for the solution of a system of linear equations with as many equations as unknowns, when the system has a unique solution. Named after the Swiss mathematician Gabriel Cramer who published it in 1750, the rule expresses the value of each unknown as a ratio of two determinants: the numerator determinant is obtained from the coefficient matrix by replacing the column corresponding to that unknown with the constants vector, and the denominator is the determinant of the original coefficient matrix. For a 2×2 system ax + by = e, cx + dy = f, the coefficient matrix is A = [[a,b],[c,d]] and the determinant D = ad − bc. If D ≠ 0, the unique solution is x = (ed − bf)/D and y = (af − ce)/D. For a 3×3 system, four determinants must be computed — one for the coefficient matrix and one for each variable's substituted matrix. The requirement that D ≠ 0 is essential. When D = 0, the coefficient matrix is singular, which means either the system has no solution (the equations are contradictory) or it has infinitely many solutions (the equations are redundant). Cramer's Rule cannot determine which case applies — you must use other methods such as Gaussian elimination or row reduction for singular systems. Cramer's Rule has important theoretical properties even when it is not the most efficient computational method. It gives an explicit closed-form expression for each variable, which is useful in symbolic algebra, sensitivity analysis, and proofs. For example, when all coefficients and constants are integers, the rule guarantees that the numerator and denominator of each solution are also integers — so rational inputs always produce rational solutions. This rational-preservation property is exploited in exact arithmetic computation. From a computational perspective, Cramer's Rule is practical for 2×2 and 3×3 systems because the determinant calculations are fast. For larger systems, Gaussian elimination is far more efficient (O(n³) vs O(n!) for naive determinant expansion), but for the small systems this calculator addresses, Cramer's Rule provides clear, step-by-step insight into the solution process. The determinant values reported in the result panel let you verify each step independently.

Cramer's Rule examples

Systems of different sizes with their step-by-step determinant solutions.

SystemSolutionNotes
2x + y = 5, x + 3y = 4x = 2.2, y = 0.6Matrix: 2,1;1,3, constants: 5,4 — D=5, Dx=11, Dy=3 → x=2.2, y=0.6.
2x + 3y = 13, x − y = 0x = 2.6, y = 2.6Matrix: 2,3;1,-1 — both variables equal. D=−5, Dx=−13, Dy=−13 → x=y=2.6.
x + 2y + 3z = 14, 2x + y + 2z = 10, 3x + 2y + z = 10x = 1, y = 2, z = 33×3 system with integer solution. D=8, Dx=8, Dy=16, Dz=24 → x=1, y=2, z=3.

How to use the Cramer's Rule calculator

  1. Select the system size: 2×2 for two-variable systems or 3×3 for three-variable systems.
  2. Enter the coefficient matrix in the 'Coefficients Matrix (A)' field. Separate elements within a row by commas, and rows by semicolons. For example: '2,3;1,-1' represents [[2,3],[1,−1]].
  3. Enter the constants vector in the 'Constants Vector (b)' field as comma-separated values matching the number of equations.
  4. Click 'Solve System'. The result shows each variable's value plus the determinants D, Dx, Dy (and Dz for 3×3 systems).
  5. If the determinant is zero, the system is singular and has no unique solution — the calculator will tell you this instead of showing a solution.

Cramer's Rule FAQ

What is Cramer's Rule?
Cramer's Rule is a formula for solving a system of n linear equations in n unknowns when the coefficient matrix is invertible (non-singular). Each unknown is expressed as the ratio of two determinants: the main determinant of the coefficient matrix in the denominator, and a modified determinant — where the column for that variable is replaced by the constants vector — in the numerator. It provides an explicit closed-form solution rather than an algorithmic one.
When does Cramer's Rule fail?
Cramer's Rule fails when the determinant of the coefficient matrix is zero. This indicates a singular matrix, which means the system either has no solution (inconsistent — the equations contradict each other) or infinitely many solutions (dependent — some equations are redundant combinations of others). In either case, you must use Gaussian elimination or row reduction to determine the exact nature of the solution set.
Is Cramer's Rule efficient for large systems?
No — Cramer's Rule is computationally expensive for large systems. Computing a determinant by cofactor expansion requires O(n!) operations, making it impractical for systems larger than about 4×4. Gaussian elimination solves an n×n system in O(n³) operations, which is vastly more efficient. Cramer's Rule is best suited for 2×2 and 3×3 systems, or for theoretical and symbolic work where a closed-form expression is valuable.
What is the input format for the matrix?
Enter rows separated by semicolons and elements within each row separated by commas. For the 2×2 system 2x + 3y = 5, x − y = 4, enter '2,3;1,-1' for the matrix and '5,4' for the constants. For a 3×3 system, use three rows: '1,2,3;4,5,6;7,8,10'. Negative numbers use the standard minus sign.
Can Cramer's Rule handle fractional or decimal coefficients?
Yes — this calculator handles any real-number coefficients including decimals and fractions entered as decimals (e.g., 0.5 instead of 1/2). The underlying arithmetic uses IEEE 754 double-precision floating-point, which provides about 15–16 significant digits of precision. For systems with exact integer or simple fractional coefficients, the results will be exact within rounding.
How do I verify my solution?
Substitute the computed values of x, y (and z) back into each original equation and verify that both sides are equal. For example, if you solved 2x + y = 5 and x + 3y = 4 and obtained x = 2.2, y = 0.6, check: 2(2.2) + 0.6 = 5 ✓ and 2.2 + 3(0.6) = 4 ✓. The determinant values shown in the result panel also let you verify the Cramer's Rule calculation step by step.