Quick guide
How to use this calculator
- Choose equal row and column counts.
- Enter the square matrix.
- Read the exact diagonal sum.
Calculation method
Sum the main diagonal
For an n × n matrix, the trace is a₁₁ + a₂₂ + … + aₙₙ. Rectangular matrices are rejected.
Worked example
Trace of a 3 × 3 matrix
Only the entries 2, 5, and −1 lie on the main diagonal.
tr(A) = 2 + 5 − 1 = 6
Supported inputs
Precision and limits
Matrix size
Each input matrix may contain 1–6 rows and 1–6 columns.
Entry precision
Each signed decimal may contain up to 30 digits and 15 decimal places.
Exactness
Finite decimals are converted to reduced fractions before calculation; matrix arithmetic is not rounded.
