Matrix calculator
Linear algebra with exact fractions or decimals — products (stepped row × column), determinant, inverse, rank, RREF step by step, Ax = b, null space, LU, QR, eigenvalues and eigenvectors (with the 2×2 procedure by hand), norms, and condition number.
Added · updated 14 October 2026
How to use it
-
Edit matrices A and B in the grids (arrow keys and Enter move between cells), resize them up to 10 × 10, or paste rows as CSV, whitespace-separated text, JSON (
[[1,2],[3,4]]), or MATLAB syntax ([1 2; 3 4]). -
Exact fractions mode works in rational arithmetic with arbitrary-size integers, so
1/3stays1/3and the inverse of a Hilbert matrix comes out exactly. Decimal mode uses floating point with partial pivoting. -
RREF (steps) shows every row operation with the matrix after it.
-
Solve Ax = b uses B as the right-hand side and reports a unique solution, no solution, or the general solution (a particular solution plus null-space directions).
-
LU gives P·A = L·U with partial pivoting. QR (Householder), Eigen (shifted QR on the Hessenberg form, including complex pairs), and Norms & condition (singular values by Jacobi iteration) are always decimal.
-
Copy any result as plain text, LaTeX, JSON, NumPy, or MATLAB, or send it back to A or B to keep working.
The tabs under the matrices:
-
Calculate — the operations above.
-
Multiply step by step — A·B one cell at a time. Row i of A and column j of B are highlighted, the dot product is written out (
c₁₂ = 1·6 + 2·8 = 6 + 16 = 22), and C fills in as you press Next cell. It first checks that the inner sizes match and counts the m·n·p multiplications. Make B a single column to see a matrix times a vector. -
2×2 eigen steps — the hand procedure for a 2 × 2 A, revealed one step at a time: the characteristic equation λ² − (tr A)λ + det A = 0, the discriminant and the eigenvalues (with the checks λ₁ + λ₂ = trace and λ₁λ₂ = det), then A − λI and its one row equation px + qy = 0 for each λ, solved by v = (q, −p) and scaled to whole numbers, and finally Av = λv checked. It works in exact fractions. A repeated eigenvalue is flagged as defective (one direction, like a shear) or as λI (every vector). Complex eigenvalues are shown with a complex eigenvector and the rotation angle they mean. Irrational eigenvalues are written as surds and the eigenvectors in decimals.
Limits
-
Matrices are at most 10 × 10. The eigen stepper takes only a 2 × 2 A (it offers to cut A down to its top-left 2 × 2).
-
Eigenvectors in the stepper are exact for rational eigenvalues. For irrational ones they are decimals to six significant figures.
To see what the numbers mean, try the visual companions: the Vectors playground, Matrix transformations (a matrix moving the plane, with its determinant, eigenvectors and SVD), and Linear systems, visually (row operations by hand, with the lines and planes redrawn after each step). The chapters on matrices as transformations and eigenvectors in Mathematics, Reconnected cover the ideas.
Two equations in two unknowns, solved by hand with each step explained: algebra step by step.
Related: matrix transformations, vectors playground, linear systems, visually, algebra step by step.
Companion to chapter 27, matrices (multiplying matrices, the inverse) and chapter 28, eigenvalues and eigenvectors (the characteristic equation) of Mathematics, Reconnected.
Sharing
Share link (under the title) copies a URL that reopens this tool exactly as you have it — every tab’s inputs, with the current tab selected. Opening such a link replaces the inputs this browser had saved for the tool.
Linking to an example
Links can be written by hand. Put the tab after #: calc, multiply or eigen.
| Parameter | Meaning | Example |
|---|---|---|
|
matrix A: rows separated by |
|
|
matrix B (a column vector is |
|
|
the calculation shown on Calculate: |
|
|
the scalar for |
|
|
|
|
|
the cell of A·B the multiplication stepper starts on, as row,column |
|
|
how many of the four eigen steps are shown (1–4) |
|
|
a book example (below); other parameters override its settings |
|
In a URL a typed + reads as a space. Matrix entries are numbers, so this does no harm: a space also
separates entries, as in A=1+2;3+4. Write a fraction as 1/2. A minus sign - needs no escaping.
An example link with no #tab opens on that example’s tab.
-
ch27-multiply— [1 2; 3 4]·[5 6; 7 8] = [19 22; 43 50], one cell at a time (#multiply). -
ch27-multiply-ba— the same matrices in the other order: [23 34; 31 46] (#multiply). -
ch27-matvec— [2 −1; 1 1]·(1, 2) = (0, 3) (#multiply). -
ch27-inverse— [3 1; 5 2]⁻¹ = [2 −1; −5 3] (#calc). -
ch27-solve— 3x + y = 5, 5x + 2y = 9 gives x = 1, y = 2 (#calc). -
ch27-cafe— the café: 70 coffees and 50 teas (#calc). -
ch28-power— A³ = [86 39; 78 47] for A = [4 1; 2 3] (#calc). -
ch28-eigen-2x2— the worked example [4 1; 2 3]: λ = 5, 2 with eigenvectors (1, 1), (1, −2) (#eigen). -
ch28-rotation— the 90° rotation: λ = ±i, no real eigenvector (#eigen). -
ch28-shear— the shear: repeated λ = 1, one eigen-direction (defective) (#eigen). -
ch28-scalar— 2I: every vector is an eigenvector (#eigen). -
ch28-symmetric— [2 1; 1 2]: λ = 3, 1 with perpendicular eigenvectors (#eigen). -
ch28-exercise— [1 2; 3 2]: λ = 4, −1 with eigenvectors (2, 3), (1, −1) (#eigen). -
ch28-leslie— the Leslie population matrix [0 3; 1/2 1/2]: λ = 3/2, −1, long-run ratio (2, 1) (#eigen).
For example ?example=ch28-eigen-2x2#eigen or
?A=1.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.