This matrix calculator performs the working operations on 2×2 and 3×3 matrices — addition, subtraction, multiplication, determinant, inverse and transpose — with exact-fraction-friendly decimal output and the honesty to flag singular matrices.


Matrices Are Machines

A matrix transforms space: rotations, scalings, shears — and systems of equations are matrices asking to be inverted. Multiplication is composition of transformations, which is why AB ≠ BA in general (rotate-then-move ≠ move-then-rotate). The determinant measures the volume scaling of the transformation — zero means the machine crushes a dimension flat. Row-partners in this family: our Vector Calculator, since a matrix times a vector is where the machine meets its material. Part of our Math Calculators collection.

Worked Examples (Verified)

  • A = [[1,2],[3,4]], B = [[5,6],[7,8]] (defaults): A + B = [[6,8],[10,12]] · A×B = [[19,22],[43,50]] · B×A = [[23,34],[31,46]] — visibly different, as promised
  • det(A) = 1×4 − 2×3 = −2 → inverse exists: A⁻¹ = [[−2, 1],[1.5, −0.5]] — multiply them and the identity [[1,0],[0,1]] appears
  • 3×3 diagonal diag(2,3,4): determinant = 2×3×4 = 24 (diagonal/triangular matrices: just multiply the diagonal) — the widget’s 3×3 starting point
  • Singular sanity: [[1,2],[2,4]] has det 0 (row 2 = 2× row 1) — feed it in and watch the inverse block explain itself

Operation Rules That Matter

  • Add/subtract: same shapes only, entrywise. Multiply: inner dimensions must match; the work is row-by-column dot products.
  • det(AB) = det A × det B — the calculator prints the check; volume scalings compose multiplicatively.
  • Inverse exists iff det ≠ 0; solving Ax = b is x = A⁻¹b conceptually — but numerically, real software factorizes instead of inverting (accuracy), a honesty note worth keeping.
  • Transpose flips rows/columns; symmetric matrices (A = Aᵀ) run physics and statistics (covariance matrices are symmetric by construction).

Related Tools

Frequently Asked Questions

How do you multiply two matrices?

Each entry of the product is a dot product: (AB)ᵢⱼ = row i of A · column j of B. [[1,2],[3,4]] × [[5,6],[7,8]] = [[1·5+2·7, 1·6+2·8],[3·5+4·7, 3·6+4·8]] = [[19,22],[43,50]]. Shapes must fit: (m×n)(n×p) → m×p.

How do you find a 2×2 determinant and inverse?

det = ad − bc. If nonzero, the inverse is (1/det) × [[d, −b],[−c, a]] — swap the diagonal, negate the off-diagonal, divide. [[1,2],[3,4]]: det −2, inverse [[−2, 1],[1.5, −0.5]].

Why isn’t matrix multiplication commutative?

Because transformations compose in order: putting on socks then shoes differs from shoes then socks. The defaults here show it numerically — A×B = [[19,22],[43,50]] but B×A = [[23,34],[31,46]]. Special pairs commute (a matrix with its inverse, diagonals with diagonals), but they’re the exceptions.

What does a determinant of zero mean?

The transformation flattens space (area/volume → 0): rows are linearly dependent, the matrix is singular, no inverse exists, and the system Ax = b has either no solution or infinitely many. It’s the single most diagnostic number a matrix has.

What is the transpose used for?

Flipping data orientation (samples × features), defining symmetric structures like covariance and Gram matrices, and throughout least-squares as AᵀA — the normal equations. Here it’s computed for A; swap entries to study B’s.

Is this matrix calculator free?

Yes — free, instant, no sign-up.