Matrix Trace Calculator
Sum the diagonal entries of a square matrix.
About this tool
Enter a square matrix to add up its main diagonal. For [2 7 1; 3 5 9; 4 6 8] the trace is 2 + 5 + 8 = 15.
How to use
How it works
The trace adds the entries from top-left to bottom-right. It equals the sum of the eigenvalues, and it is unchanged by transposing or by similarity transforms, which makes it a useful check on an eigenvalue calculation.
tr(A) = Σ Aᵢᵢ = Σ λᵢ tr(AB) = tr(BA)
Worked example
A 3×3 matrix
- Input
- [2 7 1; 3 5 9; 4 6 8]
- Output
- 15
- Walkthrough
- Diagonal entries 2, 5 and 8: 2 + 5 + 8 = 15.
Limitations
- Square matrices only: [1 2 3; 4 5 6] returns a square-matrix error.
Questions
What is the trace of [2 7 1; 3 5 9; 4 6 8]?
How is the trace related to eigenvalues?
Does the trace change when you transpose?
Features
- Instant result
- Steps shown
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Introduction to scientific notation
Khan Academy
Scientific notation for calculator and number tools.
Watch on YouTubeFinding a percentage
Khan Academy
Percentage basics used across many calculator pages.
Watch on YouTube
- Percentages
Math is Fun
Percent of / percent change patterns for everyday calculators.
- Data Index
Math is Fun
Stats and probability explainers for data tools.