Matrix Subtraction Calculator

Published on: September 14 2025

Set up two matrices (up to 5 × 5), fill their entries, and subtract B from A.

Step-by-step method

  1. Make sure both matrices have the same dimensions.
  2. Subtract corresponding entries (same position) to form the result matrix.

Formula:

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

Example 1: 2×2 matrices

Step 1 - Make sure both matrices have the same dimensions.

In this problem: Both matrices are 2×2, so they can be subtracted.

12
-3
40
7
5
18
-9
2

Step 2 - Subtract corresponding entries (same position) to form the result matrix.

In this problem: Subtract entries in the same position to form the result matrix.

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

Final answer:

7
-21
49
5

Example 2: 3×3 matrices

Step 1 - Make sure both matrices have the same dimensions.

In this problem: Both matrices are 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 corresponding entries (same position) to form the result matrix.

In this problem: Subtract entries in the same position to form the result matrix.

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

Final answer:

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