Eigenvalue and eigenvector calculator
The matrix with rows (2, 1) and (1, 2) has eigenvalues 3 and 1, each paired with its unit eigenvector. Enter any square matrix up to 50×50 and get all its real eigenpairs, largest first, without expanding a polynomial by hand. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
The eigenvalue and eigenvector calculator takes a square matrix — up to 50×50, entered row by row — and returns its complete set of real eigenpairs: every eigenvalue together with its corresponding eigenvector, normalized to unit length and ordered from the largest eigenvalue to the smallest. Eigenpairs are the fingerprint of a linear transformation: they tell you which directions it leaves unchanged and by how much it stretches each one, and they underpin everything from vibration analysis and stability checks to PageRank, Markov chains and principal component analysis. Instead of expanding the characteristic polynomial by hand or wiring up a numerical library, you send the entries and get the eigenpairs back in one deterministic call, rounded to the precision you choose. The same module runs free in your browser on this page, so you only pay when you automate the workflow.
What an eigenpair tells you
An eigenvector of a square matrix A is a non-zero vector that A merely scales: A·v = λ·v for some scalar λ, the eigenvalue. Geometrically, an eigenvector points along an axis that the transformation does not rotate or shear — it only stretches or compresses along that axis, by the factor λ. A pair (λ, v) is called an eigenpair, and the eigenvalue and eigenvector calculator returns exactly that: one record per eigenvalue containing the eigenvalue itself and its matching unit eigenvector, so the correspondence can never be misread.
Pairs are sorted from the largest eigenvalue to the smallest, which puts the dominant direction of the system first — the one that governs long-term behavior in iterative processes. Negative eigenvalues encode a flip of direction, a zero eigenvalue reveals a non-trivial null space and a non-invertible matrix, and repeated eigenvalues flag symmetries in the problem.
How the computation works
The algorithm is fully deterministic — no random starting vectors, no iteration counts that vary from run to run — so the same matrix always returns the same eigenpairs, byte for byte. Symmetric matrices, which appear constantly in covariance analysis, structural mechanics and optimization, are processed with cyclic Jacobi sweeps: a fixed sequence of plane rotations that zeroes the off-diagonal entries while accumulating the rotations into the eigenvector matrix.
Jacobi is not the fastest method in theory, but it is remarkably accurate at the small and medium sizes this tool accepts and it handles repeated eigenvalues gracefully, where simpler power methods fail. General non-symmetric matrices are handled with a Wilkinson-shifted QR iteration to extract the eigenvalues, followed by inverse iteration against the original matrix to recover one eigenvector per eigenvalue. Every eigenvalue and every eigenvector entry is rounded to the decimal precision you request, from 0 to 15 places, with ten as the default.
Where eigenpairs are used
Eigenpairs appear wherever a linear system evolves or vibrates. In engineering, the natural frequencies of a structure are the square roots of the eigenvalues of its stiffness-mass system, and the eigenvectors are the mode shapes — how the structure moves at each frequency. Web search owes its existence to an eigenpair: PageRank is the dominant eigenvector of the web's link matrix.
Markov chain analysis works the same way — the dominant eigenvalue tells you whether the chain converges and its eigenvector is the steady state.
What you can do with it
Find principal components
Send a covariance matrix and read the eigenpairs directly: eigenvectors are the principal directions, eigenvalues the explained variance.
Analyze vibrations and stability
Extract the natural frequencies and mode shapes of a mechanical system from its stiffness matrix, or check whether a linear system is stable from the sign of its eigenvalues.
Check homework and research
Verify a hand-worked eigendecomposition against a deterministic reference before submitting it, with precision you control.
FAQ
What matrices are accepted?
Any square matrix of real, finite numbers up to 50×50.
What if my matrix has complex eigenvalues?
Matrices with complex eigenvalues, and defective matrices without a full set of independent real eigenvectors, are rejected with a clear error rather than an approximate answer.
How are the eigenpairs ordered?
From the largest eigenvalue to the smallest. Each eigenpair carries its own eigenvector, normalized to unit length, so the pairing is unambiguous.
How do I verify an answer?
Multiply the matrix by each returned eigenvector: the result should equal the eigenvalue times that eigenvector (A·v = λ·v), up to the rounding precision you chose.
What happens with a matrix that cannot be diagonalized?
If the matrix lacks a full set of independent eigenvectors, as with rows (1, 1) and (0, 1), you get a clear message instead of a plausible-looking wrong answer. Complex eigenvalues are reported the same way.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/eigenvalue-eigenvector \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"matrix":[[2,1],[1,2]]}'const res = await fetch("https://api.kit.forhosting.com/math/eigenvalue-eigenvector", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"matrix": [
[
2,
1
],
[
1,
2
]
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/eigenvalue-eigenvector",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"matrix": [
[
2,
1
],
[
1,
2
]
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/eigenvalue-eigenvector", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"matrix":[[2,1],[1,2]]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"matrix":[[2,1],[1,2]]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/eigenvalue-eigenvector", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"matrix": [
[
2,
1
],
[
1,
2
]
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.eigenvalue_eigenvector",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 50 |
max_abs_entry | 1000000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What an eigenpair tells you
If the matrix is not square the request is rejected outright, because eigenpairs are only defined for square matrices, and if the matrix has complex eigenvalues the tool says so instead of fabricating real numbers.
How the computation works
Before returning, the tool verifies that the recovered eigenvectors are linearly independent; if they are not — as with the classic defective matrix [[1,1],[0,1]] — the request fails with a clear error rather than a plausible-looking wrong answer.
Where eigenpairs are used
In data science, principal component analysis is nothing more than the eigendecomposition of a covariance matrix: the eigenvectors are the principal directions and the eigenvalues measure how much variance each one captures. Because the capability runs on our global edge with nothing stored after the response, it also fits cleanly into automated pipelines: a script can submit matrices as part of a nightly job for $0.002 per call, while a human checks the same matrices free in the browser with byte-identical results. That parity between the free web tool and the paid API is deliberate — the same module powers both channels.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page, with identical results.