Category

Matrix Calculator

Formula

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.

Reviewed by a math educator · Last updated September 2026 · Methods used: ad − bc for 2×2, cofactor expansion for the 3×3 determinant, and the adjugate method for the inverse.

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:

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.

  1. Pick the size. Choose a 2×2 or 3×3 grid to match your problem.
  2. Enter the matrix values. Type a number into each cell. Whole numbers, decimals, and negatives are all accepted.
  3. Choose an operation. Select determinant, inverse, transpose, or trace.
  4. 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:

A = [ a  b ; c  d ]  →  det(A) = ad − bc

Worked example. Find the determinant of [ 4  7 ; 2  6 ]:

  1. Multiply the main diagonal. a × d = 4 × 6 = 24.
  2. Multiply the anti-diagonal. b × c = 7 × 2 = 14.
  3. 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 + − +:

det(A) = a(ei − fh) − b(di − fg) + c(dh − eg)

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 ]:

  1. 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.
  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.
  3. 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.
  4. Add the three contributions. det(A) = 2 + 4 − 9 = −3.
Tip: The alternating sign pattern for the first row is +, −, +. Forgetting the middle minus sign is the single most common 3×3 determinant error.

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:

A⁻¹ = (1 / (ad − bc)) × [ d  −b ; −c  a ]

Worked example. Invert [ 4  7 ; 2  6 ]:

  1. Find the determinant. ad − bc = 4×6 − 7×2 = 24 − 14 = 10. It is non-zero, so an inverse exists.
  2. Swap a and d; negate b and c. The adjugate is [ 6  −7 ; −2  4 ].
  3. Divide every entry by the determinant (10). A⁻¹ = [ 0.6  −0.7 ; −0.2  0.4 ].
  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:

  1. Compute the determinant by cofactor expansion. If it is zero, stop — there is no inverse.
  2. Build the matrix of cofactors. For each entry, find the 2×2 minor determinant and apply the checkerboard sign pattern (+ − + / − + − / + − +).
  3. Transpose the cofactor matrix to get the adjugate (this is the same row↔column swap described in the transpose section).
  4. 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.

Worth knowing: If you ask this tool for an inverse and get a "no inverse" result, that is not an input error — it means your matrix is singular because its determinant is 0.

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).

[ 1 2 3 ; 4 5 6 ]  →  [ 1 4 ; 2 5 ; 3 6 ]

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.

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.

tr([ a b c ; d e f ; g h i ]) = a + e + i

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:

  1. 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.
  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⁻¹.
  3. Transpose. Swap rows and columns: Aᵀ = [ 2 3 1 ; 0 1 1 ; 1 2 0 ].
  4. Trace. Add the main diagonal of A: 2 + 1 + 0 = 3.
The connection: The determinant decided whether an inverse existed, the transpose appeared as a step inside the inverse, and the trace read straight off the same diagonal — four operations, one matrix.

Common Mistakes to Avoid

Mistake 1 — Forgetting the middle minus in a 3×3 determinantThe first-row cofactor signs alternate + − +. The middle term is always subtracted; dropping that minus is the most common 3×3 error.
Mistake 2 — Swapping the wrong entries in a 2×2 inverseSwap a and d (the main diagonal), and negate b and c (the off-diagonal). Reversing this gives the wrong matrix.
Mistake 3 — Forgetting to divide by the determinantThe adjugate (swapped/negated matrix) is not the inverse on its own — you must divide every entry by the determinant to finish.
Mistake 4 — Confusing the transpose with the inverseThe transpose only swaps rows and columns; the inverse undoes multiplication. They are different operations and usually give different matrices.
Mistake 5 — Trying to invert or trace a non-square matrixDeterminant, inverse, and trace require equal rows and columns. Only the transpose works on a non-square matrix.

Frequently Asked Questions