Advanced maths

Matrix addition and subtraction calculator

Combine matching matrix entries and see the exact sum or difference.

Your numbers

One row per line or semicolon; separate entries with spaces or commas. Up to 6 rows and 6 columns. Use integers, decimals (up to 6 places) or fractions such as -2/3.
One row per line or semicolon; separate entries with spaces or commas. Up to 6 rows and 6 columns. Use integers, decimals (up to 6 places) or fractions such as -2/3.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Behind the numbers

How this calculation works

Each entry is paired with the number in the same row and column of the other matrix. Both matrices must have the same dimensions. The tool preserves rational arithmetic and shows the first pair as a worked step.

THE FORMULACᵢⱼ = Aᵢⱼ + Bᵢⱼ, or Aᵢⱼ − Bᵢⱼ

A worked example

Adding A = [1 2; 3 4] and B = [5 6; 7 8] gives [6 8; 10 12]. Both inputs and the result are 2 × 2.

Good to know

For small matrices of exact rational numbers, up to 6 rows and 6 columns. Entries are limited to ±1,000,000; integer fraction denominators to 1,000,000. Decimal input allows up to 6 places. No expressions, scientific notation, complex numbers or uncertain measurements. Large intermediate fractions are bounded to keep the tool responsive.

Matching positions need matching meanings

Imagine a shop records quantities for two products at three branches. One row per branch and one column per product creates a 3 × 2 matrix. Adding a second day’s matrix gives combined quantities only if both days use the same branch and product order.

The calculator can verify dimensions; it cannot verify labels or units you left out. If one matrix lists kilograms and another lists grams, convert the units first. If the second matrix reverses the product columns, reorder them before adding.

Subtraction keeps the order you choose

A − B describes a change relative to B, while B − A reverses every difference. For stock records, choose a consistent convention such as closing quantity minus opening quantity. A negative entry can then describe a decrease rather than an input error.

Addition works entry by entry and is different from matrix multiplication. The product combines rows with columns and may be defined for matrices that cannot be added. Choose the operation that matches the question, not merely the shape of the data.

A quick independent check

After calculating a sum C = A + B, subtract B from C. You should recover A exactly for the accepted rational inputs. Try an entry with a fraction, such as 1/3 + 1/6 = 1/2, to see why an exact fraction can be clearer than a rounded decimal.

If you want to compare changes as percentages, a matrix difference alone is insufficient. Each position needs its own baseline, and a zero baseline makes a relative percentage undefined. Keep that question separate from the absolute change shown here.

A few questions, answered

Can I add rectangular matrices?

Yes. Rectangular matrices work when both have exactly the same dimensions, within the 6 × 6 limit.

Why did a zero row disappear from my input?

The calculator does not remove zero rows. Enter each zero explicitly and keep the same number of entries in every row. An empty row is rejected.

Can I paste a spreadsheet range?

Yes. Tabs and spaces separate entries, and new lines separate rows. Paste only the numbers; headings and thousands separators such as 1,000 are not interpreted as labels or grouped numbers.

Find your calculator

Start typing to explore the library.