Matrix Multiplication Calculator
AlgebraFreeNo sign-up
Choose the sizes, enter matrices A and B, and get the product AB with every entry shown as a row of A times a column of B. AB exists only when A has as many columns as B has rows; an m × n matrix times an n × p matrix gives an m × p matrix.
How to multiply two matrices
To find AB, the number of columns of A must equal the number of rows of B. If A is m × n and B is n × p, the product AB is m × p. Each entry cij is the dot product of row i of A and column j of B: multiply matching entries and add.
Worked example
A = [1 2 3; 4 5 6] (2 × 3) and B = [7 8; 9 10; 11 12] (3 × 2). AB is 2 × 2.
- c11 = 1·7 + 2·9 + 3·11 = 7 + 18 + 33 = 58
- c12 = 1·8 + 2·10 + 3·12 = 8 + 20 + 36 = 64
- c21 = 4·7 + 5·9 + 6·11 = 28 + 45 + 66 = 139
- c22 = 4·8 + 5·10 + 6·12 = 32 + 50 + 72 = 154
So AB = [58 64; 139 154]. Press Example above to see it worked in the calculator.
Rules to remember
- Order matters. AB and BA are usually different, and one may not even exist. Above, BA is 3 × 3, not 2 × 2.
- Associative: (AB)C = A(BC).
- Distributive: A(B + C) = AB + AC.
- Identity: AI = IA = A.
- AB = 0 does not mean A = 0 or B = 0.
- (AB)ᵀ = BᵀAᵀ.
Which sizes can be multiplied?
| A | B | AB |
|---|---|---|
| 2 × 3 | 3 × 2 | 2 × 2 |
| 3 × 3 | 3 × 1 | 3 × 1 (a column vector) |
| 1 × 4 | 4 × 1 | 1 × 1 (a single number) |
| 2 × 3 | 2 × 3 | Not defined (3 ≠ 2) |
Where matrix multiplication is used
- Writing a system of linear equations as Ax = b.
- Combining transformations in computer graphics: rotate, then scale, as one matrix.
- Markov chains: a probability vector times a transition matrix gives next step’s probabilities.
- Totals in business: a quantity matrix times a price matrix gives cost per store.
Need A⁻¹ first? Use the inverse matrix calculator.
Matrix multiplication quiz: 10 questions
Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.
Quiz complete
Frequently asked questions
When can two matrices be multiplied?
When the number of columns in the first equals the number of rows in the second. A 2 × 3 times a 3 × 4 works and gives a 2 × 4.
Is matrix multiplication commutative?
No. In general AB ≠ BA, and one of them may not be defined. It is associative, (AB)C = A(BC).
How do you multiply a 2×2 matrix?
For [a b; c d][e f; g h], the product is [ae + bg af + bh; ce + dg cf + dh]: each entry is a row times a column.
What size is the product matrix?
Rows of the first by columns of the second: an m × n matrix times an n × p matrix is m × p.
Can I use fractions?
Yes. Entries can be integers, decimals or fractions like 2/3, and the answer is exact. Tick Show decimals for decimal form.
Sources
- OpenStax Precalculus 2e: Matrices and Matrix Operations
- MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang)
Related calculators
More algebra calculators
Related to This Article
More math articles
- How to Add and Subtract Functions? (+FREE Worksheet!)
- Classifying Quadrilaterals for 4th Grade
- Long Division by One Digit for 4th Grade
- Substantive and procedural due process
- Family, Household, Kinship, and Family Position
- Chapter 23: Privacy and Personal Liberty
- GED Science Practice: How to Read Experiments, Graphs, and Evidence
- Heron’s Formula Calculator — Area from 3 Sides
- The Ultimate NES Elementary Education Math Course
- What Is The Best Calculator For Trigonometry?


What people say about "Matrix Multiplication Calculator with Steps"?
No one replied yet.