Inverse of Diagonal Matrix — Formula & Examples

#Algebra
TL;DR
The inverse of a diagonal matrix is found by replacing each diagonal entry with its reciprocal, so diag⁡(d1,d2,…,dn)\operatorname{diag}(d_1, d_2, \ldots, d_n) inverts to diag⁡(1/d1,1/d2,…,1/dn)\operatorname{diag}(1/d_1, 1/d_2, \ldots, 1/d_n). This article gives the formula, a short proof, six worked examples, and the one condition that makes the inverse fail.
MV
Madhukar VLast updated on July 18, 20269 min read

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 11 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=[d10⋯0 0d2⋯0 ⋮⋮⋱⋮ 00⋯dn]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 di≠0d_i \neq 0, the inverse is

D−1=[1d10⋯0 01d2⋯0 ⋮⋮⋱⋮ 00⋯1dn]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 d1,d2,…,dnd_1, d_2, \ldots, d_n are the diagonal entries, and each becomes 1di\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−1D^{-1} is the inverse, multiply it by DD and check that the product is the identity matrix II. The product of two diagonal matrices is diagonal, with each entry the product of the matching entries:

D⋅D−1=[d1⋅1d10 0d2⋅1d2]=[10 01]=ID \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 di⋅1di=1d_i \cdot \frac{1}{d_i} = 1, and every off-diagonal entry stays 0. The same check works the other way (D−1⋅D=ID^{-1} \cdot D = I), so D−1D^{-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−1D^{-1} keeps the same diagonal shape as DD.

  • The determinant is the product of the entries. For D=diag⁡(d1,d2,…,dn)D = \operatorname{diag}(d_1, d_2, \ldots, d_n), det⁡(D)=d1d2⋯dn\det(D) = d_1 d_2 \cdots d_n, and so det⁡(D−1)=1d1d2⋯dn\det(D^{-1}) = \dfrac{1}{d_1 d_2 \cdots d_n}.

  • Powers stay diagonal. Raising DD to a power raises each diagonal entry to that power, and D−1D^{-1} is just DD with each entry taken to the power −1-1.

  • A diagonal matrix is symmetric, and so is its inverse. Because the only non-zero entries lie on the diagonal, D=DTD = D^{T} and D−1=(D−1)TD^{-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=[20 07]B = \begin{bmatrix} 2 & 0 \ 0 & 7 \end{bmatrix}.

Replace each diagonal entry with its reciprocal:

B−1=[120 017]B^{-1} = \begin{bmatrix} \dfrac{1}{2} & 0 \ 0 & \dfrac{1}{7} \end{bmatrix}

Example 2

Find the inverse of D=[20 00]D = \begin{bmatrix} 2 & 0 \ 0 & 0 \end{bmatrix}. (Watch the tempting move first.)

The instinct is to flip both entries: 12\frac{1}{2} and 10\frac{1}{0}.

But 10\frac{1}{0} is undefined. Check the reason: the second row is all zeros, so the determinant is 2×0=02 \times 0 = 0. A zero determinant means the matrix is singular.

Conclusion: DD has no inverse. A diagonal matrix with any zero on its diagonal cannot be inverted.

Example 3

Find the inverse of A=[200 0−30 005]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=[1200 0−130 0015]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=[140 023]C = \begin{bmatrix} \dfrac{1}{4} & 0 \ 0 & \dfrac{2}{3} \end{bmatrix}.

The reciprocal of a fraction flips it:

C−1=[40 032]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×22 \times 2 identity is diagonal with entries 1 and 1. The reciprocal of 1 is 1:

I−1=[110 011]=[10 01]=II^{-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=[30 03]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=[130 013]S^{-1} = \begin{bmatrix} \dfrac{1}{3} & 0 \ 0 & \dfrac{1}{3} \end{bmatrix}

Multiplying by S−1S^{-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 d1d_1, the second by d2d_2, and so on. Its inverse must undo each scaling, and the undo of "multiply by did_i" is "multiply by 1di\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×nn \times n matrix is expensive; inverting a diagonal one is nn 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 10\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 10\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-3, where the reader takes 13\frac{1}{3} and forgets the minus.

Don't do this: write the inverse of −3-3 as 13\frac{1}{3}.

The correct way: the reciprocal of −3-3 is −13-\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 did_i with 1di\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-3 is −13-\frac{1}{3}.

A Practical Next Step

Try inverting these: (1) [50 0−2]\begin{bmatrix} 5 & 0 \ 0 & -2 \end{bmatrix}; (2) [100 040 000]\begin{bmatrix} 1 & 0 & 0 \ 0 & 4 & 0 \ 0 & 0 & 0 \end{bmatrix}; (3) [120 06]\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.

  1. Invert [4009]\begin{bmatrix} 4 & 0 \\ 0 & 9 \end{bmatrix}.

  2. Invert [−2005]\begin{bmatrix} -2 & 0 \\ 0 & 5 \end{bmatrix}.

  3. Invert [3000]\begin{bmatrix} 3 & 0 \\ 0 & 0 \end{bmatrix}.

  4. Invert [1000−60002]\begin{bmatrix} 1 & 0 & 0 \\ 0 & -6 & 0 \\ 0 & 0 & 2 \end{bmatrix}.

  5. Invert [250010]\begin{bmatrix} \dfrac{2}{5} & 0 \\ 0 & 10 \end{bmatrix}.

Answers

  1. [140019]\begin{bmatrix} \dfrac{1}{4} & 0 \\ 0 & \dfrac{1}{9} \end{bmatrix}

  2. [−120015]\begin{bmatrix} -\dfrac{1}{2} & 0 \\ 0 & \dfrac{1}{5} \end{bmatrix}

  3. No inverse — the zero on the diagonal makes the matrix singular.

  4. [1000−1600012]\begin{bmatrix} 1 & 0 & 0 \\ 0 & -\dfrac{1}{6} & 0 \\ 0 & 0 & \dfrac{1}{2} \end{bmatrix}

  5. [5200110]\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

Frequently Asked Questions

How do you find the inverse of a diagonal matrix quickly?
Replace each main-diagonal entry with its reciprocal and leave the zeros in place. No determinant or adjugate is required.
When does a diagonal matrix not have an inverse?
When any diagonal entry is zero. That makes the determinant zero, so the matrix is singular and has no inverse.
Is the inverse of a diagonal matrix also diagonal?
Yes. Reciprocating only the diagonal entries keeps every off-diagonal entry at 0, so the inverse is diagonal too.
What is the inverse of the identity matrix?
The identity matrix itself, since the reciprocal of every diagonal 1 is 1.
Does this shortcut work for any square matrix?
No - only for diagonal matrices. A general matrix needs the full inverse of a matrix method with a determinant and adjugate.
✍️ Written By
Madhukar V
Madhukar V
Math Columnist & Analyst
I see mathematics as more than just numbers and formulas—it is a way of thinking, questioning, and understanding the world around us. I work at the intersection of mathematics, EdTech, technology, and AI-powered learning, I enjoy exploring how mathematical ideas can be made simple, meaningful, and relatable. Through my articles, I aim to present mathematics with curiosity and a practical perspective, helping readers see the beauty and relevance behind every concept in a Bhanzu way.
LinkedIn
Related Articles
Book a FREE Demo ClassBook Now →