How this calculator works
Enter matrix A (and matrix B, if your operation needs two) as rows of numbers, with rows separated by a semicolon and the values within a row separated by commas or spaces, for example 1, 2; 3, 4 for a 2x2 matrix. Choose an operation—addition, subtraction, multiplication, determinant, inverse, or transpose—and the result is computed and shown both as bracket notation and as a grid.
Addition and subtraction require both matrices to have identical dimensions; multiplication requires the number of columns in A to equal the number of rows in B. When a requirement isn't met, the calculator names the exact dimensions involved so it's clear what needs to change. The determinant and inverse only apply to square matrices, and a matrix whose determinant is 0 (a singular matrix) has no inverse—that case is reported explicitly rather than silently failing.
The methods
Matrix multiplication: (AB)[i][j] = sum over k of A[i][k] * B[k][j], requires A's columns = B's rowsDeterminant: computed via Gaussian elimination to upper-triangular form, as the product of the pivots (with a sign flip per row swap)Inverse: Gauss-Jordan elimination on the matrix augmented with the identity matrix, [A | I] -> [I | A^-1]Transpose: swap rows and columns, so element [i][j] becomes [j][i]A determinant of 0 means the matrix is singular: it has no inverse, because Gauss-Jordan elimination can't produce a pivot in every column.
Worked example: multiplying [[1, 2], [3, 4]] by [[5, 6], [7, 8]]
- Both matrices are 2x2, and A's columns (2) equal B's rows (2), so multiplication is valid.
- Top-left entry: row 1 of A dot column 1 of B = 1*5 + 2*7 = 19.
- Top-right entry: row 1 of A dot column 2 of B = 1*6 + 2*8 = 22.
- Repeating for row 2 gives 3*5+4*7=43 and 3*6+4*8=50, so the result is [[19, 22], [43, 50]].
Frequently asked questions
Why does the determinant of a singular matrix show 0 instead of an error?
A determinant of 0 is a perfectly valid, meaningful answer—it tells you the matrix is singular. The error message appears specifically for the inverse operation, since a matrix with a zero determinant genuinely has no inverse.
How do I enter a matrix?
Separate rows with a semicolon and separate the values in each row with commas or spaces, for example 1, 2, 3; 4, 5, 6; 7, 8, 9 for a 3x3 matrix. Every row must have the same number of values.
Why do addition and multiplication have different dimension rules?
Addition combines matching positions, so both matrices must be exactly the same shape. Multiplication combines rows of A with columns of B, so it only needs A's column count to match B's row count—the two matrices don't need to be the same shape, and the result can even be a different shape than either input.
Is matrix multiplication commutative, like regular multiplication?
No—in general A times B does not equal B times A, and B times A may not even be defined if the dimensions don't line up the other way. Always check which matrix comes first.
What does the transpose do to a non-square matrix?
It swaps rows and columns, so an m-by-n matrix becomes an n-by-m matrix. A 2x3 matrix transposes into a 3x2 matrix, with the first row becoming the first column.