Free Online Matrix Calculator
Add, subtract, multiply, transpose, and find determinants.
Matrix A
Matrix B
Enter numbers in every cell. Add and subtract work element by element, multiplication follows the row-by-column rule, and determinants and inverses require a square matrix, which every size here satisfies.
Result
Step-by-step working
- Enter both matrices to see the working.
About the Matrix Calculator
A matrix is a rectangular grid of numbers, and matrix arithmetic is the language behind graphics transforms, systems of equations, statistics, economics and engineering models. This calculator builds 2×2, 3×3 or 4×4 matrices and performs addition, subtraction, multiplication, transposition, determinants and inverses. Every result comes with the intermediate arithmetic, so it works as a learning aid as well as a quick checker.
Addition, subtraction and transposition
Addition and subtraction operate on matching positions. If A has 4 in the top-left and B has 7, then A + B has 11 in the top-left. Both matrices must have the same dimensions, which they do here because the calculator uses one size for both. A transpose flips a matrix across its main diagonal: the element in row 1, column 2 moves to row 2, column 1. Transposition is useful for converting between row vectors and column vectors and for testing whether a matrix is symmetric.
Matrix multiplication
Multiplication is not element by element. Each entry in the result is the dot product of a row from A and a column from B. For a 2×2 product, the top-left entry is a₁₁b₁₁ + a₁₂b₂₁, the top-right uses the second column of B, and so on. This is why the number of columns in A must equal the number of rows in B. The calculator shows each row-by-column sum with the actual numbers, making the pattern easy to follow.
Determinants and inverses
The determinant is a single number that summarizes how a matrix scales area or volume, and whether it is invertible. A determinant of zero means the matrix is singular: it squashes space into a lower dimension and has no inverse. The calculator computes determinants by pivoted row reduction and reports the multiplications and row swaps. The inverse is found with Gauss-Jordan elimination on an augmented identity matrix. If a pivot disappears, the tool reports that the matrix is singular instead of returning misleading numbers.
Reading the step output
Steps are written in plain arithmetic rather than matrix notation alone. For addition and multiplication, each result cell gets its own line. For determinants, the pivot selection, row swap and elimination multipliers are listed. For inverses, the row operations on the augmented matrix are shown. Small rounding differences can appear in the last decimal place because JavaScript uses floating-point numbers. Treat very small values near zero as zero when interpreting a determinant or an inverse entry.
Frequently asked questions
Why can I only choose square matrices?
Addition, subtraction and transposition work for any shape, but determinants and inverses are defined only for square matrices. A single square size keeps every operation valid without extra dimension controls. For rectangular multiplication practice, use the same size and remember that the usual dimension rule still explains the row-by-column process.
What does a singular matrix mean?
A singular matrix has a determinant of zero and no inverse. It maps different input vectors to the same output, so information is lost and the transformation cannot be reversed. The calculator stops and explains this rather than dividing by zero.
Can I use decimals and negative numbers?
Yes. Every cell accepts signed decimals. Fractions are not evaluated in this tool, so enter their decimal value, such as 0.5 for one half. Results are rounded for display but calculations use full precision.