Matrix Multiplication Calculator
A matrix multiplication calculator computes the product of two matrices. Two matrices can be multiplied only when the number of columns in the first equals the number of rows in the second; the resulting matrix has the row count of the first and the column count of the second. Each entry of the product is the dot product of a row from the first matrix and a column from the second. Students and engineers use it for linear algebra, transformations, and systems of equations.
Select the dimensions of matrix A and matrix B, type in your numbers, and instantly see the product matrix with a detailed row-by-column calculation breakdown.
Quick Answer
Multiply two matrices and see each step. Enter matrix A and matrix B; the calculator checks that A's columns equal B's rows, then returns the product matrix with the dot-product breakdown for each entry.
Matrix A Dimensions
Matrix B Dimensions
Matrix A
Matrix B
Product Matrix C (2×2)
0 0 | 0 0
Two matrices can only be multiplied if the number of columns in Matrix A equals the number of rows in Matrix B. The product matrix has dimensions of A's rows by B's columns.
Examples
2×2 by 2×2 multiplication
[[1,2],[3,4]] × [[2,0],[1,2]] = [[4,4],[10,8]]
3×2 by 2×3 multiplication
results in a 3×3 matrix
Identity matrix multiplication
A × I = A
How it works
For two matrices A (size m × n) and B (size n × p), the product C = A × B is a matrix of size m × p. Each cell Cij is computed as the dot product of row i from Matrix A and column j from Matrix B:
Cij = ai1b1j + ai2b2j + ... + ainbnj
This requires the column count of A to match the row count of B. If this condition is not met, the matrices cannot be multiplied.
Worked Example: 2 × 2 Matrix Multiplication
Let's multiply two simple 2 × 2 matrices:
Matrix A
3 4
Matrix B
1 2
Product C
10 8
Here is how each entry of the product C is calculated step-by-step:
- C₁₁ (Row 1 × Col 1) = (1 × 2) + (2 × 1) = 2 + 2 = 4
- C₁₂ (Row 1 × Col 2) = (1 × 0) + (2 × 2) = 0 + 4 = 4
- C₂₁ (Row 2 × Col 1) = (3 × 2) + (4 × 1) = 6 + 4 = 10
- C₂₂ (Row 2 × Col 2) = (3 × 0) + (4 × 2) = 0 + 8 = 8
Why Dimensions Matter
When multiplying matrices, the inner dimensions must match. If you try to multiply an m × n matrix by a q × p matrix:
- It is only valid if n = q.
- The resulting matrix dimensions will be m × p.
For instance, a 4 × 3 matrix multiplied by a 3 × 2 matrix is valid and yields a 4 × 2 matrix. However, a 3 × 2 matrix multiplied by a 4 × 3 matrix is invalid because the inner dimensions (2 and 4) do not match.
Related Linear Algebra Tools
If you need other operations, check out our related tools:
Last reviewed: June 2026.
Related Calculators
More tools from Education



