Matrix Calculator

2×2 or 3×3 matrix arithmetic. Click any i for detail.

Jump to result

Matrices

Operation
i
Op

Add, subtract, or multiply.

Matrix A
i
A

One row per line, spaces between entries.

Matrix B
i
B

Same format. For multiply, A columns must equal B rows.

How to use this calculator

  1. Enter matrix A as one row per line, entries space-separated.
  2. Enter matrix B in the same format.
  3. Pick add, subtract, or multiply.
  4. Read the result grid or an error if shapes mismatch.

Results explained

Addition and subtraction are element-wise and need matching dimensions. Multiplication uses row-by-column dot products and needs A's columns to equal B's rows.

Quick reference: matrix shapes

2×3 times 3×2 is valid; 2×3 times 2×3 is not.

ItemDetail
Add/subtractsame rows and columns
MultiplyA cols = B rows
2×2 examplefour entries, two rows
Max size3×3 on this page

Determinants, inverses, and eigenvalues are out of scope.

How the estimate is built

(A+B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ; (AB)ᵢⱼ = Σₖ Aᵢₖ Bₖⱼ.

Example scenario

[[1,2],[3,4]] + [[5,6],[7,8]] → [[6,8],[10,12]].

FAQ

Why did multiply fail?

Inner dimensions must match. A 2×2 cannot multiply a 2×2 unless both are square and compatible.

Can I use commas between entries?

Spaces separate entries; commas in numbers are not supported.

Is there an inverse button?

No. This page does elementary arithmetic only.