Matrix addition calculator

Type two matrices of the same size, one row per line with the numbers separated by spaces, and get their sum.

One row per line, numbers separated by spaces. Fractions such as 1/2 are allowed.

Fill in the fields; the answer appears here straight away.

How it works

  1. Enter the values

    Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.

  2. Instant answer

    The answer appears as you type, with the most important intermediate values.

  3. See the working

    Under "How it's worked out" you see the steps, handy for checking your own calculation.

How matrices are added

Add the numbers in the same position: the top-left of A plus the top-left of B, and so on. That only works when both matrices have the same number of rows and columns; otherwise you get a message saying which sizes you entered.

For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], A + B = [[6, 8], [10, 12]].

Fractions such as 1/2 are allowed and the result is exact. To subtract, use the matrix subtraction calculator.

A 2 × 3 example

A B A + B
1 0 2 2 5 −2 3 5 0
3 −1 4 0 1 1 3 0 5

Each entry is the sum of the two numbers in the same position: 1 + 2 = 3, 0 + 5 = 5, 2 − 2 = 0, and so on.

Where matrices are added

Spreadsheets and data tables are matrices: adding monthly sales per product and region across two quarters is a matrix addition. In graphics, adding two images of the same size adds their pixel values. In physics, the sum of two transformations that act on the same space is added the same way. For the opposite operation, see matrix subtraction.

Other operations

This tool adds. Properties of one matrix, such as the determinant or the inverse, have their own calculators: determinant and inverse.

Frequently asked questions

Can I add matrices of different sizes?

No. Both matrices need the same number of rows and columns. If the sizes differ, the calculator tells you which sizes you entered.

Is A + B the same as B + A?

Yes. Matrix addition is commutative and associative, because it adds numbers position by position, just as ordinary addition does.

How do I enter a matrix?

One row per line, with the numbers separated by spaces, for example `1 2` on the first line and `3 4` on the second. Fractions such as 1/2 and negative numbers work.

What is the zero matrix?

The matrix with only zeros. Adding it changes nothing: A + 0 = A. It plays the role of the number 0.