Matrix Multiplication Calculator

This matrix multiplication calculator multiplies two matrices and shows 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?
Matrix multiplication is not commutative: in general A times B does not equal B times A, 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 operands changes which rows pair with which columns. With A = [[1, 1], [0, 1]] and B = [[1, 0], [1, 1]], AB is [[2, 1], [1, 1]] while BA is [[1, 1], [1, 2]]. Try entering the same two square matrices in both orders 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 a value like 1/3 stays exact instead of rounding to 0.3333. Each entry of the product is a sum of many separate products, and floating-point rounding errors compound across those additions, especially in larger matrices. Chaining several multiplications together magnifies the drift further. Exact fractions keep every intermediate dot product and the final result mathematically precise.