Matrix Trace Calculator

Matrix Trace Calculator

Calculate the trace of a square matrix by summing the values on its main diagonal.

Last updated: June 2026 | By Patchworkr Team

Matrix Trace Solver
Trace
0
Tr(A) = 0 + 0 + 0

What Is a Matrix Trace?

The trace of a square matrix is the sum of the entries on its main diagonal. It is an important invariant in linear algebra and appears in many applications across mathematics and science.

How to Calculate the Trace of a Matrix

  1. Enter a square matrix.
  2. Identify the main diagonal entries.
  3. Add those diagonal entries together.
  4. Read the trace in the result panel.
Tr(A) = a11 + a22 + ... + ann

Worked Example

For [[3, 8, 1], [4, 6, 2], [7, 5, 9]], the trace is 18.

3 + 6 + 9 = 18

Frequently Asked Questions

Is the trace defined for non-square matrices?

No. The trace is only defined for square matrices.

Can the trace be negative?

Yes. The trace is the sum of diagonal values, so it can be positive, negative, or zero.

Does the trace change if I transpose the matrix?

No. A matrix and its transpose have the same trace.

What if a cell is blank?

Blank cells are rejected instead of being silently converted to zero.

Related Tools