Math
Matrix Addition and Subtraction Calculator
Enter two matrices of the same shape and choose add or subtract.
The calculator checks the sizes match, combines the matrices entry by entry with exact fractions, lists every a_ij + b_ij (or a_ij - b_ij) step, and shows A - B next to A + B so you can see both at once.
One row per line. Separate entries with spaces or commas. Integers, decimals, and fractions like 1/3 all work. Up to 8 x 8.
One row per line. Separate entries with spaces or commas. Integers, decimals, and fractions like 1/3 all work. Up to 8 x 8.
Try an example
Result
Result
—
- Size
- —
- Operation
- —
- Other operation
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
How matrix addition and subtraction work
Two A rectangular grid of numbers arranged in rows and columns. are added or subtracted by combining the entries in matching positions. That is only possible when the matrices have the same number of rows and the same number of columns; a 2 x 3 matrix cannot be added to a 3 x 2 matrix.
Rules you can rely on
| Property | Statement |
|---|---|
| Commutative | A + B = B + A |
| Associative | (A + B) + C = A + (B + C) |
| Zero matrix | A + 0 = A |
| Additive inverse | A + (-A) = 0, and A - B = A + (-B) |
| Subtraction order | B - A = -(A - B) |
How to use it
- Pick A + B or A - B.
- Type both matrices with one row per line; they must have the same shape.
- Read the result matrix, then open Show the work to see each entry combined.
How to read the answer
- The result has the same size as the inputs.
- A zero result for A - B means the two matrices are identical.
- Fractions in the inputs stay exact in the result; a decimal view appears when needed.
Common mistakes
- Adding matrices of different sizes. Unlike multiplication, there is no rule that makes this work.
- Adding a number to a matrix. A + 3 is not defined; you would need 3I or a matrix of all 3s.
- Reversing the order in subtraction. A - B and B - A have opposite signs.
How to type a matrix into this calculator
- Put each row on its own line. Separate the entries in a row with spaces or commas: 2 1 1 or 2, 1, 1.
- Fractions such as 1/3 and decimals such as 0.25 are accepted and kept exact, so 1/3 stays 1/3 instead of becoming 0.3333.
- Every row must have the same number of entries. A row with a missing entry produces a clear error instead of a wrong answer.
- The largest size supported is 8 x 8. Brackets and semicolons are ignored, so [1 2; 3 4] works too.
Worked examples
Add two 2 x 3 matrices
[1 2 3; 4 5 6] + [6 5 4; 3 2 1]
Result
[7, 7, 7; 7, 7, 7]
Subtract
[5 -2; 0 3] - [1 4; -2 3]
Result
[4, -6; 2, 0]
Fractions
[1/2 1/3] + [1/4 2/3]
Result
[3/4, 1]
Subtracting a matrix from itself
Gives the zero matrix
Result
[0, 0; 0, 0]
Decimals
[0.5 1.25] - [0.25 0.75]
Result
[1/4, 1/2]
Size mismatch
A 2 x 2 plus a 2 x 3 is undefined
Result
Error
Frequently asked questions
Can you add matrices of different sizes?+
No. Addition pairs entries in the same position, so both matrices must have identical dimensions. The calculator reports the mismatch instead of guessing.
Is matrix addition commutative?+
Yes. A + B = B + A because ordinary addition of each pair of entries is commutative. Subtraction is not: B - A = -(A - B).
How do I subtract matrices?+
Subtract the entry of B from the entry of A in each position: c_ij = a_ij - b_ij. Equivalently, add A and -B.
Can I add a scalar to a matrix?+
Not directly. A + 3 is undefined in standard linear algebra. Add 3 times the identity matrix (3I) or a matrix filled with 3s, depending on what you mean.
Does matrix addition work with fractions and decimals?+
Yes. This calculator keeps them exact, so 1/3 + 1/6 gives 1/2 rather than 0.4999.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Matrix Multiplication Calculator
Multiply two matrices up to 8 x 8 with exact fractions. Checks that the dimensions line up, shows the dot product for every entry of the product, compares AB with BA, and explains why order matters.
Scalar Matrix Multiplication Calculator
Multiply a matrix up to 8 x 8 by a scalar (integer, decimal, or fraction) with every entry shown. Explains why det(kA) = kⁿ·det(A) and how scalar multiplication differs from matrix multiplication.
Matrix Transpose Calculator
Transpose any matrix up to 8 x 8 and check whether it is symmetric, skew-symmetric, or orthogonal. Shows AᵀA and AAᵀ, the row-to-column steps, and the transpose rules for products, determinants, and traces.
Matrix Trace Calculator
Find the trace of a square matrix up to 8 x 8 (the sum of its diagonal entries) with exact fractions. Shows the running sum, the eigenvalue check trace = λ1 + … + λn, the determinant, tr(A²), and the trace properties.
Fraction Calculator
Add, subtract, multiply, divide, simplify, compare, or convert decimals to fractions with steps and visual fraction bars.
Eigenvalues and Eigenvectors Calculator
Find the eigenvalues and eigenvectors of a square matrix up to 8 x 8. Shows the characteristic polynomial, exact eigenvalues (including fractions, square roots, and complex pairs), eigenvector bases, multiplicities, and whether the matrix is diagonalizable.
Last updated: September 4, 2026