CCalculate.Studio

Matrix Calculator

This matrix calculator computes the determinant and trace of a 2x2 or 3x3 square matrix, and the inverse of a 2x2 matrix when it exists. Entries are typed as a comma-separated list in row-major order (left to right, top to bottom). For example, the 2x2 matrix with rows (4, 7) and (2, 6) has determinant 4 x 6 - 7 x 2 = 10, trace 10, and inverse [0.6, -0.7; -0.2, 0.4].

Last reviewed: 2026-07-07

Your details

Results

Determinant10
Trace10
Inverse (2x2)[0.6, -0.7; -0.2, 0.4]

Understanding the determinant

The determinant's value carries direct geometric and algebraic meaning.

DeterminantMeaning
det != 0Matrix is invertible; the linear system Ax = b has a unique solution
det = 0Matrix is singular; no inverse exists; rows/columns are linearly dependent
|det| > 1The transformation expands areas (2x2) or volumes (3x3) by the factor |det|
|det| < 1The transformation shrinks areas or volumes
det < 0The transformation reverses orientation (includes a reflection)
  • The inverse is reported for 2x2 matrices with nonzero determinant. A singular matrix (determinant 0) has no inverse; the 3x3 mode reports determinant and trace only.
  • Entries must be supplied in row-major order and the count must match the chosen size exactly: 4 entries for 2x2, 9 for 3x3.
  • The trace equals the sum of the eigenvalues, and the determinant equals their product — two standard identities of linear algebra.
  • Matrix multiplication is not commutative in general, but A x A^-1 = A^-1 x A = I always holds for invertible A.

What are the determinant, trace and inverse of a matrix?

A matrix is a rectangular array of numbers; a square matrix has as many rows as columns. The determinant is a single number computed from a square matrix that encodes whether the matrix is invertible and how it scales space: a linear transformation with determinant d multiplies areas (2x2) or volumes (3x3) by |d|, and a negative determinant indicates a reflection (orientation flip).

A matrix is invertible (non-singular) exactly when its determinant is nonzero. The inverse A^-1 is the matrix that undoes A: multiplying A by A^-1 gives the identity matrix. When the determinant is zero the matrix is singular — it collapses space onto a line or plane — and no inverse exists. Determinants also decide whether a linear system Ax = b has a unique solution.

The trace is the sum of the entries on the main diagonal (top-left to bottom-right). It equals the sum of the matrix's eigenvalues and appears throughout linear algebra and physics. For a 2x2 matrix, the characteristic polynomial is fully determined by the trace and determinant: lambda^2 - trace x lambda + det = 0.

How to use this matrix calculator

  1. Choose the matrix size: 2 x 2 (requires exactly 4 entries) or 3 x 3 (requires exactly 9 entries).
  2. Enter the entries in row-major order — the first row left to right, then the second row, and so on. For the matrix with rows (4, 7) and (2, 6), enter: 4, 7, 2, 6.
  3. Read the determinant and the trace.
  4. For a 2 x 2 matrix with nonzero determinant, read the inverse, displayed row by row as [a, b; c, d]. Singular matrices (determinant 0) have no inverse, and the 3 x 3 mode reports determinant and trace only.

Determinant, trace and inverse formulas

2x2: det[a, b; c, d] = ad - bc
2x2 inverse: A^-1 = (1/det) x [d, -b; -c, a], det != 0
3x3: det = a(ei - fh) - b(di - fg) + c(dh - eg)
Trace = sum of main-diagonal entries
Example: det[4, 7; 2, 6] = 24 - 14 = 10; inverse = [0.6, -0.7; -0.2, 0.4]

2x2 determinant: for the matrix with rows (a, b) and (c, d), det = ad - bc. Worked example with rows (4, 7) and (2, 6): det = 4 x 6 - 7 x 2 = 24 - 14 = 10. The trace is a + d = 4 + 6 = 10.

2x2 inverse: when det is nonzero, A^-1 = (1/det) x [d, -b; -c, a] — swap the diagonal entries, negate the off-diagonal entries, and divide everything by the determinant. For the example: (1/10) x [6, -7; -2, 4] = [0.6, -0.7; -0.2, 0.4]. Check: multiplying the original matrix by this inverse gives the identity matrix.

3x3 determinant (cofactor expansion along the first row): for rows (a, b, c), (d, e, f), (g, h, i), det = a(ei - fh) - b(di - fg) + c(dh - eg). Worked example with rows (1, 2, 3), (4, 5, 6), (7, 8, 10): det = 1 x (5 x 10 - 6 x 8) - 2 x (4 x 10 - 6 x 7) + 3 x (4 x 8 - 5 x 7) = 1 x 2 - 2 x (-2) + 3 x (-3) = 2 + 4 - 9 = -3. The trace is 1 + 5 + 10 = 16.

Common mistakes

  • Entering values in column-major order — this calculator reads entries row by row, so [4, 7, 2, 6] means rows (4, 7) and (2, 6).
  • Computing the 2x2 determinant as ad + bc instead of ad - bc.
  • Forgetting the sign alternation in 3x3 cofactor expansion: the middle term is subtracted, det = a(ei - fh) - b(di - fg) + c(dh - eg).
  • Attempting to invert a matrix with determinant 0 — singular matrices have no inverse.
  • In the 2x2 inverse shortcut, swapping the wrong pair: the diagonal entries a and d are swapped, while b and c keep their positions but change sign.

Frequently asked questions

How do I calculate the determinant of a 2x2 matrix?

For the matrix with rows (a, b) and (c, d), the determinant is ad - bc: multiply the main diagonal, multiply the off-diagonal, and subtract. For rows (4, 7) and (2, 6), det = 4 x 6 - 7 x 2 = 24 - 14 = 10.

How do I find the inverse of a 2x2 matrix?

If the determinant ad - bc is nonzero, swap the diagonal entries, negate the off-diagonal entries, and divide every entry by the determinant: A^-1 = (1/(ad - bc)) x [d, -b; -c, a]. For rows (4, 7) and (2, 6) with determinant 10, the inverse is [0.6, -0.7; -0.2, 0.4]. If the determinant is zero, no inverse exists.

What does a determinant of zero mean?

A zero determinant means the matrix is singular: its rows (and columns) are linearly dependent, the transformation it represents collapses space onto a lower dimension, and it has no inverse. A linear system with a singular coefficient matrix has either no solution or infinitely many, never exactly one.

What is the trace of a matrix?

The trace is the sum of the entries on the main diagonal, from top-left to bottom-right. For rows (4, 7) and (2, 6) the trace is 4 + 6 = 10. The trace equals the sum of the matrix's eigenvalues, which makes it a quick invariant used across linear algebra, geometry and physics.

How is a 3x3 determinant calculated?

By cofactor expansion along the first row: det = a(ei - fh) - b(di - fg) + c(dh - eg) for rows (a, b, c), (d, e, f), (g, h, i). Each first-row entry multiplies the determinant of the 2x2 matrix left after deleting its row and column, with alternating signs +, -, +. For rows (1, 2, 3), (4, 5, 6), (7, 8, 10), this gives 2 + 4 - 9 = -3.

Why doesn't the calculator show a 3x3 inverse?

Inverting a 3x3 matrix requires the full adjugate (the transposed matrix of cofactors) divided by the determinant — nine cofactor computations that are beyond this tool's scope. This calculator reports the determinant and trace for 3x3 matrices, and the complete inverse for non-singular 2x2 matrices.

References

  1. Strang G. Introduction to Linear Algebra. Wellesley-Cambridge Press (determinants, inverses and the trace).
  2. Weisstein, Eric W. "Determinant" and "Matrix Inverse." MathWorld — A Wolfram Web Resource. mathworld.wolfram.com.
  3. Anton H, Rorres C. Elementary Linear Algebra. Wiley (cofactor expansion and the adjugate formula).

Algebra · All calculators

Related calculators