Linear Algebra & Matrices

Matrix Trace Calculator

Add the main-diagonal entries of a square matrix exactly.

Linear Algebra & Matrices

Enter matrix values

Exact rational arithmetic
Matrix A

Use ordinary signed decimals. Fractions, commas, and scientific notation are not accepted in this first batch.

Exact result

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Quick guide

How to use this calculator

  1. Choose equal row and column counts.
  2. Enter the square matrix.
  3. 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.