Matrix Addition and Subtraction Calculator

Enter two matrices of the same size and choose Add or Subtract — the Matrix Addition and Subtraction Calculator computes the resulting matrix element by element. Set the number of rows and columns (up to 4×4), fill in your values for Matrix A and Matrix B, and get the complete result matrix with a full breakdown of each element calculation.

Results

Result Matrix (A OP B)

--

Matrix Dimensions

--

Result[1][1]

--

Result[1][2]

--

Result[1][3]

--

Result[1][4]

--

Result[2][1]

--

Result[2][2]

--

Result[2][3]

--

Result[2][4]

--

Result[3][1]

--

Result[3][2]

--

Result[3][3]

--

Result[3][4]

--

Result[4][1]

--

Result[4][2]

--

Result[4][3]

--

Result[4][4]

--

Result Matrix Element Values

Results Table

Frequently Asked Questions

What is a matrix?

A matrix is a rectangular array of numbers arranged in rows and columns. The size of a matrix is described by its dimensions — for example, a 3×2 matrix has 3 rows and 2 columns. Matrices are widely used in mathematics, physics, computer graphics, and data science.

How do you add two matrices?

To add two matrices, they must have the same number of rows and columns. You simply add the corresponding elements together — the element in row i, column j of Matrix A is added to the element in row i, column j of Matrix B. The result is a new matrix of the same dimensions.

How do you subtract two matrices?

Matrix subtraction works exactly like addition, but you subtract corresponding elements instead. Subtract the element at position [i][j] in Matrix B from the element at position [i][j] in Matrix A. The matrices must have identical dimensions for the operation to be valid.

Can you add or subtract matrices of different sizes?

No. Matrix addition and subtraction are only defined for matrices that have exactly the same number of rows and the same number of columns. If the dimensions don't match, the operation is undefined. This calculator requires you to set matching row and column counts for both matrices.

Is matrix addition commutative?

Yes, matrix addition is commutative, meaning A + B = B + A. It is also associative: (A + B) + C = A + (B + C). However, subtraction is not commutative — A − B is generally not equal to B − A.

What is the difference between matrix addition and matrix multiplication?

Matrix addition combines two matrices of the same size by summing corresponding elements, producing a result of the same dimensions. Matrix multiplication is a more complex operation where the number of columns in the first matrix must equal the number of rows in the second, and the result can have different dimensions than either input.

What are matrices used for in real life?

Matrices are used extensively in computer graphics (transformations, rotations), physics (quantum mechanics, relativity), machine learning (representing datasets and weights), economics (input-output models), and engineering (solving systems of linear equations). Matrix addition specifically arises when combining data sets or superimposing transformations.

Can this calculator handle negative numbers in matrices?

Yes. You can enter any positive or negative real number into any cell of Matrix A or Matrix B. The calculator will correctly add or subtract them element by element, including cases where the result is negative or zero.

More Math Tools