Cramer's Rule Calculator
Solve linear systems with Cramer's rule as a ratio of determinants, seeing each replaced matrix, its cofactor expansion and the exact fractional answer.
Coefficient matrix A
| 2 | 3 |
| 1 | -1 |
det(A) = (2)(-1) − (3)(1) = -5
A1 — column 1 replaced by the constants
| 8 | 3 |
| 1 | -1 |
det(A1) = (8)(-1) − (3)(1) = -11
x = det(A1) / det(A) = -11 / -5 = 11/5 ≈ 2.2
A2 — column 2 replaced by the constants
| 2 | 8 |
| 1 | 1 |
det(A2) = (2)(1) − (8)(1) = -6
y = det(A2) / det(A) = -6 / -5 = 6/5 ≈ 1.2
Solution
x = 11/5 ≈ 2.2
y = 6/5 ≈ 1.2
Cramer’s rule gives each variable as a ratio of two determinants, so the answers stay exact fractions rather than rounded decimals.
What is the Cramer's Rule Calculator?
The ByteTools Cramer's Rule Calculator solves an n×n system of linear equations the way the method is actually taught: each unknown is the ratio xᵢ = det(Aᵢ) / det(A), where Aᵢ is the coefficient matrix with column i swapped for the constants.
- Solves 2×2 up to 5×5 systems by the determinant-ratio method
- Each replaced matrix Aᵢ shown with its swapped column highlighted
- Cofactor expansion written out term by term for 2×2 and 3×3
- Exact fractions plus a decimal approximation for every answer
- Clear explanation when det(A) = 0 and the rule cannot be used
- All computation is local to your browser
How to use the Cramer's Rule Calculator
- 1
Enter your system as an augmented matrix, one equation per line — 2x + 3y = 8 becomes '2 3 8'.
- 2
Read det(A) in the summary tiles; if it is zero, the rule does not apply and the tool says so.
- 3
Look at each Aᵢ matrix, with the replaced column highlighted and its determinant shown.
- 4
Read each variable as the ratio det(Aᵢ) / det(A), given as an exact fraction and a decimal.
- 5
Copy the full solution with the copy button.
About the Cramer's Rule Calculator
The ByteTools Cramer's Rule Calculator solves an n×n system of linear equations the way the method is actually taught: each unknown is the ratio xᵢ = det(Aᵢ) / det(A), where Aᵢ is the coefficient matrix with column i swapped for the constants. It handles systems from 2×2 up to 5×5, and works in exact fractions so answers come out as 11/5 rather than 2.2000000001.
Every replaced matrix Aᵢ is printed with its swapped column highlighted, followed by its determinant. For 2×2 and 3×3 systems the cofactor expansion is written out term by term, so you can check the arithmetic against your own; for 4×4 and 5×5 the determinant is computed by exact elimination instead, because a full expansion would run to 24 or 120 terms.
When det(A) = 0 the tool says plainly that Cramer's rule does not apply, and explains that a zero determinant means the system has either no solution or infinitely many — a case you need Gauss-Jordan elimination to distinguish. Everything runs locally in your browser with no uploads.
Frequently asked questions
What is Cramer's rule?
It is a formula that gives each unknown in a square linear system as a ratio of two determinants: replace column i of the coefficient matrix with the constants, take that determinant, and divide by the determinant of the original matrix. It only works when the system has a unique solution.
When can you not use Cramer's rule?
Whenever det(A) = 0, since you would be dividing by zero. That happens when the equations are not independent, so the system has either no solution or infinitely many. Elimination will tell you which; Cramer's rule cannot.
Is Cramer's rule faster than elimination?
No — for anything beyond 3×3 it is dramatically slower, because it needs n+1 separate determinants. It is taught because it gives a clean closed-form expression and shows how the solution depends on the inputs, not because it is efficient.
How do you enter a system into this calculator?
Write each equation as its coefficients followed by the constant, one equation per line. The system 2x + 3y = 8 and x − y = 1 becomes two lines: '2 3 8' and '1 -1 1'. Missing variables need an explicit 0.
Why are the answers shown as fractions?
Because the ratio of two integer determinants is exactly a rational number. Showing 11/5 instead of 2.2 keeps the answer exact and matches what you get working it out by hand. A decimal approximation is shown alongside for convenience.
Related tools
Determinant Calculator
Compute the determinant of any square matrix up to 6×6 instantly. See the full cofactor expansion for 2×2 and 3×3 matrices, worked step by step.
System of Equations Solver
Solve systems of 2, 3 or 4 linear equations by Gauss-Jordan elimination. See every step, and get clear answers for unique, none or infinite solutions.
LU Decomposition Calculator
Factor a square matrix into P, L and U by Doolittle elimination with partial pivoting, then use the factorisation to get the determinant and solve A·x = b.
Adjugate Matrix Calculator
Build the cofactor matrix from minors, transpose it into the adjugate, and see both A·adj(A) = det(A)·I and A⁻¹ = adj(A)/det(A) verified entry by entry.
Matrix Inverse Calculator
Invert any square matrix up to 6×6 using Gauss-Jordan elimination on [A|I]. Detects singular matrices and verifies the result with A × A⁻¹ = I.