The trace is the sum of the eigenvalues, is unchanged by similarity transformations and appears in the characteristic polynomial, in physics (the trace of the stress tensor) and in machine learning (Frobenius inner products).
How to use the Matrix Trace Calculator
- Choose the matrix size – the matching grid of fields appears.
- Enter the entries row by row (a₁ b₁ c₁ is the first row, a₂ b₂ c₂ the second, and so on).
- Read the result; integer matrices give exact fractions.
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Only the entries on the main diagonal are added.
Formula
tr(A) = a₁₁ + a₂₂ + … + aₙₙ
Worked example
Inputs — Matrix size: 3 × 3; a₁: 4; b₁: 1; c₁: 2; a₂: 1; b₂: 3; c₂: 0; a₃: 2; b₃: 0; c₃: 5.
Results — Trace = 12; Sum of the diagonal = tr(A) = 4 + 3 + 5 = 12.
Key terms
- Trace
- The sum of the diagonal entries.
Frequently asked questions
What is the trace of the identity matrix?
n, its size.
Is tr(AB) = tr(BA)?
Yes, even though AB ≠ BA in general.
How is the trace related to eigenvalues?
It equals their sum.
Can non-square matrices have a trace?
No.