Enter two or three matrices of any compatible size up to 8 × 8 and get the product A × B with every dot product written out. Tap an entry of the result to see exactly which row and column produced it.
Last updated:
Entries can be integers, decimals or fractions like -3/4. Empty cells count as 0. Use Tab or the arrow keys to move between cells.
Result
Tap any entry of the result to see the row × column dot product that produced it.
Dot product explorer
All steps
Advertisement
Advertisement
How to use the Matrix Multiplication Calculator
Set the sizes of A and B with the row and column menus. The banner tells you straight away whether A × B is defined.
Type the entries: integers, decimals or fractions. Tab and the arrow keys move between cells; Random and Identity fill a matrix quickly.
Press Multiply (or Enter in any cell) to get the product.
Tap any entry of the result to see the highlighted row of A, column of B and the full dot product.
Copy the result for a spreadsheet or as LaTeX, or press Use result as A to keep multiplying.
The row-times-column rule
If A is m × n and B is n × p, the product C = AB is m × p and each entry is
cij = ai1b1j + ai2b2j + … + ainbnj
In words: walk across row i of A and down column j of B at the same time, multiply the pairs, and add. The inner sizes (the two n's) must match because every element of the row needs a partner in the column; the outer sizes give the shape of the answer.
Size reference
A
B
A × B
Multiplications
2 × 2
2 × 2
2 × 2
8
3 × 3
3 × 3
3 × 3
27
2 × 3
3 × 2
2 × 2
12
3 × 2
2 × 3
3 × 3
18
1 × 3 (row vector)
3 × 1 (column vector)
1 × 1 (dot product)
3
3 × 1
1 × 3
3 × 3 (outer product)
9
4 × 4
4 × 1
4 × 1
16
2 × 3
2 × 3
not defined
–
Properties to remember
Not commutative: AB and BA are usually different. Try A = [[1, 2], [3, 4]], B = [[0, 1], [1, 0]]: AB swaps the columns of A, while BA swaps its rows.
Associative: (AB)C = A(BC), so a chain can be grouped either way, but the order of the matrices must stay the same.
Distributive: A(B + C) = AB + AC.
Transpose of a product: (AB)ᵀ = BᵀAᵀ, with the order reversed.
Determinants multiply: det(AB) = det(A)·det(B) for square matrices.
Zero products: AB can be the zero matrix even when neither A nor B is zero, so you cannot "cancel" matrices the way you cancel numbers.
For determinants, inverses and row reduction of the result, continue in the Matrix Calculator.
Frequently asked questions
How do you multiply two matrices?
Each entry of the product C = AB is a dot product: entry (i, j) is row i of A times column j of B, multiplying matching entries and adding them. For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], c₁₁ = 1·5 + 2·7 = 19, c₁₂ = 1·6 + 2·8 = 22, c₂₁ = 3·5 + 4·7 = 43 and c₂₂ = 3·6 + 4·8 = 50.
When can two matrices be multiplied?
A × B is defined only when the number of columns of A equals the number of rows of B. If A is m × n and B is n × p, the product is m × p. A 2 × 3 matrix times a 3 × 4 matrix gives a 2 × 4 matrix, but a 2 × 3 matrix cannot multiply another 2 × 3 matrix.
Is matrix multiplication commutative?
No. In general AB ≠ BA, and one of them can be defined when the other is not (a 2 × 3 times a 3 × 4 works, but 3 × 4 times 2 × 3 does not). Use Swap A and B to compare both orders. Matrix multiplication is associative, though: (AB)C = A(BC).
How many multiplications does it take?
Multiplying an m × n matrix by an n × p matrix takes m·n·p multiplications and m·(n − 1)·p additions. Two 3 × 3 matrices need 27 multiplications and 18 additions, which is why seeing every step helps when checking homework.
What does multiplying by the identity matrix do?
The identity matrix I has 1s on the diagonal and 0s elsewhere. For any matrix A of a matching size, AI = A and IA = A, just like multiplying a number by 1.
Can I multiply a matrix by a vector?
Yes. A column vector is an n × 1 matrix, so set B to n rows and 1 column. The product of an m × n matrix and an n × 1 vector is an m × 1 vector, the standard way to apply a linear transformation.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.