A powerful, easy-to-use online tool for multiplying matrices and calculating matrix products with step-by-step explanations. Solutions come with steps.
Enter matrix dimensions and values, then click "Calculate" to see the step-by-step solution.
Matrix multiplication is a binary operation that takes a pair of matrices and produces another matrix. Unlike simple arithmetic multiplication, matrix multiplication follows specific rules and has requirements on the dimensions of the matrices.
💡 Matrix multiplication is fundamental to linear algebra and has numerous applications in science, engineering, computer graphics, and data analysis.
⚠️ Two matrices can be multiplied only when the number of columns in the first matrix equals the number of rows in the second matrix.
a11 | a12 |
a21 | a22 |
a31 | a32 |
b11 | b12 | b13 | b14 |
b21 | b22 | b23 | b24 |
c11 | c12 | c13 | c14 |
c21 | c22 | c23 | c24 |
c31 | c32 | c33 | c34 |
Columns of A (2) = Rows of B (2) ✓ Compatible
To calculate the element at position (i, j) in the resulting matrix:
🔢 Mathematically, if C = A×B, then:
C[i,j] = A[i,1]×B[1,j] + A[i,2]×B[2,j] + ... + A[i,n]×B[n,j]
Let's multiply these two matrices:
1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 |
11 | 12 |
Calculating C[1,1]:
Take row 1 from A: [1, 2, 3]
Take column 1 from B: [7, 9, 11]
Multiply corresponding elements and sum:
C[1,1] = 1×7 + 2×9 + 3×11
C[1,1] = 7 + 18 + 33 = 58
Calculating C[1,2]:
Take row 1 from A: [1, 2, 3]
Take column 2 from B: [8, 10, 12]
Multiply corresponding elements and sum:
C[1,2] = 1×8 + 2×10 + 3×12
C[1,2] = 8 + 20 + 36 = 64
Calculating C[2,1]:
Take row 2 from A: [4, 5, 6]
Take column 1 from B: [7, 9, 11]
Multiply corresponding elements and sum:
C[2,1] = 4×7 + 5×9 + 6×11
C[2,1] = 28 + 45 + 66 = 139
Calculating C[2,2]:
Take row 2 from A: [4, 5, 6]
Take column 2 from B: [8, 10, 12]
Multiply corresponding elements and sum:
C[2,2] = 4×8 + 5×10 + 6×12
C[2,2] = 32 + 50 + 72 = 154
Final result:
58 | 64 |
139 | 154 |
The identity matrix (I) has 1s on the main diagonal and 0s elsewhere. When a matrix is multiplied by the identity matrix of appropriate size, the original matrix is unchanged.
A × I = I × A = A
5 | 2 | 8 |
1 | 3 | 7 |
4 | 6 | 9 |
1 | 0 | 0 |
0 | 1 | 0 |
0 | 0 | 1 |
5 | 2 | 8 |
1 | 3 | 7 |
4 | 6 | 9 |
The original matrix remains unchanged when multiplied by the identity matrix.
Matrix multiplication is not commutative. In general:
A × B ≠ B × A
A × B:
1 | 2 |
3 | 4 |
5 | 6 |
7 | 8 |
19 | 22 |
43 | 50 |
B × A:
5 | 6 |
7 | 8 |
1 | 2 |
3 | 4 |
23 | 34 |
31 | 46 |
As you can see, A×B ≠ B×A
When multiplying a matrix by a scalar (a single number), multiply each element of the matrix by that scalar.
Example: 3 × Matrix
2 | 4 |
1 | 3 |
6 | 12 |
3 | 9 |
The transpose of a product is the product of the transposes in reverse order:
(A × B)ᵀ = Bᵀ × Aᵀ
Where Aᵀ means the transpose of A (rows become columns, columns become rows).
Matrix multiplication is used across numerous fields:
3D transformations (rotation, scaling, translation) are represented as matrix operations. Games and animation rely heavily on matrix multiplication.
Neural networks use matrix multiplication for both forward and backward propagation. Weight matrices transform input data.
Matrix operations are used in encryption algorithms like Hill cipher. Secret keys are often represented as matrices.
Input-output models use matrices to analyze relationships between different sectors of an economy.
Adjacency matrices representing networks can be multiplied to find paths between nodes. PageRank algorithm uses matrix operations.
Quantum states and operators are represented as matrices. Their multiplication describes how systems evolve.
Stiffness matrices are used in finite element analysis to model how structures respond to forces.
Convolution operations in image filters (blurring, edge detection) are implemented as matrix multiplications.
💡 Remember: For matrix multiplication to work, the number of columns in Matrix A must equal the number of rows in Matrix B.
This matrix multiplier calculator follows the standard rules for multiplying matrices. If you need to calculate a matrix product for matrices of different sizes, make sure they are compatible for multiplication.
You can input:
⌨️ Pro Tip: You can use the Tab key to quickly navigate between matrix cells when entering values.
Need random values? Click the "Random Values" button to populate both matrices with random numbers between 1 and 10.
After entering your matrices:
🔄 Want to start over? Click the "Clear" button to reset all matrix values.
Matrix multiplication requires that the number of columns in the first matrix equals the number of rows in the second matrix. This is because each element in the result is calculated by taking the dot product of a row from the first matrix and a column from the second matrix, which requires them to be the same length.
Matrix multiplication follows specific rules as explained in this calculator, resulting in a matrix where each element is the sum of products of corresponding row and column elements.
Element-wise multiplication (sometimes called the Hadamard product) simply multiplies corresponding elements directly. For element-wise multiplication, both matrices must be the same size, and the result will also be that size.
Element-wise multiplication example:
1 | 2 |
3 | 4 |
5 | 6 |
7 | 8 |
5 | 12 |
21 | 32 |
Unlike regular number multiplication where a×b = b×a, matrix multiplication is not commutative because the operation depends on the specific arrangement of elements in the matrices. The dimensions and internal structure of matrices make A×B and B×A different operations that generally yield different results.
In some special cases (like when multiplying by an identity matrix), matrix multiplication can be commutative, but this is the exception rather than the rule.
The standard algorithm for multiplying an m×n matrix by an n×p matrix has a time complexity of O(m×n×p). For square matrices of size n×n, this becomes O(n³).
However, there are more efficient algorithms for large matrices:
For practical purposes with small to medium-sized matrices (like those in this calculator), the standard algorithm is usually sufficient.
While this calculator specifically focuses on matrix multiplication, solving systems of linear equations typically involves multiple matrix operations including:
For a full solution to systems of linear equations, you would need additional operations like matrix inversion or Gaussian elimination.