Matrix Multiplication (Product) Calculator

Matrix Multiplication (Product) Calculator

Growing AI Skill PRO

Enter Calculation

Enter rows separated by semicolons, cells by commas.
Enter rows separated by semicolons, cells by commas.

Formula

(AB)ik=∑j=1naijbjk\left(\mathbf{A}\,\mathbf{B}\right)_{ik} = \sum_{j=1}^{n} a_{ij}\,b_{jk}
Usage stats

Advertisement

Results

Matrix product (C) — 2×2
[
19 22
43 50
]
Result rows 2
Result columns 2
Top-left element c11 19
Product (row-major) 19,22;43,50

Report an error on this page

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.

Two adjacent matrices showing inner dimensions matching for conformability
Multiplication is defined only when the inner dimensions match (A is m×n, B is n×p), giving an m×p result.

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}$$
Advertisement

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]].

Diagram showing one row of matrix A and one column of matrix B combining into a single entry of product matrix C
Each entry \(c_{ik}\) is the dot product of row i of A with column k of B.

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.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators