Free · Matrices

Matrix Addition and Subtraction by Matching Entries

Add or subtract matching entries of two matrices with one to four rows and columns, preserving each selectable shape.

  • Formula & worked example
  • Private in your browser
  • No signup
Go to tool

Calculator inputs

Loading calculator…

How to use this calculator

  1. Enter the known values in the units shown. Results update as you type.
  2. Where results are editable, change one to solve backwards. Lock a value to hold it fixed.
  3. Use the worked example to check the method. Reset restores the starting fields.

Private by default

Inputs and results stay in this browser tab. Bookify does not upload or store the values you enter.

Formula and method

Adding [[1,2],[3,4]] to [[5,6],[7,8]] gives [[6,8],[10,12]].

Cij=Aij+Bij, or Cij=Aij−Bij.

Worked example

Enter these known values and leave the other values blank.

Operation
Addition ➕
Number of rows
2
Number of columns
2
First matrix · row 1, column 1
1
First matrix · row 1, column 2
2
First matrix · row 2, column 1
3
First matrix · row 2, column 2
4
Second matrix · row 1, column 1
5
Second matrix · row 1, column 2
6
Second matrix · row 2, column 1
7
Second matrix · row 2, column 2
8
Result · row 1, column 1
6
Result · row 1, column 2
8
Result · row 2, column 1
10
Result · row 2, column 2
12

Assumptions and limitations

  • Both matrices use the same selected row/column count. Every1×1 through4×4 shape remains selectable; matrix multiplication is a different operation.
  • Add or subtract corresponding entries. Subtraction is first matrix minus second matrix, so reversing the operands reverses every result sign.
  • Different column-count panels retain their entered values when switched. Only the active shape is displayed; clearing an operand leaves its corresponding result blank rather than treating it as zero.
  • Captured result cells remain forward outputs; the hidden encoded size variable is retained for source layout compatibility.
  • Very small nonzero values may appear in scientific notation when fixed decimal display cannot represent them. Their value is preserved rather than shown as zero.
  • Select addition or subtraction explicitly. Clearing that choice clears the cell results; an empty choice never defaults silently to subtraction.

Common questions

Can matrices of different sizes be added?

Not by ordinary matrix addition: each entry needs a partner at the same row and column. Select the common shape for both matrices.

Can entries be negative or fractional?

Yes. Each pair uses ordinary signed real addition or subtraction, including zero and decimal entries.

References

Translate the hash-pinned captured helper into equivalent declarative arithmetic without executing browser JavaScript. Retain both elementwise operations, all sixteen row/column shapes, all forty captured output cells and their source visibility; subtraction preserves operand order. Require an explicit addition or subtraction choice; clearing the operation must clear every dependent result instead of selecting subtraction implicitly. When ordinary fixed-decimal rounding cannot show a finite nonzero value, preserve that value in scientific notation. This fallback is bound to the complete reviewed source and compiled schemas; ordinary rounding and equations stay unchanged. Repair thirteen captured operand fields that lack the second-row visibility condition, so each selected shape displays exactly its declared rows in both matrices.

Explore matrices or browse all math calculators.