2×2 eigenvalue calculator
Enter the four entries of a 2×2 matrix and get its eigenvalues and eigenvectors: the matrix with rows (4, 1) and (2, 3) has trace 7, determinant 10 and eigenvalues 5 and 2. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
A 2×2 eigenvalue calculator answers the classic linear-algebra question for the smallest nontrivial square matrices: given a real matrix A with four finite entries, which scalars λ and which nonzero vectors v satisfy Av = λv? This tool builds the monic characteristic polynomial det(A − λI) = λ² − tr(A)λ + det(A), solves the quadratic with the discriminant Δ = tr² − 4 det, and returns either two distinct real eigenvalues, one repeated real eigenvalue, or a complex conjugate pair, together with matching eigenvectors (unit real vectors or complex vectors as real and imaginary parts).
What the characteristic equation computes for a 2×2 matrix
Expanding the two-by-two determinant gives the monic quadratic λ² − (a+d)λ + (ad − bc), so the coefficients are completely determined by the trace tr(A) = a + d and the determinant det(A) = ad − bc. The discriminant of that quadratic is Δ = tr(A)² − 4 det(A), which expands equivalently to (a − d)² + 4bc.
When Δ is positive there are two distinct real eigenvalues λ± = (tr ± √Δ) / 2; when Δ is zero there is a repeated real eigenvalue λ = tr/2 of algebraic multiplicity two; when Δ is negative the roots are the complex conjugate pair α ± iβ with α = tr/2 and β = √|Δ|/2.
Each real eigenvalue λ comes with at least one real eigenvector from the nullspace of A − λI: a convenient generator is the nonzero row of that matrix turned into a 2-vector, which this tool orients so the first nonzero component is non-negative and then normalizes to unit Euclidean length. For a repeated eigenvalue the geometric multiplicity may be one (a single line of eigenvectors, the defective case) or two (every nonzero vector works when A is a scalar multiple of the identity).
Teachers, graders, and coding kata authors care as much about the non-numeric rejection as about the roots: a cell containing text is not a matrix entry, and inventing zero or NaN would hide the mistake.
Practical tips, limits, and related searches
Keep every entry inside the published absolute range and prefer nested number arrays when you control the client; text form is convenient for paste-from-spreadsheet workflows but still parses under the same numeric rules. Near-zero discriminants are treated as exact zero under a fixed epsilon so floating noise does not flip a repeated root into a tiny complex pair. Prefer this capability when you already have four numeric entries and only need the closed-form spectrum; if your source is a word problem, assemble the coefficient matrix first.
Round-trip checks are easy: verify that each reported real pair satisfies Av ≈ λv within rounding, that the product of eigenvalues equals det and the sum equals trace, and that complex pairs appear as conjugates. Use matrix-rank tools when you need pivot rank rather than spectrum, and keep n×n numerical libraries for larger dense problems outside this educational two-by-two scope.
What you can do with it
Homework checks for 2×2 eigenproblems
Students paste textbook two-by-two matrices and compare hand-written characteristic roots and eigenvectors against a deterministic result before submitting.
Quick spectrum pre-checks in small models
Control and data pipelines assert the spectrum of a 2×2 block (stability, positive eigenvalues) without pulling in a full numerical linear-algebra stack.
FAQ
How are 2×2 eigenvalues computed here?
The tool forms the monic characteristic polynomial λ² − tr(A)λ + det(A), evaluates the discriminant Δ = tr² − 4 det, and solves the quadratic. Eigenvectors come from the nullspace of A − λI (or complex conjugate construction when Δ < 0).
What happens if an entry is not a number?
The tool never invents NaN eigenvalues or silently coerces text to zero.
Does this work for matrices larger than 2×2?
No. This capability accepts only exactly two-by-two real matrices so the closed-form characteristic quadratic applies. Use a general numerical eigensolver for n×n problems.
What if the discriminant is negative?
You get a complex conjugate eigenvalue pair α ± iβ with eigenvectors reported as real and imaginary parts. That is the correct spectrum over the complex numbers for a real matrix with no real eigenvalues.
Is the 2×2 eigenvalue calculator free?
The browser tool is free and runs locally.
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/algebra/eigenvalues-2x2 \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"matrix":[[4,1],[2,3]]}'const res = await fetch("https://api.kit.forhosting.com/algebra/eigenvalues-2x2", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"matrix": [
[
4,
1
],
[
2,
3
]
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/eigenvalues-2x2",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"matrix": [
[
4,
1
],
[
2,
3
]
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/eigenvalues-2x2", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"matrix":[[4,1],[2,3]]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"matrix":[[4,1],[2,3]]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/eigenvalues-2x2", 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": [
[
4,
1
],
[
2,
3
]
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.eigenvalues_2x2",
"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_abs | 1000000000000 |
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
Enter the matrix as nested numeric rows or as plain text with commas and line breaks; non-numeric cells and anything that is not exactly two-by-two are rejected with invalid_input so homework and pipelines never see silent NaNs.
What the characteristic equation computes for a 2×2 matrix
For a real matrix A = [[a, b], [c, d]], the eigenvalues are the roots of the characteristic polynomial p(λ) = det(A − λI). Complex eigenvalues arrive with complex eigenvectors reported as separate real and imaginary coordinate vectors so JSON stays plain numbers.
How to call the API and what comes back
Accept either an array of exactly two rows of two finite numbers each—for example [[4, 1], [2, 3]]—or a text block with two rows separated by newlines or semicolons and entries separated by commas or spaces. Send a JSON body with one required field matrix (aliases rows, A, and data). Every entry must be a finite number whose absolute value stays within the published limit of one trillion; dimensions other than two-by-two, empty rows, missing matrix, and non-numeric cells all return invalid_input and are never charged. On success the response sets matrix to the rounded original, trace and det to the rounded invariants, characteristic to the monic coefficient triple [1, −tr, det] plus a formula string and the discriminant, kind to one of two_real, repeated_real, or complex_conjugate, eigenvalues to an ordered list of values with real flags and multiplicities, eigenvectors to matching vector (and unit normalized) data, message to a short English summary, and steps to an ordered array of derivation notes you can show in worksheets or assert in tests. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price. Failed validation never consumes prepaid balance, which keeps exploratory scripts cheap when learners deliberately send text cells or three-by-three paste errors.
Practical tips, limits, and related searches
When teaching, pair examples: [[4, 1], [2, 3]] has distinct real eigenvalues five and two with clear eigenvectors; the identity has a double eigenvalue one with geometric multiplicity two; a rotation-scale block such as [[0, −1], [1, 0]] produces pure imaginary eigenvalues ±i; and a matrix with a string cell demonstrates the hard invalid_input path for non-numeric entries. This landing targets people searching for a 2×2 eigenvalue calculator, characteristic equation solver, or two-by-two eigenvectors online; it is not a general n×n eigensolver, not a singular-value decomposition tool, and not a computer-algebra system for symbolic entries.
Integration use cases
Unit tests for student linear-algebra code
Generate known-good two-real, repeated, and complex-pair cases plus deliberate non-numeric rejections for coding kata expected values.