Matrix Calculator

Add, subtract, multiply, scale, transpose or find the determinant of matrices of any size.

Used by A + B, A − B and A × B.

Used by Scalar × A.

Result

Export:

Result matrix

Column 1Column 2
1922
4350

The operations explained

Addition and subtraction work position by position, so each entry of A combines only with the matching entry of B, and both matrices must be the same size. Multiplication is different: every entry of the product is a dot product of one row of A with one column of B, which is why A must have as many columns as B has rows.

The determinant collapses a square matrix down to a single number that measures how it scales area or volume, the transpose reflects the matrix across its main diagonal, and scalar multiplication stretches every entry by the same factor.

  • A + B and A − B: matching sizes, combine matching entries.
  • A × B: A’s columns must equal B’s rows.
  • det(A): only for square matrices.
  • Transpose: swap rows and columns.
  • Scale A: multiply every entry by the scalar.

Reading the result

For addition, subtraction, multiplication, scaling and transpose the answer is itself a matrix shown in the result table. For the determinant the answer is a single scalar.

A determinant of zero is meaningful: it tells you the matrix is singular and has no inverse, which often means its rows (or columns) are linearly dependent.

Common mistakes

The classic error in matrix multiplication is treating it like entry-by-entry multiplication. Each product entry needs a full row-times-column sum, not just one product.

  • Do not multiply matrices entry by entry — use the dot-product rule.
  • Check the dimensions match the operation before reading the result.
  • Order matters: A × B and B × A usually differ.

Formula

det(A) by cofactor expansion;  (AB)ᵢⱼ = Σ aᵢₖ·bₖⱼ

Frequently asked questions

Why does A × B differ from B × A?
Matrix multiplication is not commutative. Swapping the order generally changes the result, and may not even be defined if the dimensions stop matching.