Matrix Calculator
What do you get when you multiply, add, or invert these matrices?
Enter two matrices and choose an operation to get the exact result. Supports addition, subtraction, multiplication, determinant, inverse, and transpose for up to 3x3 matrices.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
Think of a matrix as a machine that reshapes space. When you multiply a matrix by a vector, you are not just scaling numbers — you are rotating, stretching, and reflecting every point in a geometric space simultaneously. That is why a 2x2 matrix multiplication shows up equally in a graphics renderer rotating a sprite and in an economics model projecting output from inputs.
The determinant is a single number that captures how much a matrix scales area (in 2D) or volume (in 3D). A determinant of 2 means the transformation doubles area. A determinant of -1 means it preserves area but flips orientation. A determinant of 0 means the transformation is irreversible — it collapses the space to a lower dimension and destroys information.
The inverse of a matrix is its undo operation. If A transforms vector x into y, then A-inverse transforms y back into x. This is the mathematical backbone of solving linear systems, computing least-squares fits, and decoding encrypted signals. The inverse only exists when the determinant is nonzero — a non-invertible matrix is one where information was lost and cannot be recovered.
When To Use This
Right tool, right situation
Use this calculator when you need to check matrix arithmetic by hand — during coursework, when debugging a linear algebra routine, or when setting up a small model and wanting to verify that the math works before coding it. It is well-suited for 2x2 and 3x3 problems that arise in 2D/3D geometry, basic circuit analysis, simple economic models, and stats problems involving covariance matrices.
This tool is not appropriate for larger matrices (4x4 and above), sparse matrices, or numerical methods that require iterative solvers. It is also not the right tool when you need symbolic algebra — all inputs are treated as floating-point numbers, so exact fractions like 1/3 will be approximated. For production code, use a library like NumPy or MATLAB.
The tool is particularly useful for a sanity check after computing by hand. Enter your answer as Matrix A and the original as Matrix B, then multiply — if the result is close to the identity matrix, your inverse is correct. You can also verify eigenvector relationships by checking whether Av equals lambda times v for small, concrete examples.
Common Mistakes
Why results sometimes look wrong
Confusing addition rules with multiplication rules. Addition is element-by-element and requires identical matrix sizes. Multiplication is a dot-product operation and requires the inner dimensions to match (columns of A equal rows of B). Many errors come from applying the wrong size rule to the wrong operation. The cause is usually pattern-matching to scalar arithmetic, where the same size rule applies to both. The consequence is either a dimension error or a numerically wrong result that looks plausible.
Assuming the result is square when it may not be. Multiplying a 2x3 matrix by a 3x2 matrix gives a 2x2 result, but multiplying a 3x2 by a 2x3 gives a 3x3. The output shape is always rows-of-A by columns-of-B, not the shape of the inputs. Missing this causes index errors in downstream code that assumed a fixed output size.
Computing the inverse without checking the determinant first. Inverting numerically without confirming a nonzero determinant can return a matrix full of very large floating-point numbers that are not mathematically meaningful. Always treat a determinant below about 1e-10 as effectively zero in floating-point arithmetic — near-singular matrices amplify errors dramatically in any subsequent calculation.
The Math
Worked examples and deeper derivation
For a 2x2 matrix with entries a, b, c, d arranged as rows [a b] and [c d], the determinant is ad minus bc. The inverse is (1 over the determinant) times the matrix [d, -b; -c, a]. This formula shows directly why det = 0 kills the inverse: you would be dividing by zero.
Matrix multiplication for two 2x2 matrices A and B gives a result where each entry (i, j) is the dot product of row i of A with column j of B. This is why the number of columns in A must equal the number of rows in B — the dot product only works when the two vectors being combined are the same length.
For a 3x3 matrix, the determinant expands along the first row using cofactor expansion: a11 times the 2x2 minor formed by removing row 1 and column 1, minus a12 times its minor, plus a13 times its minor. The 3x3 inverse uses the same cofactor matrix, transposed and divided by the determinant — a process called the adjugate method.
Expert Unlock
The thing most explanations skip
The cofactor method used here for the 3x3 inverse is numerically stable for small exact integers but degrades for matrices with entries spanning several orders of magnitude. The condition number — roughly the ratio of the largest to smallest singular value — determines how much input error gets amplified. A matrix with a determinant close to zero but not zero can still be extremely ill-conditioned and give misleading inverses. For real engineering applications, LU decomposition with partial pivoting is preferred over the adjugate method because it bounds error propagation more tightly.
What do these matrix results actually mean for my problem?
Need something this doesn't cover?
Suggest a tool — we'll build it →