Home Calculators Categories Category: Math, Statistics & Education

Eigenvalue Calculator

This eigenvalue calculator finds the eigenvalues and normalized eigenvectors of a real 2×2 or 3×3 matrix. It also shows the characteristic polynomial, the algebraic and geometric multiplicity of each eigenvalue, and a complex-plane plot of the roots. Enter a matrix below, or choose an example, and the results update as you type.

Input
Enter a square matrix with two or three rows. Use spaces between columns and newlines between rows.

One row per line; separate columns with spaces or commas. Semicolons also separate rows. Decimal and scientific notation accepted.

Real entries from −1,000,000 to 1,000,000; nonzero magnitudes at least 1e−12. Results are numerical, shown to six significant digits.

Try a complex pair: 0 −1; 1 0 (type the minus sign as -). Try a repeated root: 2 1; 0 2.

Visual
Eigenvalues on the complex planeHorizontal: real part. Vertical: imaginary part. Axes rescale to the entered matrix.
Output

Eigenvalues λ

—

Repeated roots appear once per algebraic multiplicity.

Normalized eigenvectors / eigenspace bases

—

Each vector has norm 1. A different sign or complex phase is equally valid.

Calculation details

Algebraic and geometric multiplicities

—

Characteristic polynomial det(λI − A)

—

Calculation steps

—

How to use the calculator

Type or paste a square matrix into Real matrix A (2×2 or 3×3). The calculator detects the size from the text, so there is no separate size control.

  • Put one row per line, or separate rows with semicolons. 2 1; 1 2 and the same matrix written on two lines are equivalent.
  • Separate the entries in a row with spaces, commas or tabs.
  • Type negative numbers with the keyboard hyphen (-).
  • Decimals and scientific notation such as -0.5 or 1e-12 are accepted.
  • Every entry must have an absolute value of at most 1,000,000. Zero is allowed, but any nonzero entry must have magnitude at least 10−1210^{-12}. The field holds at most 1,000 characters.

Fractions such as 1/2, expressions, complex entries, rectangular matrices, sizes other than 2×2 and 3×3, empty input, mismatched row lengths and nonfinite numbers all produce an error. In that case the output fields show an em dash and the plot is cleared. Enter fractions as decimals instead.

The Examples selector loads a preset matrix. If you edit the entries, the selector changes to Custom matrix. Choosing Custom matrix yourself leaves your current entries unchanged.

Example Input What it shows
Symmetric 2×2 2 1; 1 2 Two real eigenvalues, 1 and 3. This is the default and the reset matrix.
Complex pair 0 -1; 1 0 A real matrix whose eigenvalues are −i-i and ii.
Repeated root 2 1; 0 2 The eigenvalue 2 appears twice as a root but has only one independent eigenvector.
Custom matrix your entries Any matrix that meets the input rules above.

Copy copies the input matrix, the results and any uncertainty guidance. Print opens the browser print dialog, where you can also save a PDF. Reset restores the symmetric 2×2 preset and opens Calculation details.

What the results mean

Eigenvalues λ lists the computed roots of the characteristic polynomial, ordered by increasing real part, with the imaginary part breaking ties. A repeated root appears as many times as its computed algebraic multiplicity. For 2 1; 0 2 the list reads 2, 2.

Normalized eigenvectors / eigenspace bases pairs each distinct eigenvalue with one or more unit-length basis vectors for its eigenspace. If no basis could be found, the entry is labeled unresolved.

Calculation details expands into three parts:

  • Algebraic and geometric multiplicities for each distinct eigenvalue.
  • Characteristic polynomial det(λI − A).
  • Calculation steps, which show the polynomial, list the computed roots and describe the nullspace and normalization operations. They do not show every row operation or a symbolic derivation of every root.

The complex-plane plot puts Re⁡(λ)\operatorname{Re}(\lambda) on the horizontal axis and Im⁡(λ)\operatorname{Im}(\lambda) on the vertical axis. Real eigenvalues lie on the horizontal axis. Equal computed roots share one point, and the label carries a repetition count. The axis scale adapts to each matrix, so compare plots by their labels rather than by how far apart the points look. The plot shows eigenvalues only, not eigenvector directions.

Inputs and calculations use double precision. Displayed numbers use up to six significant digits with trailing zeros dropped. That is a display choice, not the limit of the stored value.

The mathematics behind an eigenvalue solver

Eigenvalues, eigenvectors and eigenspaces

For a square matrix AA, a number λ\lambda is an eigenvalue if some nonzero vector vv satisfies

Av=λv.Av = \lambda v.

The vector vv is an eigenvector for λ\lambda. When λ≠0\lambda\ne0, the matrix maps vv to a nonzero scalar multiple on the same real or complex line. When λ=0\lambda=0, it maps vv to zero. Rearranging gives (A−λI)v=0(A-\lambda I)v=0, where II is the identity matrix of the same size as AA. The set of all solutions is the eigenspace

Eλ=ker⁡(A−λI).E_\lambda = \ker(A-\lambda I).

It includes the zero vector, but eigenvectors are the nonzero members. Any nonzero multiple of an eigenvector is also an eigenvector, so an eigenvector is only determined up to scale.

The characteristic polynomial

A nonzero solution exists exactly when A−λIA-\lambda I is singular. So the eigenvalues are the roots of the characteristic polynomial. This calculator uses the monic form

p(λ)=det⁡(λI−A).p(\lambda)=\det(\lambda I-A).

Let t=tr⁡(A)t=\operatorname{tr}(A) be the sum of the diagonal entries and d=det⁡(A)d=\det(A).

For a 2×2 matrix

A=(abce),p(λ)=λ2−tλ+d,A=\begin{pmatrix}a&b\\c&e\end{pmatrix}, \qquad p(\lambda)=\lambda^2-t\lambda+d,

with t=a+et=a+e and d=ae−bcd=ae-bc. The quadratic formula gives

λ=t±Δ2,Δ=t2−4d=(a−e)2+4bc.\lambda=\frac{t\pm\sqrt{\Delta}}{2}, \qquad \Delta=t^2-4d=(a-e)^2+4bc.

If Δ>0\Delta>0 there are two distinct real eigenvalues. If Δ=0\Delta=0 there is one repeated real eigenvalue. If Δ<0\Delta<0 there is a complex conjugate pair.

For a 3×3 matrix

p(λ)=λ3−tλ2+sλ−d,p(\lambda)=\lambda^3-t\lambda^2+s\lambda-d,

where ss is the sum of the three principal 2×2 minors. A principal minor uses the same pair of indices for its rows and columns, so for a 3×3 matrix these come from rows and columns {1,2}\{1,2\}, {1,3}\{1,3\} and {2,3}\{2,3\}.

Two checks follow from this. The eigenvalues, counted with algebraic multiplicity, sum to tt and multiply to dd. For a 3×3 matrix, the sum of the products of the eigenvalues taken in pairs equals ss.

Algebraic and geometric multiplicity

The algebraic multiplicity of an eigenvalue is the number of times it occurs as a root of p(λ)p(\lambda). The geometric multiplicity is the dimension of its eigenspace:

dim⁡Eλ=n−rank⁡(A−λI),\dim E_\lambda = n-\operatorname{rank}(A-\lambda I),

computed over the field that contains the eigenvalue. For a complex eigenvalue, the rank is taken over the complex numbers.

For an exact eigenvalue, the geometric multiplicity is at least 1 and at most the algebraic multiplicity. The two can differ. In 2 1; 0 2 the root 2 occurs twice, but A−2IA-2I has rank 1, so the eigenspace has dimension 2−1=12-1=1. A matrix with a root whose geometric multiplicity is smaller than its algebraic multiplicity is called defective, and it cannot be diagonalized.

Complex eigenvalues of real matrices

A real matrix has a real characteristic polynomial, so any nonreal roots come in complex conjugate pairs. If Av=λvAv=\lambda v, then taking the complex conjugate of both sides gives Avˉ=λˉvˉA\bar v=\bar\lambda\bar v. So the conjugate of an eigenvector for λ\lambda is an eigenvector for λˉ\bar\lambda. A real matrix can therefore have complex eigenvectors, even though all of its entries are real.

A zero eigenvalue is valid. It means AA is singular, because det⁡(A)=0\det(A)=0. For the zero matrix, every vector lies in the eigenspace for λ=0\lambda=0, and the coordinate unit vectors form a basis.

Eigenvalues and eigenvectors with steps

The examples below show how to verify the results by hand. You can load or type each matrix to compare with the numerical output.

Example 1: symmetric 2×2 matrix

Take A=(2112)A=\begin{pmatrix}2&1\\1&2\end{pmatrix}, which is the default input 2 1; 1 2.

  1. The trace is t=4t=4 and the determinant is d=2⋅2−1⋅1=3d=2\cdot2-1\cdot1=3.
  2. The characteristic polynomial is p(λ)=λ2−4λ+3=(λ−1)(λ−3)p(\lambda)=\lambda^2-4\lambda+3=(\lambda-1)(\lambda-3), so the eigenvalues are 11 and 33.
  3. For λ=1\lambda=1, A−I=(1111)A-I=\begin{pmatrix}1&1\\1&1\end{pmatrix}. The equation x+y=0x+y=0 gives the basis vector (1,−1)(1,-1). Its Euclidean norm is 2\sqrt2, so the unit vector is (0.707107,−0.707107)(0.707107,-0.707107).
  4. For λ=3\lambda=3, A−3I=(−111−1)A-3I=\begin{pmatrix}-1&1\\1&-1\end{pmatrix}. The equation −x+y=0-x+y=0 gives (1,1)(1,1), and the unit vector is (0.707107,0.707107)(0.707107,0.707107).

The calculator displays these same vectors for this preset. Because this matrix is symmetric, its eigenvectors for distinct eigenvalues are orthogonal, which you can confirm by checking that (1,−1)⋅(1,1)=0(1,-1)\cdot(1,1)=0.

Example 2: complex pair

Take A=(0−110)A=\begin{pmatrix}0&-1\\1&0\end{pmatrix}, which is the input 0 -1; 1 0. It rotates the plane by 90°, so no nonzero real vector maps to a scalar multiple of itself.

Here t=0t=0 and d=1d=1, so p(λ)=λ2+1p(\lambda)=\lambda^2+1 and the eigenvalues are −i-i and ii. For λ=i\lambda=i, the first row of A−iIA-iI gives −ix−y=0-ix-y=0, so y=−ixy=-ix. A basis vector is (1,−i)(1,-i). The complex norm is ∣1∣2+∣−i∣2=2\sqrt{|1|^2+|-i|^2}=\sqrt2, so the unit vector is 12(1,−i)\tfrac{1}{\sqrt2}(1,-i).

Check it directly: A(1,−i)T=(i,1)TA(1,-i)^T=(i,1)^T, and i⋅(1,−i)T=(i,1)Ti\cdot(1,-i)^T=(i,1)^T. Taking the conjugate gives 12(1,i)\tfrac1{\sqrt2}(1,i) for λ=−i\lambda=-i. Each eigenvalue has algebraic and geometric multiplicity 1. On the plot, the two eigenvalues sit at (0,1)(0,1) and (0,−1)(0,-1).

Example 3: repeated root with a missing eigenvector

Take A=(2102)A=\begin{pmatrix}2&1\\0&2\end{pmatrix}, which is the input 2 1; 0 2. Here p(λ)=(λ−2)2p(\lambda)=(\lambda-2)^2, so 2 has algebraic multiplicity 2.

A−2I=(0100)A-2I=\begin{pmatrix}0&1\\0&0\end{pmatrix} has rank 1, so the nullspace is one-dimensional. Setting the free coordinate x=1x=1 gives the basis vector (1,0)(1,0). The geometric multiplicity is 1, which is less than 2. The eigenvalues list shows 2, 2, but the eigenspace has only one direction.

Example 4: a 3×3 matrix

Take

A=(2−10−12−10−12),A=\begin{pmatrix}2&-1&0\\-1&2&-1\\0&-1&2\end{pmatrix},

which you can enter as 2 -1 0; -1 2 -1; 0 -1 2.

  1. The trace is t=6t=6.
  2. The principal 2×2 minors are 2⋅2−(−1)(−1)=32\cdot2-(-1)(-1)=3 for rows and columns {1,2}\{1,2\}, 2⋅2−0=42\cdot2-0=4 for {1,3}\{1,3\}, and 33 for {2,3}\{2,3\}. So s=3+4+3=10s=3+4+3=10.
  3. Expanding along the first row gives d=2(4−1)−(−1)(−2−0)=6−2=4d=2(4-1)-(-1)(-2-0)=6-2=4.
  4. The characteristic polynomial is p(λ)=λ3−6λ2+10λ−4p(\lambda)=\lambda^3-6\lambda^2+10\lambda-4.
  5. Testing λ=2\lambda=2 gives 8−24+20−4=08-24+20-4=0, so (λ−2)(\lambda-2) is a factor. Dividing gives p(λ)=(λ−2)(λ2−4λ+2)p(\lambda)=(\lambda-2)(\lambda^2-4\lambda+2), and the quadratic factor has roots 2±22\pm\sqrt2.

The eigenvalues are therefore 2−2≈0.5857862-\sqrt2\approx0.585786, 22 and 2+2≈3.4142142+\sqrt2\approx3.414214, listed in increasing order. Check: their sum is 6, their product is 2(4−2)=42(4-2)=4, and their pairwise products sum to 1.171573+2+6.828427=101.171573+2+6.828427=10.

For the eigenvectors, solve (A−λI)v=0(A-\lambda I)v=0 for each root:

  • λ=2−2\lambda=2-\sqrt2: the basis vector (1,2,1)(1,\sqrt2,1) has norm 1+2+1=2\sqrt{1+2+1}=2, so the unit vector is (0.5,0.707107,0.5)(0.5,0.707107,0.5).
  • λ=2\lambda=2: the first row gives y=0y=0 and the second gives x=−zx=-z. The basis vector (1,0,−1)(1,0,-1) has norm 2\sqrt2, so the unit vector is (0.707107,0,−0.707107)(0.707107,0,-0.707107).
  • λ=2+2\lambda=2+\sqrt2: the basis vector (1,−2,1)(1,-\sqrt2,1) also has norm 2, so the unit vector is (0.5,−0.707107,0.5)(0.5,-0.707107,0.5).

For λ=2+2\lambda=2+\sqrt2, row 2 of (A−λI)v(A-\lambda I)v is −1+2−1=0-1+2-1=0 for this vector, as it should be.

Normalized eigenvectors

A normalized eigenvector has Euclidean length 1. For a vector v=(v1,…,vn)v=(v_1,\dots,v_n) the length is

∥v∥2=∑j=1n∣vj∣2,\|v\|_2=\sqrt{\sum_{j=1}^{n}|v_j|^2},

with ∣vj∣|v_j| the complex magnitude when entries are complex. Dividing vv by ∥v∥2\|v\|_2 gives a unit vector in the same direction.

Normalization fixes the length but not the sign or phase. If uu is a unit eigenvector, so is −u-u, and for a complex eigenvector so is eiθue^{i\theta}u for any angle θ\theta. A different program may report the opposite sign or a different phase and still be correct. Compare results by checking Av=λvAv=\lambda v, or by checking that two vectors are scalar multiples of each other.

When an eigenvalue has geometric multiplicity above 1, the calculator builds a nullspace basis by row reduction. It sets each free coordinate to 1 in turn and the others to 0. Each basis vector is normalized on its own. These vectors are not necessarily orthogonal to each other, and any other basis of the same eigenspace is equally valid.

What the calculator does internally

The calculator balances the matrix by power-of-two diagonal similarity and separately rescales it by a single scalar. It uses this balanced, rescaled matrix for the numerical eigenspace calculation, including when it can find the roots directly. If B=D−1ADB=D^{-1}AD and Bw=λwBw=\lambda w, then v=Dwv=Dw maps the eigenvector back to the original coordinates before normalization. The separate scalar rescaling is accounted for when converting eigenvalues between the original and solver coordinates.

The solver chooses the root calculation separately:

  • Integer matrices: when an exact integer discriminant certifies repeated roots, the solver uses that information to compute the roots.
  • Triangular matrices: the solver can read the eigenvalues directly from the diagonal.
  • General 2×2 matrices: a cancellation-resistant quadratic calculation is used.
  • General 3×3 matrices: the math.js QR-based eigensolver supplies candidate roots, which are checked against the characteristic polynomial. If the iteration fails or the polynomial check rejects the candidates, a closed-form cubic calculation takes over.

The solver also checks the residual ∥Av−λv∥2\|Av-\lambda v\|_2 on the scaled problem.

Floating-point results versus exact mathematics

Several statements above are exact identities. The trace equals the sum of the eigenvalues, the determinant equals their product, and the geometric multiplicity never exceeds the algebraic multiplicity. A double-precision calculation can only approximate them. Treat the output as numerical evidence, not as a proof.

Display rounding. Values show up to six significant digits. Two different roots can round to the same label. As a verified boundary case, 1 0; 0 1.00000001 has two distinct eigenvalues, 1 and 1.00000001, yet the display can read 1, 1. That display does not establish a repeated root. For this diagonal matrix the eigenvalues are the diagonal entries, so they are distinct.

Sensitivity. A small residual shows that vv nearly satisfies Av=λvAv=\lambda v. It does not guarantee that λ\lambda is accurate to six digits when the eigenvalue is sensitive to small changes in the input. Consider

(11ε1).\begin{pmatrix}1&1\\ \varepsilon&1\end{pmatrix}.

Its discriminant is 4ε4\varepsilon, so its eigenvalues are 1±ε1\pm\sqrt{\varepsilon}. With ε=10−12\varepsilon=10^{-12} the roots are 1±10−61\pm10^{-6}. A change of 10−1210^{-12} in one entry moves the eigenvalues by 10−610^{-6}. Matrices near a repeated root with a missing eigenvector behave this way.

Rank decisions. Geometric multiplicity depends on a rank, and rank depends on deciding whether a small number is zero. When eigenvalues are very close, that decision becomes unreliable.

The uncertainty warning. The calculator shows a separate Numerical uncertainty warning when it detects close roots, distinct roots with identical display labels, strongly mixed entry scales, or unreliable rank or residual checks. In that case the multiplicity panel displays Uncertain — use higher precision, and any vectors shown should be treated as provisional. If you see this, use higher-precision or exact symbolic arithmetic, such as a computer algebra system working with rational numbers.

Common questions

Does this eigenvalue solver handle complex matrices? No. The input must be a real matrix, but a real matrix can still have complex eigenvalues and eigenvectors, and the calculator reports them.

Why is my 3×3 result listed in a different order than another tool? This calculator orders eigenvalues by increasing real part, then by imaginary part. Other tools may use a different order. The set of eigenvalues is the same.

Why does a repeated eigenvalue have fewer eigenvectors than its count? The algebraic multiplicity counts roots of the polynomial. The geometric multiplicity counts independent eigenvectors. The second can be smaller, as in 2 1; 0 2.

Why can my eigenvector differ from a textbook answer? Eigenvectors are defined only up to a nonzero scalar factor, so signs, phases and basis choices can differ. Check Av=λvAv=\lambda v rather than comparing the numbers directly.

What happens if I enter a fraction such as 1/2? The input is rejected. Enter 0.5 instead.

Can I use this to check homework? Yes. Compute the trace, determinant and (for 3×3) the principal minors by hand, compare them with the characteristic polynomial in Calculation details, then verify each eigenvector by substituting it into Av=λvAv=\lambda v.

Calculation Methodology Documented

Read the formula definitions, supported input ranges, and limitations before using this estimate.

Review Methodology
Debjeet Bhowmick
Author Debjeet Bhowmick AWS Certified Solutions Architect • Cloud & DevOps Consultant

AWS Certified Solutions Architect Professional and Senior Cloud & DevOps Consultant with over 14 years of hands-on expertise architecting resilient cloud infrastructure across AWS, GCP, and Azure. Specializes in infrastructure as code, continuous delivery automation, and telemetry across Terraform, Ansible, Docker, Kubernetes, ELK, Python, and SQL. Creator of OrangeCalc, delivering client-side high-precision computational tools.