Matrix Calculator

Add, multiply, invert — 2×2, 3×3, and 4×4.

Matrix A

Matrix B

How to use the matrix calculator

  1. Pick a size — 2×2, 3×3, or 4×4. The grids start as identity matrices; click any cell to edit.
  2. Fill in both matrices (B is only needed for +, −, ×).
  3. Press an operation — the result appears below, formatted as a matrix or a single number.
  4. Watch for singular matrices: if A has determinant 0, the inverse button explains why it fails instead of giving nonsense.

Frequently asked questions

How is matrix multiplication done?

With the row-times-column rule: each entry of A × B is the dot product of a row of A with a column of B. That's why multiplication is not commutative — AB and BA usually differ.

What does it mean when a matrix is singular?

Its determinant is 0, so it has no inverse — like trying to divide by zero. Geometrically, a singular matrix squashes space flat (a 2D matrix collapsing an area to a line), so the squashing can't be undone.

How is the inverse computed here?

With Gauss-Jordan elimination on the augmented matrix [A | I]: row operations turn the left half into the identity, and the right half becomes A⁻¹. Partial pivoting keeps the arithmetic stable.

Why is 4×4 the largest size?

It covers the sizes students and homework meet (2×2, 3×3, and 4×4 for 3D graphics transforms) while keeping the editable grids compact and readable on a phone.

Is my matrix data sent anywhere?

No. Every operation runs in your browser — nothing is sent to a server or stored.

More from the codex