Matrices.org

Identity Matrix Generator

Generate an identity matrix online in seconds. Choose a square matrix size from 1 × 1 to 20 × 20 and instantly create a matrix with ones on the main diagonal and zeros everywhere else. Copy, download or print your result.

Generate an Identity Matrix

Select the number of rows and columns. An identity matrix must always be square, so both dimensions will be equal.

Choose a square matrix from 1 × 1 to 20 × 20.

What Is an Identity Matrix?

An identity matrix is a square matrix in which every entry on the main diagonal equals 1 and every entry outside the main diagonal equals 0. It is usually represented by the letter I.

The identity matrix is the multiplicative identity of matrix algebra. Multiplying a compatible matrix by an identity matrix leaves the original matrix unchanged, just as multiplying a number by 1 leaves that number unchanged.

General identity matrix notation

An identity matrix of size n is written as In. Its entries are defined by:

In = [aij], where
aij = 1 if i = j, and 0 if i ≠ j.

Example: 3 × 3 identity matrix

I3 = [ 1   0   0 ]
[ 0   1   0 ]
[ 0   0   1 ]

Properties of an Identity Matrix

1. Multiplicative identity

For any compatible matrix A:

AI = IA = A

The identity matrix does not change a matrix when multiplied on either side, provided the dimensions are compatible.

2. Determinant

The determinant of every identity matrix is 1:

det(In) = 1

3. Inverse

An identity matrix is its own inverse:

In−1 = In

4. Transpose

Transposing an identity matrix does not change it:

InT = In

5. Trace

The trace is the sum of the main diagonal entries. Since an n × n identity matrix contains n diagonal ones:

tr(In) = n

6. Rank

All rows and columns of an identity matrix are linearly independent. Its rank equals its dimension:

rank(In) = n

7. Eigenvalues

Every eigenvalue of an identity matrix equals 1. Its characteristic polynomial is:

det(λI − I) = (λ − 1)n

8. Symmetry

An identity matrix is symmetric because it equals its transpose. It is also diagonal and orthogonal.

Example: Multiplying by an Identity Matrix

Consider the following matrix A and the 2 × 2 identity matrix:

A = [ 3   5 ]
    [ 2   7 ]

I2 = [ 1   0 ]
        [ 0   1 ]

Multiplying A by I2 gives:

AI2 = [ 3(1) + 5(0)   3(0) + 5(1) ]
         [ 2(1) + 7(0)   2(0) + 7(1) ]

= [ 3   5 ]
  [ 2   7 ] = A

The identity matrix leaves A unchanged. This property is fundamental to matrix multiplication and the definition of matrix inverses.

Identity Matrix vs. Other Special Matrices

Matrix type Main diagonal Off-diagonal entries
Identity matrixAll onesAll zeros
Zero matrixAll zerosAll zeros
Diagonal matrixAny valuesAll zeros
Scalar matrixSame scalar valueAll zeros
Symmetric matrixAny valuesMirrored across diagonal

An identity matrix is a special case of both a diagonal matrix and a scalar matrix, with scalar value equal to 1.

Frequently Asked Questions

1. What is an identity matrix in linear algebra?

An identity matrix is a square matrix with ones along its main diagonal and zeros everywhere else. It acts as the multiplicative identity in matrix algebra.

2. What is the identity matrix of order 2?

The 2 × 2 identity matrix is I2 = [[1, 0], [0, 1]].

3. What is the identity matrix of order 3?

The 3 × 3 identity matrix has ones at positions (1,1), (2,2) and (3,3), with zeros in all six remaining positions.

4. Is an identity matrix always square?

Yes. An identity matrix must have the same number of rows and columns.

5. What is the determinant of an identity matrix?

The determinant is always 1, regardless of the matrix dimension.

6. What is the inverse of an identity matrix?

The inverse is the identity matrix itself because multiplying it by itself produces the identity matrix.

7. Is an identity matrix diagonal?

Yes. It is a special diagonal matrix whose diagonal entries are all equal to 1.

8. What is the trace of an identity matrix?

The trace of an n × n identity matrix is n, since there are n ones on its main diagonal.

9. What is the rank of an identity matrix?

The rank equals its dimension n because all n rows and n columns are linearly independent.

10. Can an identity matrix be multiplied by a rectangular matrix?

Yes, provided the dimensions are compatible. Multiplication by an identity matrix of the appropriate size leaves the rectangular matrix unchanged.

Related Calculators