Intermediate

Matrix Multiplication Calculator

Multiply two matrices A and B with the row-by-column dot product rule to get the product matrix C = AB.
Each line is a row. All rows must have the same length.
Rows of B must equal columns of A.
Product matrix C = AB
[ 19, 22 | 43, 50 ]
Dimensions of A
2 × 2
Dimensions of B
2 × 2
Dimensions of C
2 × 2
Entries in C
4
The product matrix AB as a composed linear transformation
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

To multiply matrices A (m×n) and B (n×q), the inner dimensions must match. Each entry of the product C (m×q) is the dot product of a row of A with a column of B: C[i][j] = Σ A[i][k]·B[k][j]. Order matters, since AB is generally not equal to BA.

Formula
C[i][j] = Σₖ A[i][k] · B[k][j]
How this is calculated

Enter Matrix A (size m×n) and Matrix B (size p×q), each as text where every line is a row and entries are separated by spaces or commas. Every row within a matrix must contain the same number of values, and all values must be valid numbers.

Matrix multiplication is only defined when the inner dimensions match, that is when the number of columns of A (n) equals the number of rows of B (p). The product C has size m×q. Each entry C[i][j] is the dot product of row i of A with column j of B: C[i][j] = A[i][0]·B[0][j] + A[i][1]·B[1][j] + … + A[i][n-1]·B[n-1][j].

Matrix multiplication is associative and distributive but generally NOT commutative, so AB is usually different from BA. If the inner dimensions do not match, the product is undefined and the calculator reports an error. Empty lines are ignored, and a ragged matrix (rows of unequal length) is treated as invalid.

Frequently asked questions

Only when the number of columns of the first matrix equals the number of rows of the second. An m×n matrix can be multiplied by an n×q matrix, producing an m×q result.

No. In general AB ≠ BA. The order matters, and sometimes only one of the two products is even defined depending on the dimensions.

Type each row on its own line, separating the numbers with spaces or commas. Every row must have the same number of entries.

Also known as

multiply matrices
matrix product
matrix multiplication
ab product
matrix multiply
multiplying matrices
product of matrices

APA

TG we-Calculate Editorial Team. (2026). Matrix Multiplication Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/matrix-multiplication-calculator

Chicago

TG we-Calculate Editorial Team. "Matrix Multiplication Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/matrix-multiplication-calculator.

IEEE

TG we-Calculate Editorial Team, "Matrix Multiplication Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/matrix-multiplication-calculator

BibTeX

@misc{wecalculate_matrix_multiplication_calculator, title = {Matrix Multiplication Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/matrix-multiplication-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?