Do matrix algebra in your browser. This free matrix calculator handles addition, subtraction and multiplication of two matrices, plus the determinant, transpose and inverse of a matrix — up to 6×6.
Add, subtract or multiply two matrices, or find the determinant, transpose or inverse of matrix A. Empty cells count as zero. Dimensions must be compatible for the chosen operation.
How the Matrix Calculator Works
Matrix algebra shows up anywhere data is organized in rows and columns, from solving linear systems to transforming coordinates. This calculator lets you build two matrices up to 6×6 and run the core operations on them entirely in your browser.
Formula: Addition and subtraction combine matching entries: (A ± B)ᵢⱼ = Aᵢⱼ ± Bᵢⱼ. Multiplication sums row-by-column products: (A×B)ᵢⱼ = Σₖ Aᵢₖ × Bâ‚–â±¼. The determinant is found by cofactor expansion along the first row (for a 2×2, det(A) = Aâ‚â‚×Aâ‚‚â‚‚ − Aâ‚₂×Aâ‚‚â‚; larger matrices expand recursively with alternating signs). The transpose Aáµ€ swaps rows and columns. The inverse Aâ»Â¹ is computed with Gauss-Jordan elimination — augmenting A with the identity matrix and row-reducing until A becomes the identity, at which point the augmented side is Aâ»Â¹; if a pivot column can’t be made non-zero, the matrix is singular and has no inverse.
- Matrix A — the first matrix, entered cell-by-cell with adjustable rows and columns (used by every operation).
- Matrix B — the second matrix, entered the same way (used only for addition, subtraction and multiplication).
- Rows / columns — the dimension controls (1 to 6 each) that resize matrix A and matrix B independently.
- Operation — the button chosen: A + B, A − B, A × B, det(A), Aáµ€ (transpose), or Aâ»Â¹ (inverse).
Example Scenarios
| Matrix A | Matrix B | Operation | Result |
|---|---|---|---|
| [[1,2],[3,4]] | — | det(A) | −2 |
| [[2,0],[0,2]] | — | det(A) | 4 |
| [[1,2],[3,4]] | [[5,6],[7,8]] | A + B | [[6,8],[10,12]] |
| [[1,2],[3,4]] | [[5,6],[7,8]] | A × B | [[19,22],[43,50]] |
| [[1,2],[3,4]] | — | Aᵀ (transpose) | [[1,3],[2,4]] |
| [[4,7],[2,6]] | — | Aâ»Â¹ (inverse) | [[0.6,−0.7],[−0.2,0.4]] |
Matrix Calculator FAQ
What’s the largest matrix size this calculator supports?
Both matrix A and matrix B can be resized up to 6 rows by 6 columns using the row and column step controls above each grid. Empty cells are treated as zero, so you can build smaller matrices inside the same grid without filling every cell.Why does the calculator say a matrix is singular and has no inverse?
A matrix is singular when its determinant is zero, which happens during row reduction when a pivot column can’t be made non-zero. Singular matrices don’t have a unique inverse because their rows or columns are linearly dependent, so the calculator reports the error instead of a result.What’s the difference between the determinant and the inverse of a matrix?
The determinant is a single number that summarizes properties like whether a matrix is invertible and how it scales area or volume. The inverse is an entire matrix that “undoes” A, satisfying A × Aâ»Â¹ = the identity matrix, and it only exists when the determinant is non-zero.Can I multiply two matrices of any size together?
No — matrix multiplication A × B requires the number of columns in A to equal the number of rows in B. If the dimensions don’t match, the calculator can’t compute a result, so you may need to resize A or B first using the dimension controls.How is the determinant calculated for matrices larger than 2×2?
The calculator expands along the first row: for each entry it multiplies the entry by the determinant of the smaller matrix left after removing that entry’s row and column, alternates the sign, and sums the results. This is applied recursively down to the 2×2 base case.What does the transpose of a matrix actually do?
Transposing swaps every entry’s row and column index, so row 1 becomes column 1, row 2 becomes column 2, and so on. A matrix that was m rows by n columns becomes n rows by m columns after transposing, with the same values just rearranged.Related Calculators
Matrix work often overlaps with other algebra tasks — check slopes between coordinate points with the slope calculator, simplify fractional matrix entries with the fraction calculator, or handle everyday arithmetic with the scientific calculator.