Matrix Multiplication Calculator
This matrix multiplication calculator multiplies two matrices and shows every entry as the row and column that produced it — and, when both orders exist, it works out B × A as well.
Take A = 1 2 / 3 4 and B = 5 6 / 7 8. The top-left entry of the answer is the first row of A against the first column of B: (1)(5) + (2)(7) = 19. Carry on through the other three and A × B is 19 22 / 43 50. Now swap them: B × A is 23 34 / 31 46. Same two matrices, same method, different answer — and that is the part worth understanding.
How to Multiply Two Matrices
One entry at a time, and each entry is a row meeting a column. Line the row up against the column, multiply the first with the first, the second with the second, and so on, then add everything you get. The number you are left with sits where that row and that column cross.
The one thing beginners try instead is multiplying the entries in matching positions, the way addition works. That is not this operation. If it were, the whole subject would be duller and far less useful, which brings us to why it is defined so awkwardly in the first place.
A matrix stands for a transformation — a rotation, a stretch, a shear — and multiplying two of them means doing one transformation and then the other. The row-against-column rule is exactly what that composition works out to. Once you know that, the awkward definition stops being arbitrary, and the next section stops being surprising.
Why A × B and B × A Are Different
Rotate a page and then stretch it sideways, and you do not end up where you would by stretching first and rotating after. Order matters for transformations, so it matters for matrices.
The two answers above make the point in numbers: 19 22 / 43 50 against 23 34 / 31 46, from the same pair. And the difference can be sharper than that. Multiply a 2×3 by a 3×2 and you get a 2×2; turn them round and you get a 3×3. Two answers of different sizes cannot possibly be equal, and no amount of arithmetic will make them agree.
Sometimes one order simply does not exist. A 3×2 and a 1×3 cannot be multiplied in that order at all, but the other way round is fine and gives a 1×2. Most calculators would show you an error and stop there. This one tells you which order works and hands you that answer.
When the Product Does Not Exist
Write the two sizes next to each other, m×n and n×p. Only the two inner numbers matter: they must be equal. If they are, the two outer numbers give the size of the answer, m×p.
The reason is not a rule to memorise, it is the method itself. A row of the first matrix has to pair off term by term with a column of the second. If the row holds three numbers and the column holds two, the third number has nothing to pair with, and there is no honest answer to give.
This calculator lets you set both sizes independently, which is deliberate. Most tools quietly force the second matrix to fit the first, so you never see a product fail — and failing is half of what the topic is about. Here, when it fails, you are told exactly which two numbers clashed and whether the other order still works.
Multiplying Bigger Matrices
Nothing changes as the matrices grow except how many entries you have to fill in. A 2×3 multiplied by a 3×2 gives four entries, each one a sum of three products. With A = 1 2 3 / −4 3 7 and B = 4 3 / −1 2 / 0 5, the answer is 2 22 / −19 29, and the top-left of it is (1)(4) + (2)(−1) + (3)(0) = 2.
Fractions are where hand calculation goes wrong and where rounding quietly ruins an answer. Multiplying 1/2 1/3 / 1/4 1/5 by 2 3 / 6 5 gives 3 19/6 / 17/10 7/4. Those are the exact entries. A calculator that hands you 3.17 instead of 19/6 has already lost information you may need in the next step.
How to Use This Matrix Multiplication Calculator
There are three parts to the screen: the blue answer band at the top, the two matrices you fill in below it, and the keypad under those. Nothing is typed into a formula bar — you fill cells, the way you would write the matrices out on paper.
1. Set the shape of each matrix. Above each grid there are two little rows of number buttons, one for rows and one for columns, from 1 to 3. Press them and the grid changes shape under you, keeping whatever you have already typed. The two matrices are set independently on purpose, so you are free to build a pair that cannot be multiplied and find out why.
2. Fill in the cells. Tap any cell to select it — it takes a blue outline — then use the keypad. A cell will take a whole number, a decimal such as 0.25, or a fraction such as 3/4, and anything you leave blank counts as zero, so you only have to type the numbers that are actually there.
3. Press =. The product appears in the band at the top, inside its brackets, with a sentence underneath telling you both sizes and the size of the answer.
4. Open the working. The button marked Show every entry worked out opens one line per entry: the row lit up in the first matrix, the column lit up in the second, and the sum of products written out in full. Below the band, the step-by-step panel walks through the same thing in words, including both dimension tests and the other order.
Every key and control, in one place:
| rows / columns | Sets the shape of that matrix, 1 to 3, each one on its own |
| the cells | Tap to select; blank counts as zero; fractions and decimals both accepted |
| ← → | Move to the previous or next cell — they walk across both matrices, so you can fill everything without lifting your thumb |
| A B | Jump straight to the first cell of that matrix |
| ± | Flips the sign of the cell you are in, so a minus can never be typed twice by accident |
| ⁄ | The fraction bar. 3⁄4 stays a fraction all the way to the answer |
| . | Decimal point. 0.25 is read as one quarter, exactly |
| ⌫ | Deletes one character from the cell you are in |
| AC | Clears both matrices and starts again |
| = | Multiplies |
| My keyboard | Switches that cell to your own keyboard, for anything the pad does not carry |
| copy | The icon in the band copies the answer, both orders when both exist |
Two things happen that other calculators do not do, and they are worth knowing before you need them. If A × B cannot be formed, you are not simply refused: you are told which two numbers clashed, and if B × A works instead, that answer is given to you. And whenever both orders exist, the second one is worked out underneath and compared with the first, so you can see for yourself whether they agree.
The band dims and asks you to press = again if you change anything after an answer is showing, so what you are looking at always belongs to what is in the cells. Everything stays in exact fractions, and there are no limits, no ads and no account.
Matrix Multiplication FAQ
How do you multiply two matrices?
When can two matrices not be multiplied?
Is matrix multiplication commutative?
What size is the answer?
Can you multiply a single row by a single column?
What happens when you multiply by the identity matrix?
Inner numbers must match, outer numbers give the size, and each entry is one row meeting one column. Get those three straight and the only thing left to be careful about is the order — which is the whole reason this calculator shows you both.