Matrix multiplication composes linear transformations, chains Markov transitions, rotates and scales graphics, and is the core operation of neural networks.
How to use the Matrix Multiplication Calculator
- First matrix size (rows × columns)
- A: a₁
- A: b₁
- A: c₁
- A: a₂
- A: b₂
- A: c₂
- A: a₃
- A: b₃
- A: c₃
- Second matrix size (rows × columns)
- B: x₁
- B: y₁
- B: z₁
- B: x₂
- B: y₂
- B: z₂
- B: x₃
- B: y₃
- B: z₃
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Each entry of the product is the dot product of a row of A with a column of B. The number of columns of A must equal the number of rows of B.
Tips
- Check the sizes first: matrix products need the inner dimensions to match.
- Enter the matrix row by row; each row of fields is one row of the matrix.
- Integer matrices are shown with exact fractions where the result is rational.
- A determinant of zero means the matrix has no inverse and its columns are dependent.
Common mistakes to avoid
- Multiplying matrices element by element when a matrix product is needed.
- Assuming AB = BA – matrix multiplication is not commutative.
- Mixing up rows and columns when reading a result.
Formula
cᵢⱼ = Σₖ aᵢₖ · bₖⱼ (A is m × n, B is n × p, C is m × p)
Worked example
Inputs — First matrix size (rows × columns): 2 × 3; A: a₁: 4; A: b₁: 1; A: c₁: 2; A: a₂: 1; A: b₂: 3; A: c₂: 0; Second matrix size (rows × columns): 3 × 2; B: x₁: 1; B: y₁: 2; B: x₂: 0; B: y₂: 1; B: x₃: 2; B: y₃: 1.
Results — A × B = ⎡ 8 11 ⎤
⎣ 1 5 ⎦; Size of the product = 2×2; How each entry is computed = c₁₁ = 4·1 + 1·0 + 2·2 = 8
c₁₂ = 4·2 + 1·1 + 2·1 = 11
c₂₁ = 1·1 + 3·0 + 0·2 = 1
c₂₂ = 1·2 + 3·1 + 0·1 = 5.
Key terms
- Matrix product
- The composition of linear maps.
Frequently asked questions
When can two matrices be multiplied?
When A has as many columns as B has rows.
Is AB = BA?
Generally not – matrix multiplication is not commutative.
What is the size of the product?
(rows of A) × (columns of B).
What is the identity matrix?
The square matrix with 1s on the diagonal; AI = IA = A.
What formula does the Matrix Multiplication Calculator use?
cᵢⱼ = Σₖ aᵢₖ · bₖⱼ (A is m × n, B is n × p, C is m × p).