What this calculator does
This tool computes the product of two matrices, C = A.B or C = B.A, applying the standard rules of linear algebra. It works for square matrices, rectangular matrices, row vectors and column vectors alike. Matrix multiplication is universal mathematics, so the results apply identically everywhere with no units or jurisdiction.
How to use it
Enter Matrix A and Matrix B as text. Separate rows with a semicolon and cells within a row with a comma. For example, the matrix [[1,2],[3,4]] is typed as 1,2;3,4. Pick the multiplication order: A × B = C or B × A = C (the two are generally different). Press calculate to see the product matrix plus its dimensions and top-left element.
The formula explained
For a product M.N = C where M is r × s and N is s × t, each entry is \((\mathbf{M}\,\mathbf{N})_{ik} = \sum_{j} m_{ij}\,n_{jk}\). In words, the element in row i, column k of the result is the dot product of row i of the left matrix with column k of the right matrix. The product exists only when the inner dimensions match: the number of columns of the left matrix must equal the number of rows of the right matrix.
$$\left(\mathbf{A}\,\mathbf{B}\right)_{ik} = \sum_{j=1}^{n} a_{ij}\,b_{jk}$$and conversely
$$\left(\mathbf{B}\,\mathbf{A}\right)_{ik} = \sum_{j=1}^{n} b_{ij}\,a_{jk}$$
Worked example
Let A = [[1,2],[3,4]] and B = [[5,6],[7,8]], order A × B. The inner dimensions are 2 = 2, so the result is 2 × 2.
$$c_{11} = 1\cdot 5 + 2\cdot 7 = 19$$$$c_{12} = 1\cdot 6 + 2\cdot 8 = 22$$$$c_{21} = 3\cdot 5 + 4\cdot 7 = 43$$$$c_{22} = 3\cdot 6 + 4\cdot 8 = 50$$giving C = [[19,22],[43,50]].
FAQ
Why is the product sometimes undefined? If the columns of the left matrix do not equal the rows of the right matrix, no product exists and the calculator reports the mismatch.
Is A.B the same as B.A? No. Matrix multiplication is not commutative; one order may even be defined while the other is not. Use the order selector to choose.
Can I multiply vectors? Yes. A 1 × n row times an n × 1 column gives a 1 × 1 scalar; the reverse gives an n × n matrix.