Matrix Calculator
Calculate the determinant, inverse, transpose, trace, adjugate, and rank of a 2x2 or 3x3 matrix. Enter the matrix entries, choose the size and operation, and the calculator shows the result alongside full step-by-step working so you can follow every calculation.
Formula
Worked example
For A = [4, 7; 2, 6]: det = (4 x 6) - (7 x 2) = 24 - 14 = 10. Inverse = (1/10) x [6, -7; -2, 4] = [0.6, -0.7; -0.2, 0.4]. Trace = 4 + 6 = 10. Rank = 2 (full rank). Transpose = [4, 2; 7, 6].
How the determinant works (2x2 and 3x3)
For a 2x2 matrix with entries a, b on the top row and c, d on the bottom row, the determinant is ad minus bc. Multiply the diagonal products in opposite directions and subtract. For a 3x3 matrix, the standard method is cofactor expansion along the first row: multiply each top-row entry by its cofactor (the signed determinant of the 2x2 submatrix formed by deleting that entry's row and column) and sum the three products. The sign pattern alternates: plus, minus, plus. The determinant is a single number that describes how the matrix scales area (2x2) or volume (3x3), and it is nonzero exactly when the matrix has an inverse.
Finding the inverse (adjugate method)
When the determinant is not zero, the inverse exists and can be found using the adjugate. For a 2x2 matrix, the adjugate is simple: swap the two diagonal entries (a and d), negate the two off-diagonal entries (b and c), and divide every entry by the determinant. For a 3x3 matrix, compute the 3x3 cofactor matrix, take its transpose to get the adjugate, then divide every entry by the determinant. The inverse is the unique matrix such that A times A-inverse equals the identity matrix. If the determinant is zero the matrix is singular, its rows are linearly dependent, and no inverse exists.
Transpose, trace, and rank explained
The transpose of a matrix is formed by swapping its rows and columns: entry (i, j) moves to position (j, i). The trace is the sum of the main diagonal entries and equals the sum of the eigenvalues. Both trace and determinant are invariant under similarity transformations, making them useful fingerprints of a matrix. The rank is the number of linearly independent rows (equivalently, columns), found by Gaussian elimination. A full-rank n-by-n matrix has rank n, which is equivalent to being invertible. Rank tells you the effective dimensionality of the transformation the matrix represents.
Adjugate and cofactor matrix
Each cofactor C(i, j) of a matrix is the signed minor: C(i, j) = (-1)^(i+j) times the determinant of the submatrix you get by deleting row i and column j. The cofactor matrix collects all n squared cofactors. Transposing the cofactor matrix produces the adjugate (also called the classical adjoint). For any square matrix, A times adj(A) equals det(A) times the identity, which gives the adjugate-based inverse formula: A inverse = adj(A) divided by det(A). The adjugate is always defined, even when the matrix is singular, unlike the inverse itself.
Matrix properties at a glance
| Property | Meaning | Invertible? |
|---|---|---|
| det = 0 | Rows are linearly dependent; volume collapses to zero | No |
| det not 0 | Rows are independent; unique inverse exists | Yes |
| Rank = n (full rank) | All rows/columns are linearly independent | Yes |
| Rank < n | At least one row is redundant | No |
| Trace = sum of diag | Also equals sum of eigenvalues | Depends on det |
| Transpose (A^T) | Rows become columns; det(A^T) = det(A) | Same as A |
Quick reference for 2x2 and 3x3 square matrices.
Frequently asked questions
How do I find the determinant of a 2x2 matrix?
Use the formula ad minus bc. Multiply the top-left entry a by the bottom-right entry d, then subtract the product of the top-right entry b and the bottom-left entry c. For a = 4, b = 7, c = 2, d = 6: det = (4 x 6) - (7 x 2) = 24 - 14 = 10.
How do I find the determinant of a 3x3 matrix?
Expand along the first row: det = a * (ei - fh) - b * (di - fg) + c * (dh - eg), where the letters refer to the entries read row by row. Each term is the top-row entry multiplied by the determinant of the 2x2 submatrix formed by deleting that entry's row and column. The signs alternate: +, -, +.
When does a matrix have an inverse?
A square matrix has an inverse exactly when its determinant is not zero. When the determinant is zero, the matrix is called singular, its rows are linearly dependent (at least one row is a combination of the others), and no inverse exists.
What is the trace of a matrix?
The trace is the sum of all entries on the main diagonal, from top-left to bottom-right. For a 2x2 matrix [a, b; c, d] the trace is a + d. For a 3x3 matrix the trace is a + e + i (the three diagonal entries). Trace also equals the sum of the matrix's eigenvalues.
What is the adjugate matrix and how is it different from the inverse?
The adjugate (classical adjoint) is the transpose of the cofactor matrix. Each cofactor equals (-1)^(i+j) times the minor of entry (i, j). For a 2x2 matrix [a, b; c, d] the adjugate is [d, -b; -c, a]. The inverse is the adjugate divided by the determinant, so the adjugate exists even when the matrix is singular, but the inverse does not.
What does the rank of a matrix mean?
Rank is the number of linearly independent rows (or columns). For a 2x2 or 3x3 matrix, row-reduce to echelon form and count the non-zero pivot rows. A full-rank n-by-n matrix has rank n and is invertible. Lower rank means one or more rows are combinations of others and the matrix is singular.