Matrix Multiplication Calculator

Multiply two matrices and see the dot-product working for every cell. Exact fractions, no rounding. Dimensions up to 6×6.

Row i of A × Column j of B → C[i, j] × = A 2×2 B 2×2 C 2×2 C[1,1] = 0

How to Multiply Matrices

Enter the entries of matrix A and matrix B — whole numbers, decimals, and fractions like 1/2 are all accepted.

1

Set the dimensions

Pick the rows and columns for A and B. The number of columns in A must equal the number of rows in B, otherwise the product is undefined.

2

Fill in the entries

Type a value into each cell of both grids. The result updates as you type, and every value is kept as an exact fraction rather than a rounded decimal.

3

Read the result and steps

The product matrix appears first, followed by the dot-product sum used for every cell. Need a different matrix operation? More matrix tools are on the way in this suite.

Frequently Asked Questions

How do you multiply two matrices?
To multiply matrix A by matrix B, the number of columns in A must equal the number of rows in B. Each entry in the result is the dot product of a row from A and a column from B: multiply matching entries together and add the products. The result matrix has as many rows as A and as many columns as B. This calculator shows that dot product worked out term by term for every cell.
Why do matrix dimensions have to match for multiplication?
Each entry in the product is built by pairing every entry in a row of A with the entry in the same position of a column of B, so A must have exactly as many columns as B has rows for every pairing to line up. If the columns of A do not equal the rows of B, some entries would be left without a partner and the multiplication is undefined. A 2x3 matrix can multiply a 3x2 matrix (giving a 2x2 result), but not a 2x3 matrix.
Is matrix multiplication commutative?
No. In general A times B does not equal B times A for matrices, even when both products are defined and have the same dimensions. Order matters because each entry of the product depends on a specific row-column pairing, and swapping the order changes which rows pair with which columns. Try entering the same two square matrices in both orders in this calculator to see the results differ.
Why does this calculator use fractions instead of decimals?
Matrix entries are stored and multiplied as exact fractions using integer arithmetic, so results like 1/3 stay exact instead of rounding to 0.333... Rounding errors compound quickly across the many additions in matrix multiplication, especially in larger matrices, so exact fractions keep every step and the final result mathematically precise.