1Check the dimensions
If A has m rows and n columns, and B has n rows and p columns, multiplication is possible. The shared dimension n must match.
Multiply two matrices online, calculate the product A × B, and inspect each row-by-column calculation. Choose compatible matrix dimensions and enter your own numbers for an immediate result.
Choose the dimensions first. The calculator keeps the inner dimensions compatible so the product can be computed.
Matrix multiplication combines rows from the first matrix with columns from the second matrix. It is different from multiplying entries in matching positions.
If A has m rows and n columns, and B has n rows and p columns, multiplication is possible. The shared dimension n must match.
To calculate one result entry, multiply each number in a row of A by the corresponding number in a column of B, then add those products together.
Consider these two matrices:
The top-left entry is calculated from the first row of A and the first column of B: (1 × 5) + (2 × 7) = 19. The top-right entry is (1 × 6) + (2 × 8) = 22. The bottom-left entry is (3 × 5) + (4 × 7) = 43, and the bottom-right entry is (3 × 6) + (4 × 8) = 50.
You can load this example into the calculator above to check the result.
Multiply a row of the first matrix by a column of the second matrix. Multiply corresponding entries and add the products. Repeat for every row-column combination to fill the result matrix.
The number of columns in the first matrix must equal the number of rows in the second matrix. If A is m × n and B is n × p, the product AB has dimensions m × p.
Yes. Matrices do not have to be square. For example, a 2 × 3 matrix can be multiplied by a 3 × 4 matrix, producing a 2 × 4 matrix.
No, not in general. AB and BA can have different values, different dimensions, or one product may be undefined. The order of the matrices matters.
This calculator supports matrices from 1 × 1 up to 8 × 8 when their dimensions are compatible. Enter real numbers, including negative and decimal values.
Continue working with matrices using these related tools.