Skip to content

Matrix Diagonals

Definition

For an m×nm\times n matrix A=(aij)\boldsymbol{A}=(a_{ij}):

  • the main diagonal consists of the entries aiia_{ii} with i≤min⁡(m,n)i\le\min(m,n);
  • the anti-diagonal of a square matrix (m=nm=n) consists of the entries an+1−i,ia_{n+1-i,i};
  • the off-diagonal entries are all entries aija_{ij} with i≠ji\neq j.

Interpretation

The main diagonal runs from the top-left entry downwards to the right, through the entries whose row and column index agree. The anti-diagonal of a square matrix runs from bottom-left to top-right; the off-diagonal entries are all the others.

A 3 by 4 matrix with a line through the entries a11, a22 and a33, its main diagonal.

In the 3×43\times4 matrix shown, the main diagonal (shaded) is a11,a22,a33a_{11},a_{22},a_{33}. It stops after min⁡(3,4)=3\min(3,4)=3 entries, so a non-square matrix has a main diagonal too, but it does not end in the bottom-right corner.

Diagonal matrices have zeros everywhere off the main diagonal and triangular matrices on one side of it. The transpose mirrors a matrix in it, so the diagonal entries stay in place.


Key Results

  • Diagonal entries are central in definitions of diagonal matrices, triangular matrices, and the trace.
  • A square matrix is diagonal exactly when all off-diagonal entries are zero.

Examples

  • In (1234)\begin{pmatrix}1&2\\3&4\end{pmatrix}, the main diagonal is (1,4)(1,4) and the anti-diagonal is (3,2)(3,2).
  • In (1004)\begin{pmatrix}1&0\\0&4\end{pmatrix}, all off-diagonal entries are zero.

Prerequisites

Sources

Aliases: matrix diagonal, leading diagonal Keywords: principal diagonal, main diagonal, anti-diagonal, antidiagonal, off-diagonal, diagonal entries

Last updated: 20 October 2026 03:02