Matrix Calculator
Multiply, add and subtract matrices up to 6 × 6, plus determinant, inverse, transpose and powers, exactly.
This matrix determinant calculator finds det A for any square matrix from 2 × 2 to 6 × 6 as an exact fraction, by row reduction or cofactor expansion, with every step shown.
Determinant det(A)
The determinant is −25. A is invertible, and as a linear transformation it multiplies volume by 25 and reverses orientation (like a mirror image).
Start with the matrix
Use row operations to make the matrix upper triangular. Adding a multiple of one row to another does not change the determinant; each row swap changes its sign.
R2 → R2 − 2R1
Subtract 2 times row 1 from row 2 to make the entry in column 1 zero (this does not change the determinant).
R3 → R3 − 3R1
Subtract 3 times row 1 from row 3 to make the entry in column 1 zero (this does not change the determinant).
R2 ↔ R3
Swap rows 2 and 3 to get a nonzero pivot in column 2. A row swap changes the sign of the determinant.
Multiply the diagonal entries
The matrix is upper triangular, so its determinant is the product of the diagonal entries, with the sign flipped because of the odd number of row swaps.
For a 2 × 2 matrix ; larger matrices are reduced to triangular form, whose determinant is the product of the diagonal.
2 × 2 determinant
Plain-text formula: det [a, b; c, d] = ad − bc
The product of the main diagonal minus the product of the other diagonal.
3 × 3 determinant (rule of Sarrus)
Plain-text formula: det [a, b, c; d, e, f; g, h, i] = aei + bfg + cdh − ceg − bdi − afh
Add the three products running down to the right and subtract the three running up to the right. This shortcut works only for 3 × 3 matrices; it gives the same answer as cofactor expansion along the first row, .
Cofactor (Laplace) expansion along row i
Plain-text formula: det A = ∑_{j = 1}^n (−1)^(i + j) a_(ij) M_(ij)
Each entry of the chosen row is multiplied by its cofactor, the signed determinant of the matrix left after deleting that entry’s row and column. The signs follow a checkerboard that starts with + in the top-left corner. The same formula works down a column, so expand along the row or column with the most zeros.
Row reduction
Plain-text formula: det A = (−1)^s u_11u_22⋯u_(nn)
Gaussian elimination turns A into an upper triangular matrix U using row replacements (which leave the determinant unchanged) and s row swaps (each flips the sign). The determinant of a triangular matrix is the product of its diagonal.
Useful properties
Plain-text formula: det(AB) = det A · det B, det(A^T) = det A, det(kA) = k^n det A, det(A^(−1)) = 1/(det A)
These hold for any n × n matrices A and B and any number k; the last one needs A to be invertible.
A determinant of 0 means the matrix is singular: its rows (and columns) are linearly dependent, it has no inverse, and a system has either no solution or infinitely many. Any nonzero determinant, however small, means A is invertible.
Geometrically, the absolute value |det A| is the factor by which the transformation scales areas (2 × 2), volumes (3 × 3) or n-dimensional volumes. A negative sign means orientation is reversed, as with a reflection.
The rank shown with the result says how many rows are independent. A rank below n always goes with a determinant of 0.
First check the matrix is square: only n × n matrices have a determinant. Then pick the method that suits the size. For a 2 × 2 matrix use . For a 3 × 3 matrix use the rule of Sarrus or expand along a row. For 4 × 4 and larger, either expand along the row or column with the most zeros or row reduce to triangular form and multiply the diagonal.
Whichever method you use, the answer is the same. The choice only changes how much arithmetic you do, as the table shows.
| Method | Works for | Amount of work | Best when |
|---|---|---|---|
| ad − bc | 2 × 2 only | 2 multiplications | Always, for 2 × 2 |
| Rule of Sarrus | 3 × 3 only | 12 multiplications | A quick 3 × 3 check by hand |
| Cofactor expansion | Any size | Grows like n! (720 terms for a full 6 × 6) | Small matrices, or a row or column with many zeros |
| Row reduction | Any size | About n³/3 multiplications | 4 × 4 and larger, and what software uses |
| Product of the diagonal | Triangular or diagonal matrices | n − 1 multiplications | All entries above or below the diagonal are 0 |
Take the default matrix , so a = 1, b = 2, c = 3, d = 2, e = 4, f = 1, g = 3, h = 1 and i = 2.
The products running down to the right are , and , which add to 20. The products running up to the right are , and , which add to 45. So , the same value the row reduction in the worked example below gives.
Sarrus does not extend to 4 × 4: copying the first columns of a 4 × 4 matrix gives only 8 of the 24 terms. Use cofactor expansion or row reduction instead.
Expand along the row or column with the most zeros. In column 2 has three zeros, so only the entry contributes. Its sign is .
Deleting row 2 and column 2 leaves , whose determinant is .
So . Load the “4 × 4 by cofactors” example above to see every step.
Row reduction is the fastest way to a determinant, but each kind of row operation affects the value differently. Keep track of them and correct at the end.
To see the elimination that produces an inverse instead, use the inverse matrix calculator; for the rank and pivots, use the RREF calculator.
| Row operation | Example | Effect on the determinant |
|---|---|---|
| Swap two rows | R1 ↔ R2 | Changes the sign |
| Multiply one row by k | R2 → 3R2 | Multiplies it by k |
| Add a multiple of one row to another | R3 → R3 − 2R1 | No change |
| Multiply the whole n × n matrix by k | A → 2A | Multiplies it by kⁿ |
Dropping the sign of a row swap. Every swap multiplies the determinant by −1, so an odd number of swaps flips the final sign.
Forgetting the checkerboard signs. In cofactor expansion the entry in row i, column j takes the sign , so the middle entry of the first row of a 3 × 3 matrix is subtracted.
Using Sarrus on a 4 × 4 matrix. The diagonal shortcut is only valid for 3 × 3 matrices.
Scaling the whole matrix by k. , not .
Treating a tiny determinant as zero. A matrix is singular only when the determinant is exactly 0. This calculator works in exact fractions, so there is no rounding to blur the two.
Find det A for A = [[1, 2, 3], [2, 4, 1], [3, 1, 2]].
Answer: . A is invertible, it scales volumes by 25, and the negative sign means it reverses orientation.
Use the rule of Sarrus, aei + bfg + cdh − ceg − bdi − afh, or expand along the first row: a(ei − fh) − b(di − fg) + c(dh − eg). For [[1, 2, 3], [2, 4, 1], [3, 1, 2]] both give 20 − 45 = −25.
Expand along the row or column with the most zeros, which turns it into a sum of 3 × 3 determinants, or row reduce it to triangular form and multiply the diagonal, changing the sign once for every row swap. The rule of Sarrus does not work for 4 × 4 matrices.
The matrix is singular. Its rows are linearly dependent, it has no inverse, and it squashes space into a lower dimension. For example, [[1, 2, 3], [4, 5, 6], [7, 8, 9]] has determinant 0 because row 3 = 2 × row 2 − row 1.
For [[a, b], [c, d]] it is ad − bc. For [[5, 2], [3, 4]] that is 5 · 4 − 2 · 3 = 14.
No. The determinant is defined only for square matrices, so a 3 × 2 matrix has none. It measures how an n-dimensional volume changes under a map from n-dimensional space to itself.
On a Casio fx-991EX, open Matrix mode, define MatA, then choose Determinant from the OPTN menu and enter det(MatA). On a TI-84, store the matrix in [A] from the MATRIX menu (2nd, x⁻¹), then choose MATH, 1: det( and enter det([A]). Neither shows the working; this calculator does.
No. Entries must be numbers, fractions or decimals. For a symbolic matrix, expand by cofactors by hand using the formulas on this page; the 2 × 2 rule and the rule of Sarrus give the polynomial directly.
Usually not. The determinant is multiplicative, det(AB) = det A · det B, but it is not additive. For example, det(I + I) = det(2I) = 2ⁿ for an n × n identity, not 2.
Multiply, add and subtract matrices up to 6 × 6, plus determinant, inverse, transpose and powers, exactly.
Exact inverses of 2x2 to 6x6 matrices by Gauss–Jordan elimination, with every row operation and a check.
Reduced row echelon form or REF with each row operation, rank, nullity and linear system solutions.
Eigenvalues, eigenvectors and the characteristic polynomial of a 2x2, 3x3 or 4x4 matrix, with every step.
a × b with i, j, k determinant steps, magnitude, unit normal, angle and area, plus triple products.
Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.
Learn more: For matrix input in the full calculator, read matrices and vectors. Determinants also solve small systems by Cramer’s rule: see how to solve two equations.
Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?