Matrix calculator
Add, subtract and multiply matrices, and find the determinant, transpose or inverse, for 2×2, 3×3 or 4×4 matrices.
Result
Determinant of A
-
No inverse
A singular matrix (determinant 0) has no inverse.
How it works
A matrix is a rectangular grid of numbers arranged in rows and columns. This calculator works with square matrices, where the number of rows equals the number of columns, and supports addition, subtraction, multiplication, the determinant, the transpose and the inverse.
- Pick a size
2×2, 3×3 or 4×4. Both matrices share the same size.
- Choose an operation
Matrix B only appears for addition, subtraction and multiplication.
- Fill in the numbers
The result updates as you type.
Determinant, transpose and inverse
For a 2×2 matrix [[a, b], [c, d]], the determinant is ad - bc. For a 2×2 example [[1, 2], [3, 4]]: det = (1 × 4) - (2 × 3) = -2. Larger matrices expand recursively along the first row, multiplying each entry by the determinant of the smaller matrix left after removing its row and column.
det([[a, b], [c, d]]) = ad - bc
The transpose flips a matrix over its diagonal: row i, column j of the transpose is row j, column i of the original. The inverse of A, written A⁻¹, is the matrix such that A × A⁻¹ gives the identity matrix (1s on the diagonal, 0s elsewhere). It only exists when the determinant is not 0, and the calculator computes it from the matrix of cofactors divided by the determinant.
Matrix multiplication is not commutative
Unlike ordinary numbers, A × B usually does not equal B × A for matrices. Entry (i, j) of the product is the dot product of row i of A and column j of B, which depends on the order.
What the determinant tells you
A non-zero determinant means the matrix is invertible and the system of equations it represents has exactly one solution. A determinant of 0 means the matrix is singular: it has no inverse, and the related system has either no solution or infinitely many.
Frequently asked questions
How is matrix multiplication different from regular multiplication?
In matrix multiplication, entry (i, j) of the result equals the dot product of row i of matrix A and column j of matrix B. This means A × B usually does not equal B × A. Multiplication is only defined when the number of columns in A equals the number of rows in B; for the square matrices here, that just means A and B are the same size.
Can you add two matrices of different sizes?
No. Matrix addition and subtraction require both matrices to be exactly the same size. You add corresponding entries: entry (i, j) of A + B equals A[i][j] + B[i][j]. The calculator keeps matrix B the same size as matrix A automatically.
What is the determinant of a matrix and what does it tell you?
The determinant is a single number calculated from a square matrix. For a 2×2 matrix [[1, 2], [3, 4]], det = (1 × 4) - (2 × 3) = -2. A non-zero determinant means the matrix is invertible. A determinant of 0 means the matrix is singular, with no inverse.
What is the inverse of a matrix, and when does it not exist?
The inverse of A, written A⁻¹, is the matrix that gives the identity matrix when multiplied by A. It exists only when the determinant is not 0. If the determinant is 0, the matrix is called singular and the calculator reports that no inverse exists instead of dividing by 0.
What sizes of matrices does this calculator support?
The calculator supports square matrices of size 2×2, 3×3 and 4×4. Addition, subtraction, multiplication, the determinant, the transpose and the inverse are all available for these sizes; for multiplication, both matrices must be the same selected size.