Matrix Subtraction Calculator
Subtracts the corresponding entries of two matrices of the same size.
INPUT
Integers, fractions (1/3) and decimals (0.25) are accepted. Empty cells count as 0. Paste a block of numbers from a spreadsheet or textbook into the first cell to fill the whole matrix.
RESULT
LaTeX is the math code you can paste into Overleaf, Notion equation blocks or Word's equation editor.
Steps
Matrix subtraction
Only matrices of the same size can be subtracted. A − B is the same as A + (−1)B.
Exam tipA − B ≠ B − A, so keep the order straight.
How to do it by hand
- Check that both matrices have the same size.
- Subtract matching entries. A − B takes each entry of B away from the entry of A; reversing the order flips every sign.
- You can think of A − B as A + (−1)·B, which reduces it to addition and scalar multiplication.
Worked example
With A = [5 2; 1 0] and B = [2 3; 4 −1],
A − B = [5−2 2−3; 1−4 0−(−1)] = [3 −1; −3 1]
B − A = [−3 1; 3 −1], every sign reversed.
Where is it used?
- Measuring change: this month's inventory table minus last month's gives the change table.
- Building an error matrix: predicted values minus actual values shows where and how much a model is off.
- Forming A − λI when finding eigenvalues is a matrix subtraction.
Common mistakes
- Computing 0 − (−1) as −1. Subtracting a negative means adding.
- Mixing up A − B and B − A. Subtraction does not commute.
- Subtracting matrices of different sizes. Like addition, the sizes must match.
How to use
- Set the matrix size with the row and column buttons. Up to 6×6 is supported.
- Type numbers into the cells and the result updates instantly. Enter fractions as
1/3and negatives as-2. - Enter moves to the next cell; the ← → ↑ ↓ arrow keys move between cells.
- Open ‘Steps’ to see the full working. ‘Copy LaTeX’ copies the result as math code you can paste into Overleaf, a Notion equation block or Word's equation editor.
FAQ
- How do I enter negative numbers?
- Put a minus sign in front: -3, -1/2.
Related guides
- Matrix Addition, Subtraction and Scalar Multiplication: Rules and ExamplesThe size condition, entry-by-entry computation, scalar multiplication and mixed expressions, with examples.
- Matrix Multiplication: Rules, Worked Examples and Why AB ≠ BAThe size condition, how to compute each entry, and why AB and BA differ, with worked examples.