Matrix Addition and Subtraction Calculator

Add or subtract two matrices of the same size entry by entry, with the result matrix and the first entry worked out. Matrices are added or subtracted entry by entry: (A ± B)ᵢⱼ = aᵢⱼ ± bᵢⱼ. Example: with matrix a 1 2 / 3 4, …, the result is A + B = [ 6 8 ] [ 10 12 ].

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

How do you use the Matrix Addition and Subtraction Calculator?

Enter two matrices of identical size, choose addition or subtraction and read the result. The calculator checks the dimensions, combines matching entries and displays the sum or difference as a matrix.

What formula does the Matrix Addition and Subtraction Calculator use?

Matrices are added or subtracted entry by entry: (A ± B)ᵢⱼ = aᵢⱼ ± bᵢⱼ. Both matrices must have the same number of rows and columns. Addition is commutative and associative, and the zero matrix is the additive identity.

Worked example: Matrix A 1 2 / 3 4, Matrix B 5 6 / 7 8, Operation Add A + B

For A = [1 2; 3 4] and B = [5 6; 7 8], the sum is [6 8; 10 12] and the difference A − B is [−4 −4; −4 −4].

With the default values the calculator returns A + B = [ 6 8 ] [ 10 12 ]; Size = 2 × 2.

Where Is This Calculation Used?

Matrix addition combines data tables, superimposes transformations’ effects (such as adding displacement fields) and appears in the algebra of linear maps. Subtraction measures the difference between two data sets, such as an image and its previous frame.

A matrix works well as a table of data. Monthly sales of three products in four stores fit one 3 × 4 matrix, and adding the matrix for next month gives running totals in one step. The zero matrix leaves any matrix unchanged, and scalar multiplication distributes over addition: k(A + B) = kA + kB. If the sizes differ the sum is not defined, so reshape or pad the data first.

What are the most common mistakes with the Matrix Addition and Subtraction Calculator?

  • Adding matrices of different sizes.
  • Adding row-wise totals instead of matching entries.
  • Subtracting in the wrong order: A − B ≠ B − A.

What Is the Tested Example for the Default Values?

This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.

Input: Matrix A1 2 / 3 4
Input: Matrix B5 6 / 7 8
Input: OperationAdd A + B
A + B[ 6 8 ] [ 10 12 ]
Size2 × 2

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

How do you add two matrices?

Add the entries in matching positions.

Can I add a 2 × 2 and a 2 × 3 matrix?

No. The dimensions must match exactly.

Is matrix subtraction commutative?

No. A − B is the negative of B − A.