Skip to content
MasterMath

Matrix Calculator

Add or subtract two matrices cell by cell. Both have to be exactly the same size, which is the only requirement.

Result

—

Result—
Dimensions—
Trace of the result—
Determinant of the result—

The resulting matrix

RowValues

How this was worked out

    The formula

    (A ± B)ᵢⱼ = Aᵢⱼ ± Bᵢⱼ

    What it means

    Matrix addition works position by position: the element in row 2, column 3 of the result is the sum of the elements in row 2, column 3 of each matrix. Nothing mixes, which is why both matrices must have identical dimensions.

    How to do it by hand

    1. Check both matrices have the same number of rows and columns
    2. Add or subtract each pair of elements in matching positions
    3. The result has the same size as the originals
    4. For subtraction, order matters: A − B is not B − A

    What is worth knowing

    Addition is the well-behaved matrix operation: it is commutative, associative, and has a neutral element in the zero matrix. Multiplication is none of those things, which is what makes linear algebra interesting and difficult. The trace, the sum of the diagonal, adds like the matrices do — the trace of a sum is the sum of the traces. The determinant does not: det(A + B) has no relation to det(A) + det(B), and expecting it to is one of the commonest early mistakes.

    Frequently asked questions

    Can I add matrices of different sizes?

    No. Every element needs a counterpart in the same position, so the dimensions must match exactly.

    Is matrix addition commutative?

    Yes, A + B equals B + A. Multiplication is the operation that is not.

    What is the trace?

    The sum of the elements on the main diagonal. It only exists for square matrices.

    Does the determinant of a sum equal the sum of determinants?

    No, and there is no simple relationship at all. It is a common early assumption and it is wrong.