How it works

Adding and subtracting matrices works entry by entry: Cᵢⱼ = Aᵢⱼ ± Bᵢⱼ, and both matrices must be the same size. Multiplying is different: Cᵢⱼ is row i of A dotted with column j of B, so A × B and B × A usually differ.

Enter matrices one row per line (or separated by semicolons), values separated by spaces or commas. Entries can be fractions like 1/2 — everything is exact rational arithmetic, the same engine as the fraction lessons.

Worked example

Try it with these numbers

The result card above already shows this example — change any field and hit Calculate.

FAQ

Quick answers

How do you multiply two matrices?

Each entry Cᵢⱼ is the dot product of row i of the first matrix with column j of the second: multiply the pairs and add. The number of columns of the first matrix must equal the number of rows of the second.

Can you add matrices of different sizes?

No. Addition and subtraction are entry-by-entry, so both matrices must have identical dimensions. Multiplication only needs the inner dimensions to match.

Is matrix multiplication commutative?

No. A × B and B × A are generally different matrices, and sometimes only one of them exists. Try it above with the multiply operation — swap A and B and watch the result change.

Related calculators

Keep going

Every calculator on one page: all mathplum calculators.