Eigenvalue calculator

Type a square matrix, one row per line, and get its eigenvalues and eigenvectors. Complex eigenvalues are shown as a + bi.

One row per line, numbers separated by spaces. Fractions such as 1/2 are allowed.

Fill in the fields; the answer appears here straight away.

How it works

  1. Enter the values

    Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.

  2. Instant answer

    The answer appears as you type, with the most important intermediate values.

  3. See the working

    Under "How it's worked out" you see the steps, handy for checking your own calculation.

What are eigenvalues?

An eigenvector v of a matrix A is a vector that A only stretches or shrinks, without changing its direction: Av = λv. The factor λ is the eigenvalue. The eigenvalues are the solutions of det(A − λI) = 0.

Checks

The sum of the eigenvalues equals the trace (the sum of the diagonal), and their product equals the determinant. The eigenvectors are scaled so that the smallest component is 1; any multiple of an eigenvector is also an eigenvector.

Where they are used

In vibrations and stability analysis, in Google's original PageRank, in principal component analysis (PCA) and in quantum mechanics. The calculation is numerical, done by math.js in your browser, for matrices up to 8×8.

Worked examples

  • Default: [[2, 1], [1, 2]] has eigenvalues 1 and 3, with eigenvectors (−1, 1) and (1, 1). The trace is 2 + 2 = 4 = 1 + 3.
  • Triangular: [[2, 1], [0, 3]] has its eigenvalues on the diagonal: 2 and 3.
  • Rotation: [[0, −1], [1, 0]] has the complex eigenvalues i and −i.

Quick checks

The eigenvalues must add up to the trace, shown in the result, and multiply to the determinant. For [[2, 1], [1, 2]]: 1 × 3 = 3 = 2 × 2 − 1 × 1. The determinant is available in the determinant calculator, and the characteristic equation for a 2×2 matrix is a quadratic, solvable with the quadratic equation solver.

A Markov chain

For the matrix [[0.9, 0.5], [0.1, 0.5]], whose columns each add up to 1, the eigenvalues are 1 and 0.4. The eigenvector for eigenvalue 1 is proportional to (5, 1), so in the long run the system settles at 5/6 in the first state and 1/6 in the second. This stationary distribution is the idea behind PageRank.

Frequently asked questions

What is an eigenvector in plain words?

A direction that the matrix only stretches or shrinks, without turning it. The factor is the eigenvalue. For [[2, 1], [1, 2]], the vector (1, 1) is stretched by 3 and (−1, 1) by 1.

Why are some eigenvalues complex?

A matrix that rotates every direction has no real eigenvector. [[0, −1], [1, 0]] turns everything by 90° and has eigenvalues i and −i, which the calculator shows as complex numbers.

Why is the eigenvector scaled so strangely?

Any multiple of an eigenvector is also an eigenvector, so there is no single correct length. The calculator scales it so the smallest non-zero component has size 1.

How accurate are the results?

They are numerical, calculated by math.js in your browser, and rounded for display. For small integer matrices the values come out clean, as in the examples.