Matrix multiplication calculator
Multiply two matrices and see the dot product behind every single entry. Handles any compatible sizes up to 50×50, including A×B and B×A.
Fill in matrices A and B above and press A × B. The button is disabled when the sizes do not fit, with a note telling you which dimensions must match. Open the steps to see each entry expanded as a sum of products, which is exactly how you would write it out by hand.
The dimension rule
To multiply an m×n matrix by an n×p matrix, the inner numbers must be equal: columns of A must match rows of B. The result is m×p — the outer numbers. This is why A × B can be perfectly valid while B × A is not even defined.
Worked example
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
| 7 | 8 |
| 19 | 22 |
| 43 | 50 |
The top-left entry is row 1 of A dotted with column 1 of B: 1·5 + 2·7 = 19. Each of the four entries is its own little dot product, and the calculator prints all four expansions.
Common mistakes
- Multiplying entry by entry. Matrix multiplication is not
a(i,j)·b(i,j). That operation exists — it is called the Hadamard product — but it is not whatA × Bmeans. - Assuming AB = BA. Matrix multiplication is not commutative. Try both buttons on the same pair and compare.
- Concluding a factor is zero.
A·B = 0does not mean A or B is zero: matrices have zero divisors. - Transposing in place.
(A·B)ᵀ = Bᵀ·Aᵀ— the order reverses.