Matrix Calculator
Enter your values
Enter your values and press Calculate — your answer, visual and step-by-step solution appear here.
Use this free matrix calculator to find the determinant, inverse, transpose, or trace of any 2×2 or 3×3 matrix, with every step shown. Enter your numbers, choose an operation, and read the worked solution — no login, no cost. The guide below teaches the by-hand method for each operation so you can reproduce the answer on homework and exams.
What This Matrix Calculator Does
A matrix is a rectangular grid of numbers arranged in rows and columns. This tool focuses on the four operations you need most for an Algebra 2 or first-year linear algebra problem, applied to small square matrices:
- Determinant — a single number computed from a square matrix that tells you, among other things, whether the matrix can be inverted.
- Inverse — the matrix that "undoes" the original; multiplying a matrix by its inverse gives the identity matrix.
- Transpose — the matrix you get by swapping rows and columns (flipping across the main diagonal).
- Trace — the sum of the entries on the main diagonal (top-left to bottom-right) of a square matrix.
Supported sizes: 2×2 and 3×3 matrices only. Determinant, inverse, and trace require a square matrix (same number of rows and columns); the transpose works on either supported size.
How to Use the Calculator
Computing a result takes four steps. The tool shows the full step-by-step solution alongside each answer.
- Pick the size. Choose a 2×2 or 3×3 grid to match your problem.
- Enter the matrix values. Type a number into each cell. Whole numbers, decimals, and negatives are all accepted.
- Choose an operation. Select determinant, inverse, transpose, or trace.
- Read the step-by-step solution. Press Calculate to see the answer, a visual, and every intermediate step. Want to try first? Use the Hint button before revealing the full solution.
Determinant of a Matrix (2×2 and 3×3)
The determinant is a single number you can calculate from any square matrix. It tells you whether the matrix is invertible: a determinant of zero means no inverse exists (see below). The determinant is written as det(A) or with vertical bars, |A|.
2×2 Determinant — the ad − bc Rule
For a 2×2 matrix with entries a, b, c, d, multiply the main diagonal and subtract the product of the other diagonal:
Worked example. Find the determinant of [ 4 7 ; 2 6 ]:
- Multiply the main diagonal. a × d = 4 × 6 = 24.
- Multiply the anti-diagonal. b × c = 7 × 2 = 14.
- Subtract. det(A) = 24 − 14 = 10.
3×3 Determinant — Cofactor Expansion
For a 3×3 matrix, expand along the first row. Each top-row entry is multiplied by the determinant of the 2×2 minor left over when you cross out that entry's row and column, and the signs alternate + − +:
using the labelling [ a b c ; d e f ; g h i ]. Worked example. Find the determinant of [ 1 2 3 ; 4 5 6 ; 7 8 10 ]:
- Expand on the first entry (a = 1). Cross out row 1 and column 1, leaving the minor [ 5 6 ; 8 10 ]. Its determinant is 5×10 − 6×8 = 50 − 48 = 2. Contribution: +1 × 2 = 2.
- Expand on the second entry (b = 2), with a minus sign. The minor is [ 4 6 ; 7 10 ], determinant 4×10 − 6×7 = 40 − 42 = −2. Contribution: −2 × (−2) = +4.
- Expand on the third entry (c = 3), with a plus sign. The minor is [ 4 5 ; 7 8 ], determinant 4×8 − 5×7 = 32 − 35 = −3. Contribution: +3 × (−3) = −9.
- Add the three contributions. det(A) = 2 + 4 − 9 = −3.
Inverse of a Matrix
The inverse of a square matrix A, written A⁻¹, is the matrix that satisfies A × A⁻¹ = I, where I is the identity matrix (1s on the diagonal, 0s elsewhere). Only square matrices with a non-zero determinant have an inverse. The inverse is what lets a systems of equations calculator solve a linear system in one move.
2×2 Inverse — the Swap-and-Negate Shortcut
For a 2×2 matrix, swap a and d, negate b and c, then divide every entry by the determinant:
Worked example. Invert [ 4 7 ; 2 6 ]:
- Find the determinant. ad − bc = 4×6 − 7×2 = 24 − 14 = 10. It is non-zero, so an inverse exists.
- Swap a and d; negate b and c. The adjugate is [ 6 −7 ; −2 4 ].
- Divide every entry by the determinant (10). A⁻¹ = [ 0.6 −0.7 ; −0.2 0.4 ].
- Check. Multiply A × A⁻¹; the result is the identity matrix [ 1 0 ; 0 1 ], confirming the inverse.
3×3 Inverse — the Adjugate Method
For a 3×3 matrix the calculator uses the adjugate method, which builds on the determinant section above:
- Compute the determinant by cofactor expansion. If it is zero, stop — there is no inverse.
- Build the matrix of cofactors. For each entry, find the 2×2 minor determinant and apply the checkerboard sign pattern (+ − + / − + − / + − +).
- Transpose the cofactor matrix to get the adjugate (this is the same row↔column swap described in the transpose section).
- Divide the adjugate by the determinant. The result is A⁻¹.
When a Matrix Has No Inverse
A matrix has no inverse exactly when its determinant equals zero. Such a matrix is called singular (a matrix that does have an inverse is invertible or non-singular).
The reason is built into the formula: every inverse requires dividing by the determinant, and division by zero is undefined. A zero determinant means the rows (or columns) are linearly dependent — one row is a multiple of another, or one is a combination of the others — so the matrix collapses information that an inverse would need to recover.
Transpose of a Matrix
The transpose of a matrix, written Aᵀ, is what you get by swapping its rows and columns: the first row becomes the first column, the second row becomes the second column, and so on. Entry (row i, column j) moves to position (row j, column i).
Here a 2×3 matrix becomes a 3×2 matrix — the dimensions flip. The transpose is the only operation on this page that does not require a square matrix.
- Transpose of a transpose: applying the transpose twice returns the original matrix, so (Aᵀ)ᵀ = A.
- Symmetric matrices: if a square matrix is unchanged by transposing (A = Aᵀ), it is called symmetric — its entries mirror across the main diagonal.
Trace of a Matrix
The trace of a square matrix, written tr(A), is simply the sum of the entries on the main diagonal — the line running from the top-left corner to the bottom-right corner. Off-diagonal entries are ignored.
Worked example. For [ 2 9 1 ; 4 5 7 ; 0 3 8 ], the diagonal entries are 2, 5, and 8, so tr(A) = 2 + 5 + 8 = 15. Like the determinant and inverse, the trace is only defined for square matrices.
Worked Example — One 3×3 Matrix Through All Four Operations
To see how the operations connect, run the single matrix A = [ 2 0 1 ; 3 1 2 ; 1 1 0 ] through each one:
- Determinant. Expanding along the first row: 2(1×0 − 2×1) − 0(…) + 1(3×1 − 1×1) = 2(−2) − 0 + 1(2) = −4 + 2 = −2.
- Inverse. The determinant is −2 (non-zero), so an inverse exists. Build the cofactor matrix, transpose it to the adjugate, then divide by −2 to get A⁻¹.
- Transpose. Swap rows and columns: Aᵀ = [ 2 3 1 ; 0 1 1 ; 1 2 0 ].
- Trace. Add the main diagonal of A: 2 + 1 + 0 = 3.
Common Mistakes to Avoid
Frequently Asked Questions
-
How do you find the determinant of a 3×3 matrix?
Expand along the first row using cofactor expansion. Multiply each top-row entry by the determinant of its 2×2 minor, apply the alternating signs + − +, and add the three results. For [ a b c ; d e f ; g h i ], det(A) = a(ei − fh) − b(di − fg) + c(dh − eg).
-
Why doesn't my matrix have an inverse?
A matrix has no inverse when its determinant equals zero — such a matrix is called singular. Because finding an inverse requires dividing by the determinant, a determinant of 0 makes the inverse undefined. It usually means one row is a multiple or combination of the others.
-
What is the difference between the transpose and the inverse of a matrix?
The transpose (Aᵀ) just swaps rows and columns and always exists. The inverse (A⁻¹) is the matrix that undoes multiplication, so A × A⁻¹ equals the identity matrix, and it only exists when the determinant is non-zero. They are different operations and normally produce different results.
-
What size matrices does this calculator support?
This matrix calculator works with 2×2 and 3×3 matrices. It computes the determinant, inverse, and trace for square matrices of those sizes, and the transpose for either size.
-
What is the trace of a matrix used for?
The trace is the sum of the main-diagonal entries of a square matrix. It is a quick summary value that stays the same when a matrix is transposed, and it appears throughout linear algebra as a simple, fast-to-compute property of a matrix.