A matrix multiplication calculator multiplies two square matrices using the row-by-column rule, where each entry is a row of the first matrix dotted with a column of the second. Enter both matrices row by row. Two 2x2 matrices give a 2x2 product.
Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.
Saved results (0)
How to Use the Matrix Multiplication Calculator
- Choose the matrix size, 2 by 2 or 3 by 3.
- Enter Matrix A row by row, separated by commas.
- Enter Matrix B the same way.
- Read the product, shown row by row, and its trace.
Here is what each result means:
| Result | What it means |
|---|---|
| Product A x B | The result matrix, written row by row. |
| Size | The dimensions of the product. |
| Trace | The sum of the diagonal entries. |
What Is Matrix Multiplication?
Matrix multiplication combines two matrices into a new one using the row-by-column rule. Each entry of the product is a row of the first matrix multiplied term by term with a column of the second, and those products added. So the entry in row i, column j comes from row i of A and column j of B.
Matrix multiplication is how linear transformations combine, so it powers computer graphics, rotations, systems of equations and machine learning. Unlike ordinary multiplication, it is not commutative: A times B is usually different from B times A, and the order matters.
How Does the Matrix Calculator Work?
It computes each entry of the product as the dot product of a row and a column.
- Take a row of A and a column of B.
- Multiply matching entries and add them for one product entry.
- Repeat for every row and column to fill the product matrix.
The determinant of the product equals the product of the determinants, which you can check with the determinant calculator.
Matrix Multiplication Example
Multiply the 2x2 matrices A with rows 1, 2 and 3, 4, and B with rows 5, 6 and 7, 8.
Calculation: the top-left entry is the first row of A dotted with the first column of B: 1 x 5 + 2 x 7 = 19. Continuing gives the product [19, 22 ; 43, 50]. The trace, 19 plus 50, is 69.
The Row-by-Column Rule
Each entry pairs one row of A with one column of B.
| Product entry | Comes from |
|---|---|
| Row 1, column 1 | Row 1 of A and column 1 of B |
| Row 1, column 2 | Row 1 of A and column 2 of B |
| Row 2, column 1 | Row 2 of A and column 1 of B |
For two matrices to multiply, the columns of the first must match the rows of the second. Here both are square and the same size, so they always fit.
Matrix Multiplication vs Addition
The two operations combine matrices in very different ways.
| Operation | How it works | Order matters? |
|---|---|---|
| Addition | Add matching entries | No |
| Multiplication | Row-by-column dot products | Yes |
Addition needs matrices of the same shape and is commutative. Multiplication combines rows and columns and is not, so A times B and B times A can differ.
What Affects the Product
The Order of the Matrices
Multiplication is not commutative, so swapping A and B usually changes the result.
The Identity Matrix
Multiplying by the identity, ones on the diagonal, leaves a matrix unchanged.
A Zero Row or Column
Zeros in A or B carry through, producing zero entries in the product.
When to Use a Matrix Multiplication Calculator
Linear Algebra Homework
Multiply matrices quickly and check each entry.
Transformations
Combine rotations, scalings or reflections by multiplying their matrices.
Systems and Models
Apply a matrix to data, as in graphics and machine learning.
Common Mistakes
1. Multiplying Entry by Entry
Matrix multiplication is not element-wise. Each entry is a row dotted with a column.
2. Assuming a B Equals B A
Order matters. The two products are usually different matrices.
3. Mismatched Sizes
The columns of the first must equal the rows of the second. Here both are the same square size.
4. Losing Track of Rows and Columns
Enter each matrix row by row, left to right, so the entries land in the right places.
5. Skipping a Term in the Sum
Each product entry adds one term per dimension. Missing one gives a wrong number.
Accuracy and Limitations
The multiplication is exact; only the displayed decimals are rounded.
What it calculates accurately
- The full product of two square matrices
- The trace of the result
- 2x2 and 3x3 sizes
What it does not do
- Multiply non-square or mismatched matrices
- Find an inverse or determinant directly
- Handle matrices larger than 3x3
- Work with complex entries
How We Multiply Your Matrices
Frequently Asked Questions
How do you multiply two matrices?
Use the row-by-column rule: each entry of the product is a row of the first matrix multiplied term by term with a column of the second, and the products added. This tool does that for every entry.
Is matrix multiplication commutative?
No. In general A times B is not the same as B times A, and often only one order is even defined. The order of the matrices matters.
What sizes can be multiplied?
The number of columns in the first matrix must equal the number of rows in the second. This tool handles two square matrices of the same size, 2x2 or 3x3, so they always fit.
What is the identity matrix?
It is a square matrix with ones on the diagonal and zeros elsewhere. Multiplying any matrix by the identity leaves it unchanged, like multiplying a number by 1.
What is the trace of a matrix?
The trace is the sum of the diagonal entries, from the top left to the bottom right. It is a quick summary value and appears in many linear-algebra results.
How is matrix multiplication used?
It combines linear transformations, so it drives computer graphics, rotations and scaling, solving systems of equations, and the layers of a neural network.
Why is the product not element-wise?
Element-wise multiplication is a different operation. Matrix multiplication mixes rows and columns so that it represents composing two transformations, which element-wise multiplication does not.
What does multiplying by a zero matrix give?
A matrix of all zeros. Every product entry sums terms that each include a zero, so the whole product is zero.
Is my information saved?
No. The calculation runs in your browser and nothing you enter is stored or sent anywhere, unless you choose Save, which keeps the result only on this device.
Sources
- Matrix multiplication (Wikipedia).
- How to multiply matrices (Maths Is Fun).
- Trace (linear algebra) (Wikipedia).
Related Calculators
Looking for more algebra tools?
Explore all math calculatorsThis calculator multiplies two square matrices of the same size, 2x2 or 3x3. Enter each matrix row by row. Matrix multiplication is not commutative, so A times B usually differs from B times A. Results are rounded for display. Spotted an error? Let us know.
Author
Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.




