Diagonalization is the statement that a square matrix $A$ can be written $A = PDP^{-1}$ for an invertible matrix $P$ and a diagonal matrix $D$. In plain language: there is a basis of eigenvectors in which the linear map just scales each basis direction by its own number, with no mixing between directions. This page states when that factorization exists, builds it from eigenvectors and eigenvalues, and checks a 2 by 2 example and a 3 by 3 example by exact arithmetic. The geometry of the stretch factors lives on the eigenvalues in plain language page. The coordinate change that makes the map look diagonal is the same $P$ studied in change of basis explained.

What $A = PDP^{-1}$ says

Write the columns of $P$ as $\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_n$, and write the diagonal entries of $D$ as $\lambda_1, \lambda_2, \ldots, \lambda_n$. The matrix product $PD$ has columns $\lambda_1\mathbf{v}_1, \lambda_2\mathbf{v}_2, \ldots, \lambda_n\mathbf{v}_n$. The product $AP$ has columns $A\mathbf{v}_1, A\mathbf{v}_2, \ldots, A\mathbf{v}_n$. So the single matrix equation $AP = PD$ is exactly the list of eigenvector equations

$$A\mathbf{v}_i = \lambda_i\mathbf{v}_i \qquad\text{for each column }i.$$

If $P$ is invertible, multiply on the right by $P^{-1}$ to get $A = PDP^{-1}$. Gilbert Strang's treatment in Introduction to Linear Algebra and the matching lectures in MIT OpenCourseWare 18.06 open with the same two equations, $AP = PD$ and $A = PDP^{-1}$, and Jim Hefferon's open textbook Linear Algebra develops the same criterion: enough independent eigenvectors to fill the columns of $P$.

Diagonalization.

An $n$ by $n$ matrix $A$ is diagonalizable when there exist an invertible $P$ and a diagonal $D$ with $A = PDP^{-1}$. Equivalently, $A$ has a basis of eigenvectors.

When the factorization exists

You need $n$ linearly independent eigenvectors. That is the whole test. Distinct eigenvalues always produce independent eigenvectors, so an $n$ by $n$ matrix with $n$ distinct eigenvalues is always diagonalizable. A repeated eigenvalue is the danger case: algebraic multiplicity counts how many times the root appears in the characteristic polynomial, while geometric multiplicity counts how many independent eigenvectors that root actually gives. If any eigenspace is too small, you cannot fill $P$, and $A = PDP^{-1}$ does not exist over that field.

A classic failure is the Jordan block $J = \begin{pmatrix}3 & 1\\0 & 3\end{pmatrix}$. Its only eigenvalue is $3$, with algebraic multiplicity $2$, but every eigenvector is a multiple of $(1,0)$. One independent direction is not enough to build a 2 by 2 invertible $P$ of eigenvectors. The eigenvalues explainer works that example in detail. Symmetric real matrices always succeed: they always have an orthonormal eigenbasis, so $P^{-1}$ is just $P^{\mathsf T}$. That orthogonal shortcut is the same one the Gram Schmidt process prepares you for. Both use the ordinary dot product. A weighted product can move which pairs are perpendicular, which is the subject of inner product spaces.

Worked example 1: a 2 by 2 factorization

Let $A = \begin{pmatrix}4 & 1\\2 & 3\end{pmatrix}$. The trace is $7$ and the determinant is $10$, so the characteristic polynomial is $\lambda^2 - 7\lambda + 10 = (\lambda-5)(\lambda-2)$. The eigenvalues are $5$ and $2$. The 2 by 2 eigenvalue calculator reports those same two roots from the same trace and determinant.

For $\lambda = 5$, solve $(A-5I)\mathbf{v} = \mathbf{0}$:

$$A-5I = \begin{pmatrix}-1 & 1\\2 & -2\end{pmatrix}.$$

The rows are multiples, so the system is $-v_1 + v_2 = 0$. One eigenvector is $\mathbf{v}_1 = \begin{pmatrix}1\\1\end{pmatrix}$. Check: $A\begin{pmatrix}1\\1\end{pmatrix} = \begin{pmatrix}5\\5\end{pmatrix} = 5\begin{pmatrix}1\\1\end{pmatrix}$.

For $\lambda = 2$, the same work on $A-2I = \begin{pmatrix}2 & 1\\2 & 1\end{pmatrix}$ gives the line spanned by $\mathbf{v}_2 = \begin{pmatrix}1\\-2\end{pmatrix}$. Check: $A\begin{pmatrix}1\\-2\end{pmatrix} = \begin{pmatrix}2\\-4\end{pmatrix} = 2\begin{pmatrix}1\\-2\end{pmatrix}$.

Build $P$ with those eigenvectors as columns, and $D$ with the matching eigenvalues on the diagonal:

$$P = \begin{pmatrix}1 & 1\\1 & -2\end{pmatrix},\qquad D = \begin{pmatrix}5 & 0\\0 & 2\end{pmatrix}.$$

The determinant of $P$ is $1(-2) - 1(1) = -3$, nonzero, so $P$ is invertible. Using the 2 by 2 inverse formula, $P^{-1} = -\dfrac{1}{3}\begin{pmatrix}-2 & -1\\-1 & 1\end{pmatrix} = \begin{pmatrix}\tfrac{2}{3} & \tfrac{1}{3}\\\tfrac{1}{3} & -\tfrac{1}{3}\end{pmatrix}$. The 2 by 2 matrix calculator will match this inverse once you type in $P$.

Direct check: $AP = PD$.

$AP = \begin{pmatrix}4 & 1\\2 & 3\end{pmatrix}\begin{pmatrix}1 & 1\\1 & -2\end{pmatrix} = \begin{pmatrix}5 & 2\\5 & -4\end{pmatrix}$.

$PD = \begin{pmatrix}1 & 1\\1 & -2\end{pmatrix}\begin{pmatrix}5 & 0\\0 & 2\end{pmatrix} = \begin{pmatrix}5 & 2\\5 & -4\end{pmatrix}$.

The two products agree entry by entry. So $A = PDP^{-1}$ holds, confirmed by exact fractions, not a calculator estimate.

Second check: rebuild $A$ from $PDP^{-1}$.

$PD = \begin{pmatrix}5 & 2\\5 & -4\end{pmatrix}$, then $(PD)P^{-1} = \begin{pmatrix}5 & 2\\5 & -4\end{pmatrix}\begin{pmatrix}\tfrac{2}{3} & \tfrac{1}{3}\\\tfrac{1}{3} & -\tfrac{1}{3}\end{pmatrix} = \begin{pmatrix}4 & 1\\2 & 3\end{pmatrix}$, which is $A$ again.

Worked example 2: a 3 by 3 factorization

Let $A = \begin{pmatrix}3 & 1 & 1\\1 & 3 & 1\\1 & 1 & 3\end{pmatrix}$. This matrix is symmetric, so a full eigenbasis is guaranteed to exist. First find the eigenvalues. Notice that $A\begin{pmatrix}1\\1\\1\end{pmatrix} = \begin{pmatrix}5\\5\\5\end{pmatrix} = 5\begin{pmatrix}1\\1\\1\end{pmatrix}$, so $\lambda = 5$ is an eigenvalue with eigenvector $\mathbf{v}_1 = (1,1,1)$.

Any vector orthogonal to $(1,1,1)$ is a candidate for the repeated factor. Try $\mathbf{v}_2 = (1,-1,0)$: $A\begin{pmatrix}1\\-1\\0\end{pmatrix} = \begin{pmatrix}2\\-2\\0\end{pmatrix} = 2\begin{pmatrix}1\\-1\\0\end{pmatrix}$. Try $\mathbf{v}_3 = (1,1,-2)$: $A\begin{pmatrix}1\\1\\-2\end{pmatrix} = \begin{pmatrix}2\\2\\-4\end{pmatrix} = 2\begin{pmatrix}1\\1\\-2\end{pmatrix}$. So $\lambda = 2$ is a double eigenvalue with two independent eigenvectors. The three vectors $\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3$ are linearly independent (their matrix has determinant $6$, computed below), so they form a basis.

Build

$$P = \begin{pmatrix}1 & 1 & 1\\1 & -1 & 1\\1 & 0 & -2\end{pmatrix},\qquad D = \begin{pmatrix}5 & 0 & 0\\0 & 2 & 0\\0 & 0 & 2\end{pmatrix}.$$

Expanding $\det P$ along the middle of the second column, or by the usual 3 by 3 formula,

$$\det P = 1\bigl((-1)(-2)-1\cdot 0\bigr) - 1\bigl(1\cdot(-2)-1\cdot 1\bigr) + 1\bigl(1\cdot 0-(-1)\cdot 1\bigr) = 2 - (-3) + 1 = 6.$$

Nonzero, so $P$ is invertible. The 3 by 3 matrix calculator will match this determinant. The 3 by 3 eigenvalue calculator should report eigenvalues $5$, $2$, and $2$ from the characteristic polynomial of $A$.

Direct check: $AP = PD$.

The three columns of $AP$ are $A\mathbf{v}_1$, $A\mathbf{v}_2$, and $A\mathbf{v}_3$, already computed above as $5\mathbf{v}_1$, $2\mathbf{v}_2$, and $2\mathbf{v}_3$. Those are exactly the three columns of $PD$. Written out:

$$AP = PD = \begin{pmatrix}5 & 2 & 2\\5 & -2 & 2\\5 & 0 & -4\end{pmatrix}.$$

So $A = PDP^{-1}$ holds for this 3 by 3 matrix, checked by exact arithmetic on every column.

Why anyone bothers: powers become easy

Once $A = PDP^{-1}$, every positive integer power collapses to $A^n = PD^n P^{-1}$, and $D^n$ is just the diagonal of $\lambda_1^n, \ldots, \lambda_n^n$. For the 2 by 2 example above,

$$A^n = P\begin{pmatrix}5^n & 0\\0 & 2^n\end{pmatrix}P^{-1}.$$

That is the same shortcut the eigenvalues page used when it expanded an input in an eigenbasis and applied a scalar to each piece. Matrix exponentials for $\mathbf{x}' = A\mathbf{x}$ use the same factorization. Without a full set of eigenvectors, that clean formula is not available, which is why the Jordan block warning matters.

Checkpoints

  1. For $A = \begin{pmatrix}2 & 1\\1 & 2\end{pmatrix}$, find $P$ and $D$, then verify $AP = PD$ by hand.
  2. Explain in one sentence why $\begin{pmatrix}3 & 1\\0 & 3\end{pmatrix}$ cannot be written as $PDP^{-1}$ with a diagonal $D$ over the reals.
  3. For the 3 by 3 example, confirm that $\mathbf{v}_2$ and $\mathbf{v}_3$ are independent of each other and of $\mathbf{v}_1$ by checking that $\det P = 6 \neq 0$.

Common mistakes

  • Writing eigenvalues as columns of $P$. The columns of $P$ are eigenvectors. The eigenvalues sit on the diagonal of $D$, in matching order.
  • Mixing the order of $P$ and $D$. Column $i$ of $P$ must match diagonal entry $i$ of $D$. Swap the order and $AP = PD$ fails immediately.
  • Assuming a repeated eigenvalue is enough. Algebraic multiplicity counts roots. Geometric multiplicity counts independent eigenvectors. You need the second number to fill $P$.
  • Computing $P^{-1}AP$ with a non eigenbasis and expecting a diagonal. Any invertible $P$ gives a similar matrix $P^{-1}AP$, as change of basis shows. That similar matrix is diagonal only when the columns of $P$ are eigenvectors.

Related tools

The 2 by 2 eigenvalue calculator checks the roots used in worked example 1. The 3 by 3 eigenvalue calculator expands the characteristic polynomial for worked example 2. The 2 by 2 matrix calculator and 3 by 3 matrix calculator find $\det P$ and $P^{-1}$. The RREF calculator solves $(A-\lambda I)\mathbf{v} = \mathbf{0}$ when the null space is harder to see by hand. None of these tools assemble $P$ and $D$ for you.

Find the eigenvalues first, then build $P$ from eigenvectors and check $AP = PD$ by hand.

Open the 2 by 2 eigenvalue calculator

Where this fits

This explainer sits in the linear algebra cluster after eigenvalues in plain language and change of basis explained, beside the rank nullity theorem and linear independence. The wider map is the linear algebra topic, and a study order is the linear algebra first course pathway.

Sources and further reading

  • Gilbert Strang, Introduction to Linear Algebra, eigenvalue and diagonalization chapters. math.mit.edu/~gs/linearalgebra (accessed 19 Nov 2026)
  • MIT OpenCourseWare, 18.06 Linear Algebra (Spring 2010), lectures on eigenvalues and diagonalization. ocw.mit.edu (accessed 19 Nov 2026)
  • Jim Hefferon, Linear Algebra (open textbook), eigenvalue and diagonalization material. hefferon.net/linearalgebra (accessed 19 Nov 2026)
  • Dan Margalit and Joseph Rabinoff, Interactive Linear Algebra, Section 5.3 Similarity ($A$ and $P^{-1}AP$, and the diagonal case). textbooks.math.gatech.edu (accessed 19 Nov 2026)

Last reviewed: 20 November 2026.

Common questions

What does $A = PDP^{-1}$ mean in one sentence?

It means there is a basis of eigenvectors whose columns form the invertible matrix $P$, and in that basis the map $A$ is the diagonal matrix $D$ of eigenvalues. Applying $A$ is the same as changing into those coordinates, scaling each axis by its eigenvalue, then changing back.

When does a square matrix admit a factorization $A = PDP^{-1}$?

Exactly when there is a basis of eigenvectors: $n$ linearly independent eigenvectors for an $n$ by $n$ matrix. Distinct eigenvalues always give independent eigenvectors, so that case always works. A repeated eigenvalue can fail if the eigenspace is too small.

How do I check a claimed diagonalization by hand?

Build $P$ from the proposed eigenvectors as columns and $D$ from the matching eigenvalues on the diagonal. Compute $AP$ and $PD$ by exact arithmetic. They must be equal. Equivalently, compute $PDP^{-1}$ and match $A$ entry by entry. Also check that each column of $P$ really satisfies $A\mathbf{v} = \lambda\mathbf{v}$.

Which calculator should I use with this page?

Use the 2 by 2 eigenvalue calculator for the quadratic characteristic polynomial on a 2 by 2 matrix, and the 3 by 3 eigenvalue calculator when the matrix is 3 by 3. Use the matching matrix calculator for a determinant or inverse of $P$. Neither eigenvalue tool builds $P$ or $D$ for you; that assembly is yours.

Related reading