Matrix Multiplication Calculator
Multiply $2 \times 2$, $3 \times 3$, $4 \times 4$, and rectangular matrices of arbitrary dimensions, verify inner dimension compatibility, and inspect complete row-by-column dot product mathematical derivations.
Matrix Dimension Configuration (A × B)
Matrix multiplication requires columns of A (c₁) to equal rows of B (r₂).
Step-by-Step Dot Product Derivation (Row × Column)
How to Multiply Matrices
To multiply an (m × k) matrix A by a (k × n) matrix B, calculate the dot product of each row i of A with each column j of B. The resulting matrix C has dimension (m × n), where entry C(i, j) = Σ A(i, r) · B(r, j) for r = 1 to k. Multiplication is only defined when the number of columns in A equals the number of rows in B.
Matrix Product Definition & Row-by-Column Dot Product
In linear algebra, the matrix product of two matrices $A$ and $B$ produces a new matrix $C = AB$ representing the composition of two linear transformations. Rather than multiplying individual corresponding entries, matrix multiplication computes algebraic dot products between the rows of the first matrix and the columns of the second.
The entry at row i and column j in the product matrix C equals the sum of the products of each element in Row i of Matrix A with the matching element in Column j of Matrix B.
Dimension Compatibility Rules (Inner vs. Outer Dimensions)
Two matrices can be multiplied together if and only if the number of columns in the first matrix equals the number of rows in the second matrix:
The inner dimensions (k and k) must be identical. If they differ, the matrix product is mathematically undefined.
The product matrix inherits the row count of Matrix A (m) and the column count of Matrix B (n).
Fundamental Algebraic Properties of Matrix Multiplication
Non-Commutativity (AB ≠ BA)
Crucial PropertyOrder matters! In general, A · B ≠ B · A. Changing the factor order alters row-column combinations and often yields matrices of entirely different dimensions.
Associative Property
(AB)C = A(BC)When multiplying three or more matrices, grouping does not affect the final product: (A · B) · C = A · (B · C).
Distributive Property
A(B + C) = AB + ACMultiplication distributes over matrix addition from both left and right: A(B + C) = AB + AC and (A + B)C = AC + BC.
Identity Matrix & Product Determinant Rules
The square Identity Matrix ($I$) acts as the multiplicative identity in linear algebra:
Multiplying any matrix by a compatible identity matrix preserves the original matrix entries.
The determinant of the product of two square matrices equals the product of their individual determinants.
Real-World Applications of Matrix Multiplication
3D Computer Graphics & Gaming
GPUs multiply 4×4 projection and transformation matrices to rotate, scale, translate, and illuminate 3D vertex meshes in real time.
AI & Neural Network Layers
Dense and convolutional neural network layers perform high-throughput matrix multiplications ($Y = WX + b$) to evaluate model features.
Markov Chains & Search Ranking
Google PageRank and transition probability systems repeatedly multiply state vectors by transition matrices to find stationary distributions.
Step-by-Step Worked Numerical Solutions
Problem: Multiply Matrix A = [[1, 2], [3, 4]] by Matrix B = [[5, 6], [7, 8]].
Common Pitfalls & Mistakes to Avoid
Confusing Matrix Product with Hadamard Product
Do not multiply entries at the same position (A₁₁ · B₁₁). Standard multiplication requires row-by-column dot product summation.
Ignoring Dimension Mismatch Errors
Attempting to multiply an (m × p) by an (r × n) matrix when p ≠ r is strictly undefined. Always check inner dimensions first.
Assuming AB = BA
Never swap matrix order in equations without checking commutativity. In general, AB ≠ BA.
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.