Matrix Multiplication Calculator
Multiply two matrices of compatible dimensions. Set A as m×n and B as n×p — the result is an m×p matrix.
Loading calculator…
Notes
How Matrix Multiplication Works
The (i,j) entry of the product AB is the dot product of the i-th row of A and the j-th column of B. The number of columns in A must equal the number of rows in B.
Worked 2×2 Example
A:
| 1 | 2 |
| 3 | 4 |
B:
| 5 | 6 |
| 7 | 8 |
AB: (1·5+2·7)=19, (1·6+2·8)=22, (3·5+4·7)=43, (3·6+4·8)=50
| 19 | 22 |
| 43 | 50 |
Matrix multiplication is NOT commutative. AB ≠ BA in general.
See also
- Matrix Calculations Guide — Matrix Multiplication — In-depth notes on Matrix Multiplication with worked examples
Frequently Asked Questions
When can two matrices be multiplied?
Matrix A (m×n) can be multiplied by matrix B only if B has exactly n rows. The result is an m×(cols of B) matrix.
Is matrix multiplication commutative?
No. In general AB ≠ BA, and often BA is not even defined when AB is.
What is the identity matrix in multiplication?
The identity matrix I satisfies AI = IA = A for any square matrix A.