Add, multiply, transpose, and find determinant/inverse of matrices
Matrices are rectangular arrays of numbers used in linear algebra, physics, computer graphics, and machine learning.
| Operation | Requirement | Result size |
|---|---|---|
| Addition / subtraction | Both matrices the same size | Same size |
| Scalar multiplication | None | Same size |
| Matrix multiplication A×B | Columns of A = rows of B | rows(A) × cols(B) |
| Transpose | None | Rows and columns swapped |
| Determinant | Square matrix | A single number |
| Inverse | Square and determinant ≠ 0 | Same size |
| Rank | None | A single number ≤ min(rows, cols) |
A = [[3, 8], [4, 6]]
det A = (3 × 6) − (8 × 4) = 18 − 32 = −14
Non-zero, so the inverse exists.
Swap a and d, negate b and c: [[6, −8], [−4, 3]]
Divide every entry by −14
A⁻¹ = [[−0.4286, 0.5714], [0.2857, −0.2143]]
B = [[6, 1, 1], [4, −2, 5], [2, 8, 7]]
Expand along the first row.
6 × det[[−2, 5], [8, 7]] = 6 × (−14 − 40) = 6 × (−54) = −324
−1 × det[[4, 5], [2, 7]] = −1 × (28 − 10) = −18
+1 × det[[4, −2], [2, 8]] = 1 × (32 + 4) = 36
det B = −324 − 18 + 36 = −306
Entry (i, j) of the product is the dot product of row i of the first matrix with column j of the second. For [[1, 2], [3, 4]] × [[5, 6], [7, 8]]: the top-left entry is 1×5 + 2×7 = 19, top-right is 1×6 + 2×8 = 22, bottom-left is 3×5 + 4×7 = 43, bottom-right is 3×6 + 4×8 = 50 — giving [[19, 22], [43, 50]]. Note that matrix multiplication is not commutative: reversing the order here gives [[23, 34], [31, 46]], a completely different matrix.
Multiply the top-left by the bottom-right, then subtract the product of the top-right and bottom-left. For [[a, b], [c, d]] the determinant is ad minus bc.
When its determinant is zero. Such a matrix is called singular, and it means at least one row is a linear combination of the others, so the transformation it represents collapses space and cannot be undone.
No. AB and BA are generally different matrices, and for non-square matrices one of the two products may not even be defined. Matrix multiplication is associative and distributive, but never assume it commutes.
The number of linearly independent rows, which always equals the number of linearly independent columns. It tells you the dimension of the space the matrix maps onto, and a square matrix is invertible exactly when its rank equals its size.
Write it as Ax = b. If A is square and invertible, x = A⁻¹b. In practice, row-reduce the augmented matrix [A | b] by Gaussian elimination — it is faster, and it also tells you immediately if the system has no solution or infinitely many.
Everything on this page runs in your browser — nothing you type is uploaded or stored.
Short, exact answers to the questions people ask alongside this tool — the number first, then the working.
For teams, not just visitors
We build the calculators on SnoopTool as embeddable widgets in your branding, wired to your own lead form — the same maths, your colours, your domain, your leads. Tell us which one and we will send back a working demo you can put in front of your team.
Thanks — we have it, and you will get a reply from a person within one business day. Meanwhile every tool on SnoopTool stays free, with no signup.