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
  1. 1EnterProvide the known values
  2. 2CalculateResults update automatically
  3. 3VerifyReview the details and units
Try an example
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.

Feedback

Understand the subject

What does trace measure?

Trace adds the entries on a square matrix’s main diagonal.

Use it as a structural invariant in square-matrix calculations.

The relationship

The defining relationship

See the structure

What the calculation is doing

Worked interpretation

Read the result in context

tr(A)=Σᵢaᵢᵢ

Interpret with care

Important boundary

Trace is defined here only for square matrices.

Use the Matrix Calculator to experiment with small exact matrix operations before applying a more specialized route.

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.