Determinant and Trace Calculator

Compute the determinant1 and trace2 of a square matrix.
Two fundamental scalar quantities that characterize square matrices.

Determinant:

  • Denoted \(\det(A)\) or \(|A|\)
  • Measures the volume scaling factor of the linear transformation3
  • \(\det(A) = 0\) if and only if \(A\) is singular (non-invertible)
  • For eigenvalues \(\lambda_1, \ldots, \lambda_n\): \(\det(A) = \lambda_1 \cdots \lambda_n\)

Trace:

  • Denoted \(\operatorname{tr}(A)\)
  • Sum of diagonal entries: \(\operatorname{tr}(A) = a_{11} + a_{22} + \cdots + a_{nn}\)
  • For eigenvalues \(\lambda_1, \ldots, \lambda_n\): \(\operatorname{tr}(A) = \lambda_1 + \cdots + \lambda_n\)

This calculator picks the method that shows the clearest steps for each size:

  • \(2\times 2\): the direct rule \(\det(A) = a_{11}a_{22} - a_{12}a_{21}\) (i.e. \(ad - bc\)).
  • \(3\times 3\) and \(4\times 4\): cofactor (Laplace) expansion along a row or column of your choice — pick it from the selector that appears above the results.
  • \(n \ge 5\): elementary row operations4 reduce \(A\) to an upper-triangular matrix \(U\); then \(\det(A)\) is the product of the diagonal entries of \(U\) times the product of the elementary matrix determinants.
Set matrix dimension

Enter the matrix size n and click Generate Matrix for an empty n×n grid, or Random Matrix to fill it with random integers.

Display values as:
1 — Compute
Computes the determinant and trace of the matrix using elementary row operations.
Resets all dimensions, matrix entries, and results.
Cite this tool
Kapita, S. (2026). Determinant and Trace Calculator. Math Tools. https://doi.org/10.5281/zenodo.20981193