Scientific

Matrix Calculator

Free Matrix Calculator to add, subtract, and multiply 2×2 and 3×3 matrices online with step-by-step solutions.

What does this Matrix Calculator do?

This tool performs the three most common matrix operations — addition, subtraction, and multiplication — on 2×2 or 3×3 square matrices, showing the resulting matrix instantly.

The rules

Matrix addition and subtraction work element-by-element: each entry in the result is the sum (or difference) of the corresponding entries in matrix A and matrix B. Matrix multiplication is different — each entry in the result is the sum of the products of a row in A and a column in B (the "dot product" of that row and column).

Step-by-step example

For 2×2 addition: if A = [[1,2],[3,4]] and B = [[5,6],[7,8]], then A + B = [[1+5, 2+6],[3+7, 4+8]] = [[6,8],[10,12]]. For multiplication, the top-left entry of A×B is (1×5 + 2×7) = 19, not simply 1×5 — this is the part that trips people up when they first learn matrix multiplication.

Tips & common mistakes

  • Matrix multiplication is not commutative — A×B usually does not equal B×A, unlike regular number multiplication.
  • Don't multiply matrices element-by-element like you would add them — this is the most common matrix mistake for students first learning linear algebra.
  • Both matrices must be the same size for addition/subtraction, and for multiplication here (2×2 or 3×3 square matrices only).

Where matrix math shows up in real life

Matrices aren't just an abstract classroom exercise — they're the backbone of computer graphics (rotating and scaling 3D objects in games and animation), machine learning (representing data sets and neural network weights), engineering simulations, and economics (input-output models of an economy). Understanding basic matrix operations is a genuine prerequisite for many technical fields.

A note on matrix addition versus multiplication

Addition and subtraction are intuitive because they mirror ordinary arithmetic — you're just combining corresponding positions. Multiplication is conceptually different because it represents a transformation (like rotating or scaling a shape) being applied and combined with another transformation, which is why the row-by-column dot product calculation looks unfamiliar at first.

The determinant: a related concept

Though this calculator focuses on addition, subtraction, and multiplication, one closely related matrix concept worth knowing is the determinant — a single number computed from a square matrix that reveals whether the matrix can be "inverted" (a 2×2 matrix's determinant is ad − bc for matrix [[a,b],[c,d]]). A determinant of zero means the matrix has no inverse, which matters in solving systems of linear equations.

Matrices and systems of linear equations

One of the most practical uses of matrices is representing and solving systems of linear equations compactly — instead of writing out several separate equations with several unknowns, you can represent the whole system as a single matrix equation. This is the foundation of how spreadsheet software, engineering simulations, and economic models solve for many unknowns simultaneously.

A worked 2×2 multiplication example

For A = [[2,0],[1,3]] and B = [[4,1],[2,5]]: the top-left entry of A×B is (2×4 + 0×2) = 8. The top-right is (2×1 + 0×5) = 2. The bottom-left is (1×4 + 3×2) = 10. The bottom-right is (1×1 + 3×5) = 16. So A×B = [[8,2],[10,16]].

Frequently asked questions

This tool multiplies square matrices of matching size (2×2 or 3×3). For matrix multiplication in general, the number of columns in A must equal the number of rows in B.

The row-by-column definition is what makes matrices useful for representing linear transformations (like rotating or scaling a shape) — multiplying two matrices this way correctly represents applying one transformation after another. Simple entry-by-entry multiplication wouldn't preserve that property.