That makes it the matrix version of the number , and nearly every idea about “undoing” a matrix, from inverses to solving equations, is built on it. Below you will find the one-line reason the rule works, the size trap that catches people with non-square matrices, a fast way to check an inverse, the mistake of subtracting a plain number from a matrix, and where the identity shows up outside the classroom.
What is an identity matrix, and how do you write it?
An identity matrix has ones along the main diagonal (top left to bottom right) and zeros in every other position. It is written , or when the size matters:
In entry form, when and when . Each size has exactly one identity matrix, so “the identity matrix” really means “the one that fits.” You will also see it called the unit matrix, and a few books write (from the German Einheitsmatrix).
The most useful way to read the pattern is by columns. Column 1 of is , column 2 is , and column 3 is . These are the standard basis vectors, one unit step along each axis. Keep that in mind, because it is the whole reason the identity does what it does.
Two traps are worth knowing now. The identity must be square, so a block of ones and zeros is not an identity matrix. And the ones must run from top left to bottom right: the matrix has ones on the other diagonal, and it swaps rows instead of preserving them.
Quick check
Answer: 4 ones and 12 zeros
Why does multiplying by the identity matrix change nothing?
Entry of a product is row of the left matrix multiplied term by term with column of the right matrix, then added (the full procedure is on the matrix multiplication page). When the right-hand matrix is , column is all zeros except for a single in position . Every term in the sum vanishes except one:
That is the entire proof. Multiplying by the first basis vector picks out column 1 of , the second picks out column 2, and so on, in order. The columns come back in their original places, so .
Worked example 1. Compute for .
Row 1 with column 1: . Row 1 with column 2: . Row 2 with column 1: . Row 2 with column 2: .
Because the identity never touches the entries, negatives and fractions need no special care. For , the product is still , signs and fractions intact. What makes this special is that matrix multiplication normally depends on order ( for most pairs), yet the identity commutes with everything of its size, so .
Which size works for a non-square matrix?

The rule comes with fine print: the product must be defined. A product exists only when the columns of the left matrix equal the rows of the right matrix, and the result keeps the left matrix’s rows and the right matrix’s columns. For a matrix , that gives three cases:
- works: gives .
- works: gives .
- is undefined, because .
On the left of , use the identity with as many rows as has. On the right of , use the identity with as many columns as has.
Worked example 2. Compute for .
Row 1 of is . Against the three columns of : , , . Row 2 of is : , , .
Students lose points here by writing "" without checking sizes, or by using on both sides. A five-second habit prevents it: write the dimensions under each matrix before multiplying.
Is the identity matrix its own inverse? Key properties
Yes, and it is one of four facts that follow straight from the definition:
- , because the pattern is symmetric across the diagonal.
- for every positive integer , since (apply with ).
- : because , the identity meets the definition of an inverse of itself. There is nothing to undo.
- for every size.
For the determinant, the formula from the determinant of a 2×2 matrix gives . For , expanding along the first row (see the determinant of a 3×3 matrix) leaves , since the other two terms are multiplied by zeros.
The determinant of any triangular matrix is the product of its diagonal entries, so without any expansion.
Being its own inverse does not make the identity unique. The swap matrix also satisfies , so never proves that . By convention, for any square , the matrix echo of (and of from the logarithm rules). For more determinant work on larger matrices, the 3×3 determinant practice problems are a good next step.
How do you check that two matrices are inverses?
Two square matrices and are inverses exactly when . The identity is the target: if the product comes out as the identity, the matrices undo each other, and if it does not, they do not.
Worked example 3. Is the inverse of ?
Row 1 of with column 1 of : . Row 1 with column 2: . Row 2 with column 1: . Row 2 with column 2: .
So . As a cross-check, , and the recipe on the inverse of a 2×2 matrix page (swap the diagonal, negate the other two entries, divide by the determinant) produces exactly .
Two shortcuts save time. For square matrices, one product equal to is enough, so there is no need to compute as well. And you can reject a wrong candidate early: if the top-left entry of is not , or any off-diagonal entry is not , stop. The method has one failure point: if , no matrix can ever give , because has no inverse.
Quick check
Answer: Yes
How do you subtract a number from a matrix?

You cannot. An expression like is undefined, because a matrix and a single number have different shapes. The fix is to turn the number into a matrix that is allowed in the subtraction: , the identity scaled by . Then subtracts from the diagonal entries only, and the rules for adding and subtracting matrices apply because both matrices have the same size.
Worked example 4. For , find the values of that make .
First, . Then take the determinant:
Factor: , so or . These are the eigenvalues of . If a quadratic does not factor so neatly, the quadratic formula practice problems cover the fallback.
The identity also keeps algebra honest when expanding. Because , matrix expressions with expand like ordinary algebra: , where the last term is , not . As with numbers, powers and products come before sums (see order of operations practice problems if that needs a refresher).
Try this: Let . Compute , then compute and separately and confirm they match. (Answers: and both sides equal .)
Identity matrix vs matrix of ones, zero matrix and scalar matrix
Four special matrices get mixed up constantly. Each has a different job:
| Matrix | Entries ( case) | Acts like |
|---|---|---|
| Identity | the number : | |
| Zero matrix | the number : | |
| Scalar matrix | multiplying by : | |
| Matrix of ones | nothing like : |
The matrix of ones is the usual confusion. Its entries are all , but multiplying by it does not preserve anything: , which is not . The zero matrix is the additive identity (it leaves a matrix unchanged under addition), while the identity is the multiplicative identity. A scalar matrix is the identity stretched by , which is why simply multiplies every entry of by .
The identity is also a special case of a diagonal matrix, one whose only nonzero entries lie on the main diagonal. A general diagonal matrix scales each row or column by a different amount. The identity scales them all by exactly , which is the same as doing nothing.
Where is the identity matrix used in real life?
In geometry, every transformation matrix moves points around, and the identity is the transformation that moves nothing. A rotation by angle is , and at (or a full turn of , from types of angles) it becomes . Graphics and game software start every object with the identity transform, then multiply rotations, scalings and shifts onto it one at a time.
In solving, the identity is the finish line. To find an inverse by Gauss-Jordan elimination, write and row-reduce until the left half becomes . The same row operations that turn into turn the right half into . For a system with invertible , multiplying both sides by gives , so .
In economics, the Leontief input-output model asks how much total output an economy must produce to meet outside demand when producing goods consumes other goods, described by a matrix . The balance rearranges to , so . The identity is what lets "" be written as a single matrix times . In code, you create one with numpy.eye(n) in Python or eye(n) in MATLAB.
The smallest case ties back to lines. The identity is , ordinary multiplication by one. As a function, is the “do nothing” line, with slope and intercept in slope-intercept form.
Quick check
Answer:
Practice problems
0 of 5 solved
- Find and if is the identity matrix.
Answer:
The diagonal entries of an identity matrix are both . So . Also , which gives . The off-diagonal zeros already match. - A matrix is . Which identity matrix makes true, and which makes true?
Answer: and
For the inner sizes must match: has columns, so must be . For , must have as many columns as has rows, so is . - Let . Find .
Answer:
Subtract only from the diagonal: . Then . - Is the inverse of ?
Answer: Yes
Compute . Row 1: and . Row 2: and . So , and . - Find so that for .
Answer:
Multiply: . For this to equal , need and . The first gives , and also works.
Common questions
What is the identity matrix?
It is the square matrix with in every main-diagonal position and everywhere else. Multiplying any matrix of compatible size by it returns the same matrix, so it plays the role of the number .
Is the identity matrix always square?
Yes. The identity matrix has to be so that the diagonal of ones fits and so that it can multiply a matrix from either side. When you multiply a non-square matrix, you use a different-sized identity on each side.
What is the determinant of the identity matrix?
It is always , for every size. The identity is triangular, so its determinant is the product of the diagonal entries, which is .
Is the identity matrix its own inverse?
Yes, . The inverse of a matrix is the matrix that multiplies with it to give , and already does that.
Is the identity matrix the same as a unit matrix?
Yes, the two names mean the same thing. Some textbooks also write it as , from the German word Einheitsmatrix, but is the standard symbol in US courses.
Does AI equal IA?
For a square matrix and the identity of the same size, yes: both products equal . The identity is one of the few matrices that commutes with every matrix of its size, even though matrix multiplication usually depends on order.