Processed online by Toolvito
Matrix Calculator
Type a matrix one row per line and choose what to work out: the determinant, the inverse, the reduced row echelon form, eigenvalues and much more. Fractions stay exact, the row operations are written out, and every answer is checked.
How to use the matrix calculator
- Type matrix A with one row per line and spaces or commas between the entries, for example 1 2 3 0 1 4 5 6 0. Entries may be fractions (1/2), decimals (0.25), roots (sqrt(2)) or letters (a, b).
- Choose what to do. For a product, sum or difference, and to solve A·x = b, also type matrix B (or the column b). For a power or a number times A, type the number.
- Select Calculate. Read the answer, the row operations and the checks; download the worked solution as a text file.
What it works out
- Determinant: the formula a·d − b·c for 2 × 2, cofactor expansion along the first row for 3 × 3, row reduction for larger matrices (each swap changes the sign).
- Inverse: Gauss–Jordan elimination on [A | I] (or the adjugate divided by the determinant); a matrix with determinant 0 has no inverse and the page says so.
- Row echelon form, reduced row echelon form (RREF) and rank, with every row operation: swap two rows, multiply a row by a number other than 0, add a multiple of one row to another.
- A·x = b: one solution, none (inconsistent) or infinitely many with free variables, from the augmented matrix. Least squares solves AᵀA·x = Aᵀb when there is no exact solution.
- Eigenvalues and eigenvectors from det(A − λI) = 0 (up to 8 × 8), the characteristic polynomial and diagonalisation A = P·D·P⁻¹.
- Decompositions: LU (with row swaps when needed), QR (Gram–Schmidt), Cholesky (symmetric positive definite) and the singular value decomposition (matrices of numbers).
- Also: transpose, trace, sum, difference, product, power, number times a matrix, the matrix exponential, null space, column space, adjugate and the cofactor matrix.
How the answers are checked
- An inverse is multiplied back (A·A⁻¹ = I), eigenvectors are tested with A·v = λ·v, decompositions are multiplied back (L·U, Q·R, L·Lᵀ, U·Σ·Vᵀ), a solution of A·x = b is put back in.
- A determinant is worked out a second way (Berkowitz algorithm), and for matrices of numbers NumPy repeats the calculation in floating point.
- Sizes up to 10 × 10 (8 × 8 for eigenvalues, 6 × 6 for the exponential). A job stops after about a minute rather than giving a guess.