About the Matrix Calculator tool
Matrices appear in linear algebra courses, computer graphics, economics models, statistics and engineering, and the core operations — multiplying, finding a determinant, inverting, reducing to echelon form — involve a lot of arithmetic where one slip ruins the answer. Many online matrix tools use floating-point numbers, so an inverse that should contain 1/3 comes back as 0.3333333 and exact answers are lost.
This matrix calculator works with exact fractions. Enter matrices A and B of any size from 1×1 to 5×5 — entries can be integers, decimals or fractions like 3/4 — and choose A + B, A − B, A × B, B × A, a scalar multiple, the determinant, the inverse, the transpose, the rank or the reduced row echelon form. Size mismatches are explained, for example when the columns of A do not match the rows of B.
Determinants are found by Gaussian elimination, inverses by Gauss–Jordan elimination on [A | I], and rank and RREF by full row reduction, and the steps panel lists every row operation used, such as “R2 ← R2 − 3/2·R1”. Results can be shown as fractions or decimals and copied as tab-separated text for a spreadsheet.
How to use Matrix Calculator
- Set the number of rows and columns for matrix A and type its entries (empty cells count as 0).
- Choose an “Operation” — for two-matrix operations, matrix B appears; set its size and entries too.
- Use “Swap A ↔ B”, “Random” or “Clear” to change the inputs quickly.
- Read the result matrix or value, and switch between “Fractions” and “Decimals”.
- Open “Show row operations” to follow the elimination steps.
Features
Exact fraction arithmetic
All calculations use big-integer fractions, so there is no rounding error.
Ten operations
Add, subtract, A×B, B×A, scalar multiple, determinant, inverse, transpose, rank and RREF.
Row-operation steps
Swaps, scalings and eliminations are listed in order for determinant, inverse, rank and RREF.
Up to 5×5, any shape
Rectangular matrices are supported wherever the operation allows them.
Spreadsheet-friendly copy
Copy the result as tab-separated values that paste straight into Excel or Sheets.
When to use it
- Check a 3×3 determinant or inverse from a linear algebra assignment.
- Multiply transformation matrices for a graphics or robotics problem.
- Find the rank of a matrix to decide whether its columns are independent.
- Row-reduce an augmented matrix to solve a system of equations.
- Verify that A × A⁻¹ gives the identity matrix.
Frequently asked questions
When does a matrix have an inverse?
A square matrix is invertible exactly when its determinant is not zero. If det(A) = 0 the matrix is singular and the calculator explains that no inverse exists.
Why can't I multiply these two matrices?
A × B is only defined when the number of columns of A equals the number of rows of B. A 2×3 matrix can multiply a 3×4 matrix, giving a 2×4 result.
Is A × B the same as B × A?
Usually not — matrix multiplication is not commutative. Use the “A × B” and “B × A” options to compare.
How is the determinant calculated?
The matrix is reduced to upper-triangular form with row operations; the determinant is the product of the diagonal, with the sign flipped once for every row swap.
What is the rank of a matrix?
The rank is the number of non-zero rows in its row echelon form — the number of linearly independent rows or columns.