Matrix Calculator
Matrices
Tap a letter to insert it — a new one opens its editor.
Free and no sign-in. Results are shown to six decimal places, except an answer that is itself below a millionth — an entry of an inverse, a determinant of a matrix scaled by 1e-13 — which is shown in exponential form rather than as 0. An operation that is not defined — a singular matrix, mismatched shapes, a dependent system — is reported with the reason, never given an answer. Your matrices stay in this browser, and a photo you import is read here too — the recognition engine is downloaded on first use, and the image is never uploaded.
The full expression calculator, not a form per operation: give A, B, C and any other letters values, then write det(A), inv(A)*B, solve(A, B), lu(A) or eig(A) as one expression. Every result carries its working: the row operations for elimination, the cofactor expansion where it is short enough to read, and the name of the method otherwise.
How it works
Letters A to Z are matrices. Tap a letter to insert it; the first time, its editor opens so it has values and a size. The expression is then read left to right with the usual precedence — brackets, then multiplication and division, then addition and subtraction — and multiplication written without a sign, as in 2A or (A+B)(A−B), is still multiplication. A pasted expression keeps its own signs — ×, ÷ and the true minus sign all read as the operators they are — and anything the calculator cannot read is reported rather than quietly dropped.
The functions take matrices, and can be nested: det(inv(A)) is 1 ÷ det(A). Each argument may be any expression that produces a matrix, so rank(A*B) works as written.
- det(A) · adj(A) · inv(A) · transpose(A)
- trace(A) · rank(A) · rref(A)
- solve(A, B) · lu(A) · qr(A) · eig(A) · eigvec(A)
det expands along a row and shows the arithmetic for a 2×2 and a 3×3; from 4×4 the expansion runs to n determinants one size down, so only the result is shown, with a note saying why. inv is Gauss-Jordan elimination on [A | I], written as A⁻¹ = adj(A) ÷ det(A) for 2×2 and 3×3, and listing the row operations for anything larger. rank and rref list every row operation used, which is how the number is checked by hand.
solve(A, B) reduces the augmented matrix [A | B]; a dependent system is reported as having free variables, not given a made-up X. lu is Doolittle's method (A = L·U) and stops at a zero pivot rather than dividing by zero. qr is Gram–Schmidt, giving orthonormal Q and upper-triangular R when the columns are independent (a wide matrix has too many columns for that). eig lists every eigenvalue, complex ones written a ± bi: exactly for a symmetric matrix, by Jacobi rotations, and otherwise from the real Schur form, which shifted QR reaches. eigvec answers with the dominant eigenvalue and its eigenvector instead.
Worked example
With A = [[4, 7], [2, 6]], the expression det(A) expands as 4×6 − 7×2 = 10.
inv(A) is adj(A) ÷ det(A). For a 2×2, adj(A) swaps the diagonal and negates the other two entries, giving [[6, −7], [−2, 4]]; dividing by 10 gives [[0.6, −0.7], [−0.2, 0.4]].
Check it the way the calculator does: A × A⁻¹ = [[1, 0], [0, 1]], so rref(A*inv(A)) is the identity. Singular matrices fail this test — B = [[1, 2], [2, 4]] has det(B) = 0, and the calculator says so instead of returning an inverse with enormous entries.
For a factorization, lu(A) splits A into L = [[1, 0], [0.5, 1]] and U = [[4, 7], [0, 2.5]]; multiply them back together to recover A. eig(A) gives both eigenvalues at once: 8.873 and 1.127, the roots of λ² − 10λ + 10.
Which operation answers which question
Most matrix questions are one of four, and the operation that answers it is usually not the one the question names. Finding the right call first saves the arithmetic:
| The question | The call | What a zero or a small number means |
|---|---|---|
| Does this system have one solution? | rref(A) | A pivot in every column, and the last column is consistent — otherwise none, or infinitely many |
| Can this matrix be undone? | det(A) | Zero means no inverse exists, whatever the size |
| How much independent information is in it? | rank(A) | Rank below the row count means rows are combinations of each other |
| Where does this space stretch or collapse? | eig(A) | A zero eigenvalue is a collapsed direction; a negative one is a flip |
The two 2×2 halves of that table are the ones most often confused. det(A) is a single number and says nothing about how — only whether. rref(A) is the elimination itself, so it shows which rows were dependent: for A = [[1, 2, 3], [2, 4, 6]] the reduction gives [[1, 2, 3], [0, 0, 0]], rank 1, and the second row is visibly twice the first.
Singular is a spectrum, not a switch. A determinant of exactly zero is rare outside a textbook; real matrices sit near it. The 2×2 [[1, 2], [2, 4.000001]] has a determinant of 0.000001 — technically invertible, and an inverse whose entries are around a million. If the inputs carry any rounding at all, that answer is noise. The calculator shows the small determinant honestly rather than clamping it to zero, so the warning is in the number itself.
For anything numerical rather than exact, the factorisations are the better tool: lu(A) reuses the elimination work across several right-hand sides, and qr(A) is the stable way to solve a least-squares problem when the columns are independent. Reaching for inv(A)*B works in an exam and costs precision in a program.
Questions people ask
- How do I enter a matrix?
- Tap a letter A–Z, then fill its grid — or switch the editor to text and paste rows separated by newlines, such as "4 7" then "2 6". A matrix printed in a book can come from a photo: press Photo, choose or take the picture, and the editor reads it into the grid. Read means a first draft, not a transcription — check every entry, especially minus signs and 5s, before saving; if the photo cannot be shaped into rows the text it produced is left in the text view for you to fix. An entry can be an expression such as 1/2 or 3(4-1), evaluated when you save the matrix. You can come back and tap the letter inside the expression to edit it again.
- Why can't I invert this matrix?
- Its determinant is zero, or close enough to zero that an inverse would be numerically meaningless. Such a matrix collapses at least one dimension, so no matrix can undo it. The same condition is why solving A·X = B may have no unique solution.
- What is the difference between rank and rref?
- rref is the matrix itself after elimination: each pivot is 1 and is the only non-zero entry in its column. Rank is the number that falls out of it — how many independent rows the matrix really has. A 3×3 matrix can have rank 2, meaning one row is a combination of the others.
- Can the matrices be rectangular?
- Yes. Each matrix has its own row and column count, and the expression checks each operation's rule: addition needs equal shapes, multiplication needs the left column count to equal the right row count, and determinant, inverse, trace, eigenvalues and lu need a square matrix. Transpose, rank and rref accept any shape; qr accepts any shape whose columns are independent.
- How reliable is eig(A)?
- For a symmetric matrix it is exact: Jacobi rotations zero the off-diagonal entries one pair at a time, and the diagonal is then the whole spectrum, so two eigenvalues of equal size are reported as they are. For a general matrix the values come from the real Schur form — orthogonal rotations put the matrix in Hessenberg form, shifted QR steps split it into blocks, and each 1×1 or 2×2 block gives one eigenvalue or one conjugate pair — so the answer is an estimate, marked ≈, accurate to about the last digit or two rather than a claim of exactness. Complex eigenvalues are written a ± bi; a matrix with no real eigenvalue at all, like the quarter-turn [[0, −1], [1, 0]], is answered with ±i rather than refused. eigvec(A) is the companion call: it gives the dominant eigenvalue alone with its eigenvector, by power iteration, when the vector is what you are after.
- Are my matrices saved?
- Yes — in this browser, and only in this browser. The worksheet switcher above the expression saves each problem under its own name: give a matrix its values once, keep several worksheets for several problems, and move between them without one overwriting the other. Nothing is uploaded and there is no account, so clearing this browser's site data clears the worksheets with it.
- Why is the result rounded?
- Floating-point arithmetic cannot represent every fraction exactly, so results are usually shown to six decimal places. A value below that which is a real answer rather than residue — an inverse entry of 8.1e-18 for a matrix whose entries are around 1e17, a determinant of 1e-13, a product of two matrices scaled by 1e-13, the trace, or an eigenvalue — is shown in exponential form instead, because 0 would deny an answer the calculator just computed with. Where the calculation's own rounding leaves a residue in a cell that is mathematically zero — a reduced matrix, a product, an adjugate, or the solution of a system — that cell is shown as zero.
Written and checked by Joseph Kudomo-Abasi. Last checked 31 October 2026.
Sources