Diagonalize a 2x2 or 3x3 square matrix. This tool finds the eigenvalues and eigenvectors of your matrix A, then builds the eigenvector matrix P and diagonal matrix D so that A = PDP-1.
Enter your matrix entries below. If the matrix does not have enough independent real eigenvectors, the calculator will tell you it cannot be diagonalized over the reals.
Diagonalizing a square matrix A means writing it as A = PDP-1, where D is a diagonal matrix holding the eigenvalues of A, and P is a matrix whose columns are the corresponding eigenvectors. This is useful because diagonal matrices are far easier to work with, particularly when raising a matrix to a power or solving systems of linear equations.
Not every square matrix can be diagonalized using real numbers. A matrix fails to diagonalize over the reals when its eigenvalues are complex, or when a repeated eigenvalue does not have enough independent eigenvectors to span its full multiplicity (a defective matrix). In these cases you would need complex eigenvalues or a more general Jordan normal form instead of a true diagonal matrix.
Take the 2x2 matrix A = [[2, 1], [1, 2]]. The characteristic equation is (2 - λ)2 - 1 = 0, giving eigenvalues λ1 = 3 and λ2 = 1. Solving (A - 3I)v = 0 gives eigenvector [1, 1], and (A - I)v = 0 gives eigenvector [1, -1]. So P = [[1, 1], [1, -1]] and D = [[3, 0], [0, 1]], and A = PDP-1.
What does it mean to diagonalize a matrix? Diagonalizing a square matrix A means finding a diagonal matrix D and an invertible matrix P such that A = PDP-1. The columns of P are the eigenvectors of A, and the entries of D are the corresponding eigenvalues in the same order.
Why do some matrices fail to diagonalize? A matrix fails to diagonalize over the reals when it does not have enough linearly independent eigenvectors, or when its eigenvalues are complex, such as a matrix with a repeated eigenvalue but only one independent eigenvector.
What is diagonalization used for? It simplifies repeated matrix operations. Once A = PDP-1, A raised to the power k becomes PDkP-1, which is used in differential equations, Markov chains and dynamical systems.
Sources: Standard linear algebra methods for eigenvalues, eigenvectors and matrix diagonalization, as presented in undergraduate linear algebra texts (for example Gilbert Strang, Introduction to Linear Algebra).
This calculator handles real eigenvalues for 2x2 and 3x3 matrices. Results are rounded for display. Matrices with complex eigenvalues or repeated eigenvalues with insufficient independent eigenvectors cannot be diagonalized over the real numbers, and this will be shown in the result.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-02 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.