Education
Matrix Multiplication Calculator
Last updated: June 14, 2026
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
Frequently asked questions
To multiply two matrices, you take the dot product of each row of the first matrix (A) with each column of the second matrix (B). The entry in the i-th row and j-th column of the product matrix C is obtained by multiplying the elements of the i-th row of A by the corresponding elements of the j-th column of B and summing the results.
Matrix multiplication is only possible if the number of columns in the first matrix (A) equals the number of rows in the second matrix (B). If matrix A has dimensions m × n and matrix B has dimensions n × p, they can be multiplied to yield a matrix C of size m × p.
No, matrix multiplication is not commutative. In general, A × B does not equal B × A. Even if both products exist and have the same dimensions (such as for square matrices), their resulting values are usually different.
The product matrix C has the same number of rows as the first matrix (A) and the same number of columns as the second matrix (B). For example, multiplying a 3 × 2 matrix by a 2 × 4 matrix results in a 3 × 4 matrix.
Multiplying any square matrix A by the identity matrix I of the same size yields the original matrix A (A × I = I × A = A). The identity matrix acts as the number 1 in matrix algebra.
A 1 × 1 matrix is simply a scalar. Multiplying a 1 × 1 matrix by another 1 × 1 matrix is the same as multiplying two regular numbers.
A matrix can only be multiplied by itself (e.g., A × A) if it is a square matrix (number of rows equals number of columns). This is because the columns of A must match the rows of A.
Standard matrix multiplication uses row-by-column dot products (yielding C_ij = ∑ A_ik × B_kj). Element-wise multiplication (also called the Hadamard product) simply multiplies corresponding elements (C_ij = A_ij × B_ij) and requires both matrices to have identical dimensions.
Yes, it is possible to multiply two non-zero matrices and get a product that consists entirely of zeros. These are called zero divisors in matrix rings.
Related calculators
Education
Time to Decimal Calculator
Convert hours and minutes (HH:MM) to decimal hours and back for timesheets, payroll, or math problems.
Education
Deadline Calculator
Calculate a target deadline date by adding calendar days or business days to a starting date.
Education
Audiobook Calculator
Calculate your actual listening time and time saved when playing back audiobooks or podcasts at faster speeds (1x to 3x).