Matrix multiplication is easy to get wrong by hand. Enter two matrices row by row and see the product with every row-times-column calculation written out.
Choose the matrix size.
Enter A and B row by row.
Read AB and check each element.
Element: (AB)ᵢⱼ = Σₖ Aᵢₖ × Bₖⱼ
The matrix multiplication calculator finds the product AB of two square matrices of the same size, either 2 × 2 or 3 × 3. It writes out every element of the answer as a row-times-column sum, so you can see exactly where each number comes from and compare it with your own working.
Matrix multiplication is the operation students most often get wrong by hand, because it is not done entry by entry. It is used to combine transformations such as a rotation followed by a scaling, to compute total costs from quantity and price tables, to model transitions in Markov chains, and inside every neural network. It appears in the Class 12 matrices chapter and in first-year engineering mathematics. Both matrices are typed row by row, separated by commas.
1. Check the sizes: the number of columns of A must equal the number of rows of B. For two n × n matrices this always holds.
2. To find the element in row i and column j of AB, take row i of A and column j of B.
3. Multiply their matching entries: first with first, second with second, and so on.
4. Add those products: (AB)ᵢⱼ = Aᵢ₁B₁ⱼ + Aᵢ₂B₂ⱼ + … + AᵢₙBₙⱼ.
5. Repeat for every position, giving n² elements in total.
6. Arrange the results in the same row and column positions to form AB.
A matrix represents a linear transformation, a rule that sends vectors to vectors. Applying B and then A to a vector should equal applying a single combined matrix. If you follow where B sends each basis vector and then apply A, the coordinates of the result are exactly the row-by-column sums. So matrix multiplication is defined this way to represent composition of transformations. It is not an arbitrary rule, and it is why AB means B first, then A, when acting on a column vector.
Rotating then stretching generally gives a different result from stretching then rotating, so matrix products are not commutative. Try A = [1 1; 0 1] and B = [1 0; 1 1]: AB = [2 1; 1 1] while BA = [1 1; 1 2]. Some pairs do commute, such as any matrix with the identity or with its own inverse, but you cannot assume it. Multiplication is associative, (AB)C = A(BC), and distributes over addition, which is enough for most algebra.
In general an m × n matrix can multiply an n × p matrix, giving an m × p result; this calculator is limited to square 2 × 2 and 3 × 3 pairs. The identity matrix I, with 1s on the diagonal and 0s elsewhere, leaves any matrix unchanged: AI = IA = A. Each element of an n × n product needs n multiplications, so the whole product needs n³. That is 8 for 2 × 2 and 27 for 3 × 3, which shows how easily a hand calculation can slip.
Karan wants to check a Class 12 exercise where A has rows 2, 1 and 3, 4, and B has rows 1, 0 and 5, 2, and he must find AB.
Each element = row of A · column of B: c11 = 2×1 + 1×5 = 7 c12 = 2×0 + 1×2 = 2 c21 = 3×1 + 4×5 = 23 c22 = 3×0 + 4×2 = 8
Product AB: [ 7, 2 ] [ 23, 8 ]
Answer: Product AB [ 7, 2 ] [ 23, 8 ]
Multiplying corresponding entries, as in addition, instead of rows by columns.
Using a column of A with a row of B, which effectively computes a different product.
Assuming AB = BA and swapping the order in a proof or calculation.
Entering a matrix column by column instead of row by row.
Trying to multiply matrices whose inner sizes do not match, such as a 2 × 3 by a 2 × 3.
Combining rotations, reflections and scalings in computer graphics.
Multiplying quantity tables by price tables to get total bills for several shops.
Computing powers of a transition matrix for Markov chain probabilities.
Verifying that a computed inverse is correct, since AA⁻¹ should equal I.
Working through Class 12 and first-year engineering matrix problems.
Is AB the same as BA?
Generally not. Swap the matrices in the inputs to compare.
Can I multiply a 2×3 by a 3×2 matrix?
Mathematically yes, but this calculator is limited to square 2×2 and 3×3 matrices.