Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
Matrix Multiplication CalculatorMatrix Trace CalculatorMatrix LU Decomposition CalculatorCharacteristic Polynomial CalculatorEigenvalue and Eigenvector CalculatorQR Decomposition CalculatorJordan Normal Form Calculator
Home Page > Math > Linear Algebra

Matrix Diagonalization Calculator

Diagonalize a square matrix by computing eigenvalues, eigenvectors, and the decomposition A = PDP⁻¹. Supports 2×2 to 5×5 matrices with step-by-step solutions, characteristic polynomial, multiplicity analysis, and interactive visualization.

Free to useNo sign-up requiredInstant Results
Matrix Diagonalization CalculatorTry it now — free ▼
Examples:
Matrix Size: 3 × 3
[
]

Embed Matrix Diagonalization Calculator Widget

About Matrix Diagonalization Calculator

The Matrix Diagonalization Calculator decomposes any square matrix into the form A = PDP⁻¹, where D is a diagonal matrix of eigenvalues and P is the matrix of eigenvectors. Enter a 2×2 to 5×5 matrix and get the complete factorization with step-by-step solutions, characteristic polynomial, algebraic and geometric multiplicity analysis, and interactive animation of the decomposition.

What Is Matrix Diagonalization?

Matrix diagonalization is the process of finding matrices P and D such that:

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

where D is a diagonal matrix whose entries are the eigenvalues of A, and P is an invertible matrix whose columns are the corresponding eigenvectors. Equivalently, \(D = P^{-1}AP\), which means D is similar to A.

λ
Eigenvalues
Scalars λ satisfying Av = λv. They appear on the diagonal of D.
Eigenvectors
Nonzero vectors v satisfying Av = λv. They form the columns of P.
Diagonal Matrix D
Contains eigenvalues on the diagonal, zeros elsewhere. Easy to compute powers.
Similarity
A and D are similar matrices — they represent the same transformation in different bases.

How to Diagonalize a Matrix

Step 1. Select the matrix size (2×2 to 5×5) and enter values into the grid. You can also click a quick example to load a preset matrix for testing.

Step 2. Click Diagonalize Matrix. The calculator computes the characteristic polynomial det(A − λI) and finds its roots (eigenvalues).

Step 3. For each eigenvalue, the tool solves (A − λI)x = 0 to find eigenvectors, and checks algebraic vs. geometric multiplicity to determine if the matrix is diagonalizable.

Step 4. If diagonalizable, the calculator constructs P (eigenvectors as columns), D (eigenvalues on diagonal), and P⁻¹, then verifies PDP⁻¹ = A.

Step 5. Explore the animated decomposition to visualize how A factors into P × D × P⁻¹, and step through the full solution using the navigation controls.

When Is a Matrix Diagonalizable?

ConditionDiagonalizable?Example
n distinct real eigenvaluesAlways yes\(\begin{pmatrix}2&1\\0&3\end{pmatrix}\) → λ = 2, 3
Symmetric matrix (A = Aᵀ)Always yes (real λ)Spectral theorem guarantees orthogonal diagonalization
Repeated λ with AM = GMYes\(\begin{pmatrix}5&0\\0&5\end{pmatrix}\) → λ = 5 (AM=2, GM=2)
Repeated λ with AM > GMNo\(\begin{pmatrix}1&1\\0&1\end{pmatrix}\) → λ = 1 (AM=2, GM=1)
Complex eigenvaluesOver ℂ: check AM = GM\(\begin{pmatrix}0&-1\\1&0\end{pmatrix}\) → λ = ±i

Algebraic vs. Geometric Multiplicity

For each eigenvalue λ:

Algebraic multiplicity (AM): the number of times λ appears as a root of the characteristic polynomial det(A − λI) = 0.

Geometric multiplicity (GM): the dimension of the eigenspace ker(A − λI), i.e., the number of linearly independent eigenvectors.

A matrix is diagonalizable if and only if GM = AM for every eigenvalue. The condition 1 ≤ GM ≤ AM always holds.

Why Diagonalization Matters

Matrix Powers
\(A^k = PD^kP^{-1}\). Since D is diagonal, \(D^k\) just raises each eigenvalue to the k-th power.
📈
Differential Equations
Systems x' = Ax decouple into independent equations when A is diagonalized: x' = PDP⁻¹x.
🔗
Markov Chains
Long-run behavior of transition matrices is determined by eigenvalues — diagonalization reveals steady states.
📊
PCA
Principal Component Analysis diagonalizes the covariance matrix to find the directions of maximum variance.

Diagonalization vs. Other Decompositions

DecompositionFormRequirement
Eigendecomposition (this tool)A = PDP⁻¹n independent eigenvectors
Spectral (symmetric)A = QΛQᵀA = Aᵀ (Q orthogonal)
Jordan Normal FormA = PJP⁻¹Any square matrix
SVDA = UΣVᵀAny matrix (even non-square)
LU DecompositionA = LUSquare, with conditions

Frequently Asked Questions

What does it mean to diagonalize a matrix?

Diagonalizing a matrix A means finding an invertible matrix P and a diagonal matrix D such that A = PDP⁻¹. The diagonal entries of D are the eigenvalues, and the columns of P are the corresponding eigenvectors.

When is a matrix diagonalizable?

A matrix is diagonalizable if and only if, for every eigenvalue, the geometric multiplicity equals the algebraic multiplicity. Equivalently, there must be n linearly independent eigenvectors for an n×n matrix. All symmetric real matrices and all matrices with n distinct eigenvalues are diagonalizable.

What is the difference between algebraic and geometric multiplicity?

The algebraic multiplicity is how many times an eigenvalue appears as a root of the characteristic polynomial. The geometric multiplicity is the dimension of the eigenspace, i.e., the number of linearly independent eigenvectors for that eigenvalue. A matrix is diagonalizable precisely when these two quantities are equal for every eigenvalue.

Can a matrix with complex eigenvalues be diagonalized?

Yes, a matrix with complex eigenvalues can still be diagonalized over the complex numbers, as long as the geometric multiplicity equals the algebraic multiplicity for each eigenvalue. The resulting P and D matrices will contain complex entries.

What are the applications of matrix diagonalization?

Matrix diagonalization is used to compute matrix powers efficiently (A^k = PD^kP⁻¹), solve systems of differential equations, analyze Markov chains and steady-state behavior, perform principal component analysis in statistics, and understand linear transformations in physics and engineering.

Reference this content, page, or tool as:

"Matrix Diagonalization Calculator" at https://MiniWebtool.com/matrix-diagonalization-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-04-12

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Linear Algebra:

Top & Updated:

Matrix Inverse CalculatorMatrix Rank CalculatorMatrix Power CalculatorView all →
Home Page > Math > Linear Algebra > Matrix Diagonalization Calculator