Skip to content
Calculator Tools
Matrix Calculators

Matrix Subtraction Calculator

Subtract one matrix from another element by element (A − B) for matrices of equal size.

Enter values

Results update as you type.

Result

A − B

[ -1 2 2 ] [ -1 -2 2 ] [ 4 5 -1 ]

About the Matrix Subtraction Calculator

Subtract one matrix from another element by element (A − B) for matrices of equal size.

Also known as: subtract matrices, matrix difference.

How to use this calculator

  1. Enter matrix a (rows on new lines), matrix b.
  2. The result updates instantly as you type — press Calculate (or Enter) at any time.
  3. Review the breakdown shown under the main result.
  4. Use Copy result or Share to save the answer or send a link with your inputs.

Formula

(A − B)ᵢⱼ = Aᵢⱼ − Bᵢⱼ

Worked example

Using the values pre-filled in the calculator above:

  • Matrix A (rows on new lines): 1 2 3 0 1 4 5 6 0
  • Matrix B: 2 0 1 1 3 2 1 1 1

the calculator returns:

  • A − B: [ -1 2 2 ] [ -1 -2 2 ] [ 4 5 -1 ]

Frequently asked questions

How do I enter a matrix?

Type one row per line, separating values with spaces or commas. You can also separate rows with semicolons: 1 2; 3 4.