Matrix Subtraction Calculator

Published on: September 14 2025

This Matrix Subtraction Calculator helps you subtract one matrix from another and shows each step clearly. It works by subtracting the corresponding entries of two matrices with the same dimensions to form a new matrix. This makes it useful for checking answers, understanding how matrix subtraction works, and practising linear algebra step by step.

Step-by-step method

  1. Check that both matrices have the same number of rows and columns.
  2. Subtract each Matrix B entry from the Matrix A entry in the same position.
  3. Write each difference in the matching position of the result matrix.

Formula:

If A = [aij] and B = [bij], then A − B = [aij − bij].

Example 1: Take the matrices below.

12
-3
40
7
5
18
-9
2

Step 1 - Check that both matrices have the same number of rows and columns.

In this problem: Matrix A and Matrix B are both 2×2, so they can be subtracted.

12
-3
40
7
5
18
-9
2

Step 2 - Subtract each Matrix B entry from the Matrix A entry in the same position.

In this problem: Each Matrix B entry is subtracted from the Matrix A entry in the same row and column.

12 − 5
-3 − 18
40 − (-9)
7 − 2

Step 3 - Write each difference in the matching position of the result matrix.

In this problem: Each difference is placed back into the same position in the answer matrix.

12 − 5 = 7
-3 − 18 = -21
40 − (-9) = 49
7 − 2 = 5
=
7
-21
49
5

Final answer:

7
-21
49
5

Example 2: Take the matrices below.

1000
-2
33
4
15
6
7
8
9
1
2
30
4
5
6
-7
0
11

Step 1 - Check that both matrices have the same number of rows and columns.

In this problem: Matrix A and Matrix B are both 3×3, so they can be subtracted.

1000
-2
33
4
15
6
7
8
9
1
2
30
4
5
6
-7
0
11

Step 2 - Subtract each Matrix B entry from the Matrix A entry in the same position.

In this problem: Each Matrix B entry is subtracted from the Matrix A entry in the same row and column.

1000 − 1
-2 − 2
33 − 30
4 − 4
15 − 5
6 − 6
7 − (-7)
8 − 0
9 − 11

Step 3 - Write each difference in the matching position of the result matrix.

In this problem: Each difference is placed back into the same position in the answer matrix.

1000 − 1 = 999
-2 − 2 = -4
33 − 30 = 3
4 − 4 = 0
15 − 5 = 10
6 − 6 = 0
7 − (-7) = 14
8 − 0 = 8
9 − 11 = -2
=
999
-4
3
0
10
0
14
8
-2

Final answer:

999
-4
3
0
10
0
14
8
-2
Matrix A
Matrix B