What the Inverse of a Diagonal Matrix Is
The inverse of a diagonal matrix is another diagonal matrix in which each main-diagonal entry is the reciprocal of the matching entry in the original, provided none of those entries is zero. A diagonal matrix is a square matrix whose only non-zero entries lie on the main diagonal — every off-diagonal entry is 0.
If you stopped reading here, you would have the answer: flip each diagonal number to $1$ over itself, leave the zeros alone, and that is the inverse. The rest of the article proves why it works and shows exactly when it does not.
The Formula For a Diagonal Matrix
$$D = \begin{bmatrix} d_1 & 0 & \cdots & 0 \ 0 & d_2 & \cdots & 0 \ \vdots & \vdots & \ddots & \vdots \ 0 & 0 & \cdots & d_n \end{bmatrix}$$
with every $d_i \neq 0$, the inverse is
$$D^{-1} = \begin{bmatrix} \dfrac{1}{d_1} & 0 & \cdots & 0 \ 0 & \dfrac{1}{d_2} & \cdots & 0 \ \vdots & \vdots & \ddots & \vdots \ 0 & 0 & \cdots & \dfrac{1}{d_n} \end{bmatrix}$$
Here $d_1, d_2, \ldots, d_n$ are the diagonal entries, and each becomes $\frac{1}{d_i}$ in the inverse. No determinant and no adjugate are needed — a genuine shortcut compared with the general inverse of a matrix.
A Short Proof
To confirm $D^{-1}$ is the inverse, multiply it by $D$ and check that the product is the identity matrix $I$. The product of two diagonal matrices is diagonal, with each entry the product of the matching entries:
$$D \cdot D^{-1} = \begin{bmatrix} d_1 \cdot \dfrac{1}{d_1} & 0 \ 0 & d_2 \cdot \dfrac{1}{d_2} \end{bmatrix} = \begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} = I$$
Each diagonal product is $d_i \cdot \frac{1}{d_i} = 1$, and every off-diagonal entry stays 0. The same check works the other way ($D^{-1} \cdot D = I$), so $D^{-1}$ is the inverse. This is exactly why the reciprocal rule holds.
Properties of the Inverse of a Diagonal Matrix
A few properties follow directly from the reciprocal rule and are worth stating on their own.
Invertibility condition. A diagonal matrix is invertible if and only if every diagonal entry is non-zero. A single zero on the diagonal makes the determinant zero, so the matrix is singular and no inverse exists.
The inverse is diagonal. Reciprocating only the diagonal entries leaves every off-diagonal entry at 0, so $D^{-1}$ keeps the same diagonal shape as $D$.
The determinant is the product of the entries. For $D = \operatorname{diag}(d_1, d_2, \ldots, d_n)$, $\det(D) = d_1 d_2 \cdots d_n$, and so $\det(D^{-1}) = \dfrac{1}{d_1 d_2 \cdots d_n}$.
Powers stay diagonal. Raising $D$ to a power raises each diagonal entry to that power, and $D^{-1}$ is just $D$ with each entry taken to the power $-1$.
A diagonal matrix is symmetric, and so is its inverse. Because the only non-zero entries lie on the diagonal, $D = D^{T}$ and $D^{-1} = (D^{-1})^{T}$.
The first bullet is the one that decides everything: check the diagonal for a zero before you reach for reciprocals.
Examples of the Inverse of a Diagonal Matrix
Each example states the matrix in bold, then works the inverse.
Example 1
Find the inverse of $B = \begin{bmatrix} 2 & 0 \ 0 & 7 \end{bmatrix}$.
Replace each diagonal entry with its reciprocal:
$$B^{-1} = \begin{bmatrix} \dfrac{1}{2} & 0 \ 0 & \dfrac{1}{7} \end{bmatrix}$$
Example 2
Find the inverse of $D = \begin{bmatrix} 2 & 0 \ 0 & 0 \end{bmatrix}$. (Watch the tempting move first.)
The instinct is to flip both entries: $\frac{1}{2}$ and $\frac{1}{0}$.
But $\frac{1}{0}$ is undefined. Check the reason: the second row is all zeros, so the determinant is $2 \times 0 = 0$. A zero determinant means the matrix is singular.
Conclusion: $D$ has no inverse. A diagonal matrix with any zero on its diagonal cannot be inverted.
Example 3
Find the inverse of $A = \begin{bmatrix} 2 & 0 & 0 \ 0 & -3 & 0 \ 0 & 0 & 5 \end{bmatrix}$.
Take the reciprocal of each diagonal entry, carrying the sign:
$$A^{-1} = \begin{bmatrix} \dfrac{1}{2} & 0 & 0 \ 0 & -\dfrac{1}{3} & 0 \ 0 & 0 & \dfrac{1}{5} \end{bmatrix}$$
Example 4
Find the inverse of $C = \begin{bmatrix} \dfrac{1}{4} & 0 \ 0 & \dfrac{2}{3} \end{bmatrix}$.
The reciprocal of a fraction flips it:
$$C^{-1} = \begin{bmatrix} 4 & 0 \ 0 & \dfrac{3}{2} \end{bmatrix}$$
Example 5
Verify that the inverse of the identity matrix is itself.
The $2 \times 2$ identity is diagonal with entries 1 and 1. The reciprocal of 1 is 1:
$$I^{-1} = \begin{bmatrix} \dfrac{1}{1} & 0 \ 0 & \dfrac{1}{1} \end{bmatrix} = \begin{bmatrix} 1 & 0 \ 0 & 1 \end{bmatrix} = I$$
So the identity matrix is its own inverse.
Example 6
A scaling problem: matrix $S = \begin{bmatrix} 3 & 0 \ 0 & 3 \end{bmatrix}$ stretches every vector by 3. Find the matrix that undoes the stretch.
The undo is the inverse:
$$S^{-1} = \begin{bmatrix} \dfrac{1}{3} & 0 \ 0 & \dfrac{1}{3} \end{bmatrix}$$
Multiplying by $S^{-1}$ shrinks each vector back by a factor of 3 — the geometric meaning of the reciprocal.
Why the Reciprocal Rule Works
The rule is not a lucky pattern — it comes straight from what a diagonal matrix does. Reading a diagonal matrix geometrically, it scales the first axis by $d_1$, the second by $d_2$, and so on. Its inverse must undo each scaling, and the undo of "multiply by $d_i$" is "multiply by $\frac{1}{d_i}$." Nothing gets mixed between axes, which is why the off-diagonal zeros stay zero.
This is where diagonal matrices earn their keep:
They make computation cheap. Inverting a general $n \times n$ matrix is expensive; inverting a diagonal one is $n$ reciprocals. This is a large part of why diagonalisation — rewriting a matrix in a diagonal-friendly basis — matters across linear algebra.
They model independent scalings. In graphics and data work, a diagonal matrix scales each coordinate on its own, and its inverse rescales them back. Covariance and transformation steps lean on exactly this.
The zero-on-the-diagonal case flags a collapse. A zero diagonal entry means one direction has been flattened to nothing — information is lost, and no inverse can bring it back.
The high-stakes echo: when a system of equations is solved by inverting a matrix and one scaling factor is (or rounds to) zero, the inverse blows up. Numerical solvers that ignore a near-zero pivot can produce wildly wrong results — the matrix version of a division by zero slipping into a live calculation.
Where Students Trip Up on the Inverse of a Diagonal Matrix
Mistake 1: Inverting when a diagonal entry is zero
Where it slips in: applying the reciprocal rule on autopilot.
Don't do this: write $\frac{1}{0}$ for a zero diagonal entry and keep going.
The correct way: first check that every diagonal entry is non-zero. If any is zero, the matrix is singular and has no inverse. The learner who trusts the shortcut without checking the entries is the one who reports an inverse for a matrix that doesn't have one.
Mistake 2: Reciprocating the whole matrix, off-diagonal included
Where it slips in: confusing "reciprocal of the matrix" with "reciprocal of each diagonal entry."
Don't do this: try to take $\frac{1}{0}$ on the off-diagonal zeros too.
The correct way: only the diagonal entries flip; the off-diagonal zeros stay 0. The inverse of a diagonal matrix is still diagonal.
Mistake 3: Dropping the sign
Where it slips in: entries like $-3$, where the reader takes $\frac{1}{3}$ and forgets the minus.
Don't do this: write the inverse of $-3$ as $\frac{1}{3}$.
The correct way: the reciprocal of $-3$ is $-\frac{1}{3}$ — the sign carries through. This is the same care needed when solving matrices with negative entries.
Key Takeaways
The inverse of a diagonal matrix replaces each diagonal entry $d_i$ with $\frac{1}{d_i}$ and keeps the zeros.
It exists only if every diagonal entry is non-zero; a single zero makes the matrix singular.
The inverse of a diagonal matrix is itself diagonal.
The rule needs no determinant or adjugate — a major computational shortcut.
Signs carry through, so the reciprocal of $-3$ is $-\frac{1}{3}$.
A Practical Next Step
Try inverting these: (1) $\begin{bmatrix} 5 & 0 \ 0 & -2 \end{bmatrix}$; (2) $\begin{bmatrix} 1 & 0 & 0 \ 0 & 4 & 0 \ 0 & 0 & 0 \end{bmatrix}$; (3) $\begin{bmatrix} \frac{1}{2} & 0 \ 0 & 6 \end{bmatrix}$. If (2) stumps you, come back to Example 2 and check the diagonal for a zero. To take matrices further with a teacher, explore Bhanzu's algebra tutor, get help with algebra, or work with a high school math tutor.
Want a live Bhanzu trainer to walk through more matrix problems? Book a free demo class — available online globally.
Practice Questions
Find each inverse, or state why it does not exist.
Invert $\begin{bmatrix} 4 & 0 \\ 0 & 9 \end{bmatrix}$.
Invert $\begin{bmatrix} -2 & 0 \\ 0 & 5 \end{bmatrix}$.
Invert $\begin{bmatrix} 3 & 0 \\ 0 & 0 \end{bmatrix}$.
Invert $\begin{bmatrix} 1 & 0 & 0 \\ 0 & -6 & 0 \\ 0 & 0 & 2 \end{bmatrix}$.
Invert $\begin{bmatrix} \dfrac{2}{5} & 0 \\ 0 & 10 \end{bmatrix}$.
Answers
$\begin{bmatrix} \dfrac{1}{4} & 0 \\ 0 & \dfrac{1}{9} \end{bmatrix}$
$\begin{bmatrix} -\dfrac{1}{2} & 0 \\ 0 & \dfrac{1}{5} \end{bmatrix}$
No inverse — the zero on the diagonal makes the matrix singular.
$\begin{bmatrix} 1 & 0 & 0 \\ 0 & -\dfrac{1}{6} & 0 \\ 0 & 0 & \dfrac{1}{2} \end{bmatrix}$
$\begin{bmatrix} \dfrac{5}{2} & 0 \\ 0 & \dfrac{1}{10} \end{bmatrix}$
Read More
Was this article helpful?
Your feedback helps us write better content
