How it works
A matrix is a rectangular grid of numbers, and this calculator performs the four operations you reach for most: addition, subtraction, multiplication and determinant. Enter each matrix row by row, pick an operation, and the result updates immediately — all computed in your browser.
The formula
Addition/subtraction: add or subtract each pair of matching entries — Cᵢⱼ = Aᵢⱼ ± Bᵢⱼ. Both matrices must be the same size.
Multiplication: entry Cᵢⱼ is the dot product of row i of A and column j of B — Cᵢⱼ = Σ Aᵢₖ·Bₖⱼ. The number of columns in A must equal the number of rows in B.
Determinant (2×2): det = ad − bc for matrix [[a,b],[c,d]].
Determinant (3×3): expand along the top row using the standard cofactor expansion.
Worked example
Multiply A = [[1,2],[3,4]] by B = [[5,6],[7,8]]:
- C₁₁ = (1×5)+(2×7) = 19
- C₁₂ = (1×6)+(2×8) = 22
- C₂₁ = (3×5)+(4×7) = 43
- C₂₂ = (3×6)+(4×8) = 50
- Result:
[[19, 22], [43, 50]]
For the determinant of A alone: det = (1×4) − (2×3) = 4 − 6 = −2. Since it's non-zero, A is invertible.
Tips
- Double-check dimensions before multiplying — A×B only works when A's column count matches B's row count; this is the most common input mistake.
- A zero determinant is a signal, not an error — it means the matrix can't be inverted and any linear system it represents either has no solution or infinitely many.
- Matrix multiplication order matters. If you need B×A instead of A×B, swap the inputs — don't assume the result will be the same.