MatrixStep

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.

Matrix subtraction

Only matrices of the same size can be subtracted. A − B is the same as A + (−1)B.

Full explanation with examples: Matrix Addition, Subtraction and Scalar Multiplication: Rules and Examples

Exam tipA − B ≠ B − A, so keep the order straight.

How to do it by hand

  1. Check that both matrices have the same size.
  2. Subtract matching entries. A − B takes each entry of B away from the entry of A; reversing the order flips every sign.
  3. 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

  1. Set the matrix size with the row and column buttons. Up to 6×6 is supported.
  2. Type numbers into the cells and the result updates instantly. Enter fractions as 1/3 and negatives as -2.
  3. Enter moves to the next cell; the ← → ↑ ↓ arrow keys move between cells.
  4. 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