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.
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:
aij = 1 if i = j, and 0 if i ≠ j.
Example: 3 × 3 identity matrix
[ 0 1 0 ]
[ 0 0 1 ]
Properties of an Identity Matrix
1. Multiplicative identity
For any compatible matrix 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:
3. Inverse
An identity matrix is its own inverse:
4. Transpose
Transposing an identity matrix does not change it:
5. Trace
The trace is the sum of the main diagonal entries. Since an n × n identity matrix contains n diagonal ones:
6. Rank
All rows and columns of an identity matrix are linearly independent. Its rank equals its dimension:
7. Eigenvalues
Every eigenvalue of an identity matrix equals 1. Its characteristic polynomial is:
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:
[ 2 7 ]
I2 = [ 1 0 ]
[ 0 1 ]
Multiplying A by I2 gives:
[ 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 matrix | All ones | All zeros |
| Zero matrix | All zeros | All zeros |
| Diagonal matrix | Any values | All zeros |
| Scalar matrix | Same scalar value | All zeros |
| Symmetric matrix | Any values | Mirrored 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.