c11: row 1 × column 1
Use row 1 of A, [1, 2, 3], and column 1 of B, [7, 9, 11].
c11 = (1×7) + (2×9) + (3×11) = 58
Matrix Multiplication Guide
To multiply two matrices, take each row of the first matrix and calculate its dot product with each column of the second matrix. The number of columns in the first matrix must equal the number of rows in the second matrix.
Matrix multiplication is based on matching rows from the first matrix with columns from the second matrix. Each entry in the result is a dot product.
Before doing any arithmetic, check the dimensions. If A is m×n and B is n×p, then AB is defined and the result has size m×p.
If A is an m×n matrix and B is an n×p matrix, then:
(m×n)(n×p) = m×p
2 rows × 3 columns
3 rows × 2 columns
3 columns = 3 rows ✓
Rows of A × Columns of B
2 rows × 2 columns
2 rows × 3 columns
2 rows × 2 columns
3 columns ≠ 2 rows ✕
The product AB is not defined.
Matrix A row 1
Matrix B column 1
Result entry c11
(1×7) + (2×9) + (3×11) = 58
A is 2×3. B is 3×2. The inner dimensions match, so the product is defined. The result will be a 2×2 matrix.
Matrix A
Matrix B
Use row 1 of A, [1, 2, 3], and column 1 of B, [7, 9, 11].
c11 = (1×7) + (2×9) + (3×11) = 58
Use row 1 of A, [1, 2, 3], and column 2 of B, [8, 10, 12].
c12 = (1×8) + (2×10) + (3×12) = 64
Use row 2 of A, [4, 5, 6], and column 1 of B, [7, 9, 11].
c21 = (4×7) + (5×9) + (6×11) = 139
Use row 2 of A, [4, 5, 6], and column 2 of B, [8, 10, 12].
c22 = (4×8) + (5×10) + (6×12) = 154
Final result
AB
If A is m×n and B is n×p, then AB is m×p.
Matrix multiplication order matters because AB is usually not the same as BA. In this page's example, AB has size 2×2, while BA would have size 3×3. Since the sizes are already different, the two products cannot be equal.
In some cases AB is defined but BA is not defined at all, so always check dimensions before changing the order.
Continue with one of these related matrix multiplication pages:
No. Two matrices can be multiplied only when the number of columns in the first matrix equals the number of rows in the second matrix.
If A is an m×n matrix and B is an n×p matrix, then AB is an m×p matrix. The outside dimensions become the result size.
Row by column means choosing one row from the first matrix, choosing one column from the second matrix, multiplying matching entries, and adding the products.
Yes. Matrix multiplication order matters because AB and BA can have different sizes, different values, or one order may be undefined.
No. Matrix multiplication uses dot products of rows and columns. It is not the same as multiplying entries in the same positions.
Learn matrix multiplication more easily in just 2 minutes with this free game.
Solve your matrix instantly with our free calculator.
Open Matrix Calculator →