Matrix Multiplication Calculator
Test cases replayed : 2 of 2 match · Methodology · No outside source listed
Enter two 3×3 matrices A and B to get the product A × B. For 2×2 matrices, leave the third row and column at 0.
Result
A × B row 1, column 1
A × B row 1, column 2
- A × B row 1, column 3
- A × B row 2, column 1
- A × B row 2, column 2
- A × B row 2, column 3
- A × B row 3, column 1
- A × B row 3, column 2
- A × B row 3, column 3
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- A row 1, column 1: enter a number.
- A row 1, column 2: enter a number.
- A row 1, column 3: enter a number.
- A row 2, column 1: enter a number.
- A row 2, column 2: enter a number.
- A row 2, column 3: enter a number.
- A row 3, column 1: enter a number.
- A row 3, column 2: enter a number.
- A row 3, column 3: enter a number.
- B row 1, column 1: enter a number.
- B row 1, column 2: enter a number.
- B row 1, column 3: enter a number.
- B row 2, column 1: enter a number.
- B row 2, column 2: enter a number.
- B row 2, column 3: enter a number.
- B row 3, column 1: enter a number.
- B row 3, column 2: enter a number.
- B row 3, column 3: enter a number.
- Read the result: A × B row 1, column 1; the panel also shows A × B row 1, column 2, A × B row 1, column 3, A × B row 2, column 1, A × B row 2, column 2, A × B row 2, column 3, A × B row 3, column 1, A × B row 3, column 2 and A × B row 3, column 3.
How this calculator works
Each entry of the product is a dot product: (AB)ᵢⱼ = Aᵢ₁B₁ⱼ + Aᵢ₂B₂ⱼ + Aᵢ₃B₃ⱼ, row i of A against column j of B.
The product is defined when A has as many columns as B has rows; an m×n matrix times an n×p matrix gives an m×p matrix.
Order matters: A × B and B × A are generally different matrices.
The formula
| Symbol | Meaning |
|---|---|
| A row 1, column 1 | |
| A row 1, column 2 | |
| A row 1, column 3 | |
| B row 1, column 1 | |
| B row 2, column 1 | |
| B row 3, column 1 | |
| A × B row 1, column 1 |
Worked example
| A row 1, column 1 | 1 |
|---|---|
| A row 1, column 2 | 2 |
| A row 1, column 3 | 3 |
| A row 2, column 1 | 4 |
| A row 2, column 2 | 5 |
| A row 2, column 3 | 6 |
| A row 3, column 1 | 7 |
| A row 3, column 2 | 8 |
| A row 3, column 3 | 9 |
| B row 1, column 1 | 9 |
| B row 1, column 2 | 8 |
| B row 1, column 3 | 7 |
| B row 2, column 1 | 6 |
| B row 2, column 2 | 5 |
| B row 2, column 3 | 4 |
| B row 3, column 1 | 3 |
| B row 3, column 2 | 2 |
| B row 3, column 3 | 1 |
| A × B row 1, column 2 | 24 |
|---|---|
| A × B row 1, column 3 | 18 |
| A × B row 2, column 1 | 84 |
| A × B row 2, column 2 | 69 |
| A × B row 2, column 3 | 54 |
| A × B row 3, column 1 | 138 |
| A × B row 3, column 2 | 114 |
| A × B row 3, column 3 | 90 |
A × B row 1, column 1 30
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
How do you multiply two matrices?
Multiply each row of the first by each column of the second, entry by entry, and add the products. Row 1 of A = (1, 2, 3) times column 1 of B = (9, 6, 3) gives 9 + 12 + 9 = 30.
Is matrix multiplication commutative?
No. In general A × B ≠ B × A, even for square matrices of the same size.
What is the identity matrix?
The matrix with 1s on the diagonal and 0s elsewhere. Multiplying any matrix by it leaves the matrix unchanged.