Matrix Multiplication
Multiply two compatible matrices using the standard row-by-column dot products.
Description
Multiply two compatible matrices with standard row-by-column dot products.
Matrix multiplication composes linear transformations and combines rows of a left matrix with columns of a right matrix. It is central to linear algebra, graphics, statistics, machine learning, and solving systems of equations.
When to use Matrix Multiplication Calculator
- Compose two linear transformations
- Verify a matrix factorization or inverse
- Calculate a small matrix product by row-column dot products
How the calculation works
If the first matrix has shape m × k and the second has shape k × n, each output entry is the dot product of one row from the first matrix and one column from the second. The output shape is m × n.
(A · B)ᵢⱼ = Σₖ Aᵢₖ Bₖⱼ Interpreting the result
Read output entry (i,j) as the sum of first[i,k] × second[k,j] over the shared dimension. Matrix multiplication is generally not commutative: A·B may differ from B·A or the reverse product may not be defined.
Important limitations
- The first matrix's column count must equal the second matrix's row count.
- Both matrices must be non-empty and rectangular.
- Floating-point sums can accumulate rounding error for large magnitudes or long rows.