Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Matrix Multiplication Calculator

Multiply two matrices and get the resulting matrix instantly. Works with common small sizes and helps verify hand calculations.

Enter the Details

First matrix size:

   

 

Second matrix size:

   

 

First matrix entries

Second matrix entries


Result will appear here...


Last updated: February 17, 2026

Created by: Eon Tools Dev Team

Reviewed by: Okan Atalay



What this calculator does

Multiplying two matrices is nothing like multiplying two numbers. It follows a particular row-by-column rule, and it is easy to slip up on by hand. This does it for you, for matrices up to 3 by 3.

Set the size of each matrix, enter the numbers, and it returns the product. It runs right here in the browser.

Using the calculator

  1. Set the rows and columns of the first matrix.
  2. Set the rows and columns of the second matrix.
  3. Enter the numbers in both, then press Calculate.

The input boxes appear to match the sizes you choose. Reset clears everything.

The rule that decides if you can multiply at all

Before anything else, there is a gate. To multiply matrix A by matrix B, the number of columns in A must equal the number of rows in B. If they do not match, the multiplication simply cannot be done. This trips up almost everyone at first.

When they do match, the result's size follows a tidy pattern: it has as many rows as A and as many columns as B. So a 2 by 3 matrix times a 3 by 4 matrix works, because the inner numbers (3 and 3) agree, and the answer is 2 by 4, taken from the outer numbers. The two inner numbers must meet in the middle; the two outer numbers give the shape of what comes out.

How it works: rows meet columns

Each number in the result comes from pairing a row of A with a column of B. You march along the row and down the column together, multiplying the matching entries and adding up the results. That single total becomes one entry of the answer, sitting where that row and that column cross.

If that pairing sounds familiar, it is exactly a dot product: the entry in row i, column j of the answer is the dot product of row i of A with column j of B. You just repeat it for every row-and-column pairing to fill in the whole result.

A worked example

Multiply [[1, 2], [3, 4]] by [[5, 6], [7, 8]]. Both are 2 by 2, so the answer is 2 by 2. Take each entry as a row-times-column total:

  • Top-left: row 1 of A, (1, 2), with column 1 of B, (5, 7): 1×5 + 2×7 = 5 + 14 = 19.
  • Top-right: row 1, (1, 2), with column 2, (6, 8): 1×6 + 2×8 = 6 + 16 = 22.
  • Bottom-left: row 2, (3, 4), with column 1, (5, 7): 3×5 + 4×7 = 15 + 28 = 43.
  • Bottom-right: row 2, (3, 4), with column 2, (6, 8): 3×6 + 4×8 = 18 + 32 = 50.

So the product is [[19, 22], [43, 50]].

Order matters

With ordinary numbers, 3 times 5 equals 5 times 3. With matrices, this fails. In general, A times B is not the same as B times A, and often only one of the two is even allowed by the size rule. So the order you multiply in is part of the problem, not a detail you can shuffle. Always keep A and B in the order the question gives them.

Why the rule is so strange

The row-by-column rule looks arbitrary until you know what matrices are often standing in for: transformations of space, like a rotation or a stretch. Multiplying two matrices is designed to represent doing one transformation and then the other, one after another. The strange-looking rule is precisely what makes that work out, so that the product matrix does the combined job of both. When Arthur Cayley defined matrix multiplication this way in the 1850s, it was not the obvious choice, but it was quickly seen to be the right one, because it made chaining transformations simple. And it is also why order matters: rotating and then stretching is not generally the same as stretching and then rotating.

Questions people ask

How do you multiply two matrices?

Each entry of the result is a row of the first matrix paired with a column of the second: multiply matching numbers and add. Repeat for every row and column pairing.

When can two matrices be multiplied?

When the number of columns in the first equals the number of rows in the second. The result then has the rows of the first and the columns of the second.

Does the order matter?

Yes. A times B is generally not equal to B times A, and sometimes only one order is even allowed. Keep the given order.

Why is matrix multiplication defined this way?

So that multiplying two matrices represents applying one transformation after another. The rule is what makes that combination come out correctly.

What size is the result?

It has as many rows as the first matrix and as many columns as the second. A 2 by 3 times a 3 by 4 gives a 2 by 4.

References

A note on where this comes from. Matrix multiplication was defined by Arthur Cayley in the 1850s so that the product of two matrices represents the composition of the linear transformations they describe, published in his 1858 A Memoir on the Theory of Matrices. For further reading, see Matrix multiplication.

  1. The matrix multiplication rule, in which each entry of the product is the dot product of a row of the first matrix with a column of the second.
  2. Arthur Cayley, who defined matrix multiplication to match the composition of linear transformations (1858).


Okan Atalay

Okan Atalay is a results driven senior operations manager and a graduate of Industrial Engineering from Bilkent University. With over 22 years of experience in textile manufacturing and integrated operations, he has led large scale business process improvements and strategic planning initiatives. Currently, he serves as a top mathematics expert for a global ed tech platform, where he applies his analytical expertise to solve complex mathematical problems. At Eon Tools, he reviews converter and maths tools.