Skip to content
Calculator Collection

3x3 Matrix Trace Calculator

Compute the trace of a 3×3 matrix as the sum of its diagonal entries: a11 + a22 + a33. The trace equals the sum of eigenvalues and is invariant under similarity transformations.

Last updated: May 2026

Fill in the required fields to see your result.

Compare with similar

About this calculator

The trace of a square matrix is the sum of its diagonal entries: tr(A) = Σ aᵢᵢ. For this 3×3 calculator, tr(A) = a11 + a22 + a33. Despite ignoring all off-diagonal entries, the trace carries substantial information about the matrix: it equals the sum of eigenvalues (counted with multiplicity), is invariant under similarity transformations (tr(P⁻¹AP) = tr(A) for any invertible P), is linear (tr(A + B) = tr(A) + tr(B), tr(cA) = c·tr(A)), and satisfies the cyclic property tr(ABC) = tr(BCA) = tr(CAB) for compatible matrix products. Geometrically, the trace appears in the divergence of vector fields, in the time derivative of the determinant via tr(A⁻¹ · dA/dt), and in characterising orientation-preserving rotations (a rotation matrix in 3D has trace 1 + 2·cos θ, where θ is the rotation angle). Edge cases: only diagonal entries matter, so this calculator collects only a11, a22, a33 and ignores all other matrix elements; for full matrix calculations (determinant, inverse, eigenvalues) the off-diagonal entries are essential. The trace exists only for square matrices; non-square matrices have no trace. For matrices over fields other than ℝ or ℂ, the definition extends naturally as long as addition is defined.

How to use

Example 1 — identity-like matrix. A = [[2, 1, 0], [0, 5, 3], [1, 2, 4]]. Inputs: a11 = 2, a22 = 5, a33 = 4. Step 1: tr(A) = 2 + 5 + 4 = 11. Verify: only diagonal entries contribute, and 2 + 5 + 4 = 11 ✓. The off-diagonal entries (1, 0, 0, 3, 1, 2) play no role in the trace, though they are essential for computing det(A), eigenvalues, or matrix products. Example 2 — relating trace to eigenvalues. A symmetric matrix has trace 6 (a11 = 1, a22 = 2, a33 = 3). Inputs: a11 = 1, a22 = 2, a33 = 3. Step 1: tr(A) = 1 + 2 + 3 = 6. Verify: if this matrix's eigenvalues are λ1, λ2, λ3, then by the trace-eigenvalue identity λ1 + λ2 + λ3 = tr(A) = 6. For a diagonal matrix with these entries, the eigenvalues are exactly 1, 2, 3, summing to 6 ✓. For a non-diagonal matrix with the same diagonal, the eigenvalues will differ from the diagonal entries individually but still sum to 6.

Frequently asked questions

Why is the trace equal to the sum of eigenvalues?

The characteristic polynomial of an n×n matrix A is det(λI − A) = λⁿ − tr(A)·λⁿ⁻¹ + ... + (−1)ⁿ det(A). The coefficient of λⁿ⁻¹ is the negative of the trace, and this coefficient also equals the negative of the sum of the polynomial's roots (Vieta's formulas). The roots are the eigenvalues, so their sum equals tr(A). Equivalently, the trace is invariant under similarity transformations (tr(P⁻¹AP) = tr(A)), and any matrix can be diagonalised over the complex numbers using its eigendecomposition (or brought to Jordan form), at which point the trace equals the sum of the diagonal entries, which are the eigenvalues. This identity is extraordinarily useful: it lets you compute the sum of eigenvalues without diagonalising the matrix, which is a tiny fraction of the work, and it provides a quick sanity check on numerical eigenvalue computations.

What does it mean that the trace is invariant under similarity transformations?

Two matrices A and B are similar if B = P⁻¹AP for some invertible matrix P; geometrically, B represents the same linear transformation as A but in a different basis. The trace is invariant under this change of basis: tr(P⁻¹AP) = tr(A). This is because tr(AB) = tr(BA) for any compatible product (the cyclic property), so tr(P⁻¹AP) = tr(APP⁻¹) = tr(A). The practical implication: trace is a property of the underlying linear transformation, not of the specific matrix representation. The same is true of the determinant (det(P⁻¹AP) = det(A)) and of the entire characteristic polynomial. This is why trace and determinant appear in basis-independent quantities like the characteristic polynomial coefficients and why they are 'natural' invariants of linear maps.

Where does the trace show up in physics and applied math?

In physics, the trace of a stress tensor gives the volumetric (isotropic) part of stress; the trace of a moment-of-inertia tensor relates to the total kinetic energy of rotation. In quantum mechanics, the expectation value of an observable A in a density-matrix state ρ is tr(ρA), and the trace of the density matrix is always 1 (normalisation). In statistics, the trace of a covariance matrix is the total variance — the sum of variances along each coordinate, which equals the sum of eigenvalues (the principal component variances). In optimisation, the trace of A·B' (Frobenius inner product) is a common scalar measure of how well two matrices align. In machine learning, the trace appears in the Frobenius norm (|A|_F² = tr(A^T·A)), in regularisation terms, and in gradient computations of matrix-valued losses. In dynamical systems, the divergence of a vector field is the trace of its Jacobian, encoding the local rate of volume expansion or compression.

What are the common mistakes when computing matrix trace?

The biggest mistake is including off-diagonal entries — only the diagonal contributes, so a11 + a12 + a13 + a22 + ... is wrong. The trace is just the sum of a11, a22, a33 for a 3×3. The second mistake is computing the trace of a non-square matrix; the trace is only defined for square matrices because 'diagonal' only makes sense when row index equals column index. The third is confusing trace with determinant — they share some properties (both basis-invariant, both equal products/sums of eigenvalues) but are entirely different functions; trace is linear (tr(A+B) = tr(A)+tr(B)), determinant is multiplicative (det(AB) = det(A)det(B)). People also forget the cyclic property of trace for matrix products: tr(AB) = tr(BA), but in general tr(AB) ≠ tr(A)·tr(B). Finally, for matrices with complex entries, the trace is the complex sum of diagonal entries and may be complex itself.

When should I not use this calculator?

Do not use it for matrices of size other than 3×3 — for 2×2 sum a11+a22, for n×n sum all diagonal entries. The current tool collects only three inputs and cannot handle larger or smaller dimensions. It is not appropriate for non-square matrices, where the trace is undefined. Do not use it as a substitute for the determinant when testing invertibility — trace and determinant are different quantities, and a non-zero trace says nothing about whether the matrix is invertible (the zero matrix has trace 0 but so does I − I, which is invertible? No — I − I is the zero matrix; different example: [[1, 0], [0, −1]] has trace 0 but is invertible). Avoid it as a substitute for full eigenvalue computation; trace gives the sum of eigenvalues but not the individual values, which usually matter more. For matrices over complex numbers, ensure the calculator handles complex inputs (this one assumes real entries). Finally, do not use trace as a single-number summary of a matrix's 'size' or 'importance' — Frobenius norm, spectral norm, or condition number are usually more informative for those purposes.

Sources & references