Matrix Addition and Subtraction Calculator
This matrix addition and subtraction calculator adds or subtracts two matrices with every cell worked out, takes combinations such as 2A − 3B, and shows both orders side by side. Everything stays in exact fractions.
The simplest case first. For 1 2 / 3 4 and 5 6 / 7 8, add the entries that sit in the same place: 1 + 5 = 6, 2 + 6 = 8, 3 + 7 = 10, 4 + 8 = 12. The sum is 6 8 / 10 12, the same size as the two you started with. Subtract instead and you get −4 −4 / −4 −4 — and turning the two round gives 4 4 / 4 4, which is the part worth being careful about.
How to Add Two Matrices
Entry by entry, and nothing else. Corresponding entries — the ones in the same row and the same column — are added, and the result keeps the same dimensions. There is no clever rule to remember here, which is exactly why the topic is usually taught first.
Addition of matrices is commutative: A + B and B + A always agree, because underneath each cell you are only adding two ordinary numbers, and 3 + 5 is 5 + 3. It is also associative, so (A + B) + C and A + (B + C) come to the same thing and brackets never matter. Neither is true of matrix multiplication, where the order changes everything — which makes these two operations a useful pair to learn together.
How to Subtract Two Matrices
The same move with the second sign turned over: every entry of the second grid is taken away from the entry in the same place in the first. And here the order does matter, in a very particular way.
B − A is A − B with every sign reversed. Our example gave −4 −4 / −4 −4 one way round and 4 4 / 4 4 the other. They are never the same matrix unless every entry comes out zero, which happens only when the two grids were identical to begin with — and A − A is the zero matrix, the grid of zeros that behaves for matrices the way 0 behaves for numbers.
That zero matrix is also why −A is called the additive inverse of A: the two add to nothing. It is worth keeping that separate from the inverse used in multiplication, which is a different idea entirely and lives on the inverse matrix calculator. Students mix the two up constantly, and the names are the only reason.
The commonest mistake in subtraction is simpler than any of that: turning the sign over on most of the entries and missing one. This calculator prints each cell as its own line for exactly that reason, so a slip has nowhere to hide.
When the Sizes Do Not Match
Both matrices must have the same number of rows and the same number of columns. Not similar, not compatible — identical. Each entry is joined to the entry in the same position, so if there is no entry in that position there is nothing to join it to.
This is a stricter rule than the one for multiplying, and it has no escape hatch. When you multiply, a pair that fails one way round sometimes works the other; here a 2×3 and a 3×2 fail in both directions and that is the end of it. When the sizes clash, this calculator tells you which dimension caused it — rows, columns or both — rather than simply refusing.
Scalar Multiplication and Combinations Like 2A − 3B
A single number in front of a matrix is a scalar, and it multiplies every entry. Applying it to the first row and forgetting the rest is one of the two errors examiners see most often in this topic.
Take A = 1 2 3 / 4 5 6 and B = 6 5 4 / 3 2 1. First multiply through: 2A is 2 4 6 / 8 10 12 and 3B is 18 15 12 / 9 6 3. Now subtract entry by entry, and 2A − 3B comes to −16 −11 −6 / −1 4 9. Multiplying first and joining second is the whole discipline; doing it the other way round is where answers go astray.
An expression like this is called a linear combination of the two matrices, and the boxes in front of each grid on this page exist so you can type one directly. Scalars behave predictably: k(A + B) is always kA + kB. They also reach further than they look — multiplying a whole n×n matrix by k multiplies its determinant by kn, not by k, which surprises most people the first time.
How to Use This Matrix Addition and Subtraction Calculator
The screen has three parts: the answer band at the top, the two matrices below it with a small box in front of each, and the keypad underneath.
1. Set the two sizes. Each matrix has its own row and column buttons, from 1 to 4. They are separate on purpose — set them differently and the calculator explains which dimension clashed instead of quietly preventing it.
2. Fill in the cells. Tap a cell to select it, then use the keypad. A cell takes a whole number, a decimal such as 0.25, or a fraction such as 3/4, and anything left blank counts as zero.
3. Choose + or − with the two buttons between the grids, and put numbers in the boxes in front if you want something like 2A − 3B. Leave those boxes empty for a plain sum or difference.
4. Press =, then open Show every cell worked out. You get the scaled grids first if you used a scalar, then one line per cell with the two entries lit up in both matrices, and finally the same pair the other way round so you can see for yourself whether the order mattered.
Every key and control, in one place:
| rows / columns | Sets the size of that matrix, 1 to 4, each one on its own |
| the box in front | The scalar for that matrix. Leave it empty and it counts as 1 |
| + − | Chooses addition or subtraction; the answer updates straight away |
| 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 and through the scalar boxes |
| A B | Jump straight to the box in front of that matrix |
| ± | Flips the sign of the cell you are in, so a minus cannot 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 both boxes |
| = | Works it out |
| 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, row by row |
Change anything after an answer is showing and the band dims and asks you to press = again, so what you are reading always belongs to what is in the cells. There are no limits, no ads and no account.
Matrix Addition and Subtraction FAQ
How do you add two matrices?
Can you add matrices of different sizes?
Is matrix addition commutative?
What is scalar multiplication of a matrix?
What is the zero matrix?
How do you work out something like 2A - 3B?
Same size or nothing, entry against entry, and the scalar on every entry rather than some. Get those three right and the only thing left to watch is which way round you wrote the subtraction.