Matrix Trace Calculator

Enter values into a square matrix grid (up to 5×5) and instantly compute its trace — the sum of the main diagonal elements.

Matrix Input

Matrix size (n × n)

Result

Trace (tr A)

Step-by-Step

Enter matrix values to see the working.

Copied!

Summary

Enter values into a square matrix grid (up to 5×5) and instantly compute its trace — the sum of the main diagonal elements.

How it works

  1. Select the matrix size (2×2 up to 5×5) using the size buttons.
  2. Enter numeric values into each cell of the grid.
  3. The trace is computed automatically as you type.
  4. The step-by-step panel shows which diagonal cells were summed.
  5. Click Reset to clear the grid and start over.

Use cases

  • Verify hand-computed matrix traces in homework or exams.
  • Quickly check the sum of eigenvalues via the trace identity.
  • Validate covariance matrix diagonals in statistics.
  • Debug linear algebra code by cross-checking intermediate results.
  • Teach or learn the trace concept with instant visual feedback.
  • Use as a sanity check when computing matrix similarity transforms.

Frequently Asked Questions

Last updated: 2026-06-10 · Reviewed by Nham Vu