Matrix Multiplication Calculator
Multiply two matrices A × B of compatible sizes, with the dimension rule and the working for the first entry. Example: with matrix a 1 2 / 3 4, matrix b 5 6 / 7 8, the result is Product A × B = [ 19 22 ] [ 43 50 ].
Last updated · By S. Dilshan · Runs in your browser, nothing is uploaded
Step-by-Step Solution
How do you use the Matrix Multiplication Calculator?
Enter matrices A and B with rows separated by slashes or new lines. If the number of columns of A equals the number of rows of B, the calculator returns the product and shows how the first entry is built; otherwise it explains the size mismatch.
What formula does the Matrix Multiplication Calculator use?
The entry in row i and column j of AB is the dot product of row i of A and column j of B: (AB)ᵢⱼ = Σₖ aᵢₖ·bₖⱼ. An (m × n) matrix times an (n × p) matrix gives an (m × p) matrix. Multiplication is associative but generally not commutative: AB ≠ BA.
Worked example: Matrix A 1 2 / 3 4, Matrix B 5 6 / 7 8
For A = [1 2; 3 4] and B = [5 6; 7 8]: entry (1,1) is 1×5 + 2×7 = 19, entry (1,2) is 1×6 + 2×8 = 22, entry (2,1) is 3×5 + 4×7 = 43 and entry (2,2) is 3×6 + 4×8 = 50. So AB = [19 22; 43 50].
With the default values the calculator returns Product A × B = [ 19 22 ] [ 43 50 ]; Size of the result = 2 × 2; Entry (1,1) = 1×5 + 2×7 = 19.
Where Is This Calculation Used?
Matrix products compose linear transformations: rotations then scalings in graphics, transitions of Markov chains, layers of neural networks and changes of basis. The order matters because the transformation on the right is applied first.
What are the most common mistakes with the Matrix Multiplication Calculator?
- Multiplying entry by entry (that is the Hadamard product, not matrix multiplication).
- Ignoring the size rule.
- Assuming AB = BA.
What Is the Tested Example for the Default Values?
This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.
| Input: Matrix A | 1 2 / 3 4 |
|---|---|
| Input: Matrix B | 5 6 / 7 8 |
| Product A × B | [ 19 22 ] [ 43 50 ] |
| Size of the result | 2 × 2 |
| Entry (1,1) | 1×5 + 2×7 = 19 |
Where Can You Verify These Formulas?
The definitions and formulas on this page follow standard references. Check them against these sources:
Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.
Frequently Asked Questions
How do you multiply two matrices?
Each entry of the product is the dot product of a row of A with a column of B.
When can two matrices be multiplied?
When the number of columns of A equals the number of rows of B.
Is matrix multiplication commutative?
No. In general AB and BA are different, and one may not even exist.