Matrix Calculator

Perform matrix addition, subtraction, multiplication, transpose and determinant for 2×2 and 3×3 matrices.

Matrix Size
Matrix A
Matrix B
Select a matrix size, fill in values and choose an operation.

How matrix operations work

Matrix operations are fundamental in linear algebra, used in computer graphics, physics, machine learning and engineering.

Addition / Subtraction
(A+B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ
Add corresponding elements. Both matrices must be the same size.
Multiplication
(A×B)ᵢⱼ = Σ Aᵢₖ × Bₖⱼ
Each result element is the dot product of a row from A with a column from B.
Determinant (2×2)
det(A) = ad − bc
For matrix [[a,b],[c,d]], det = ad − bc.
Determinant (3×3)
Cofactor expansion along row 1
det = a(ei−fh) − b(di−fg) + c(dh−eg) for a 3×3 matrix.

Frequently asked questions

Can I multiply any two matrices?

For square matrices of the same size (2×2 or 3×3), yes. In general, you can multiply an m×n matrix by an n×p matrix — the inner dimensions must match. This calculator handles same-size square matrix multiplication.

What does the determinant tell us?

The determinant indicates whether a matrix is invertible (det ≠ 0) or singular (det = 0). It also represents the scaling factor of the linear transformation the matrix represents.

What is a transpose?

The transpose of a matrix flips it along its main diagonal — rows become columns and columns become rows. If A is m×n, its transpose Aᵀ is n×m.

Why is matrix multiplication not commutative?

A×B ≠ B×A in general. The order matters because you are computing dot products of different row-column combinations. Commutativity holds only for special cases like identity matrices.

What are matrices used for in real life?

Matrices are used in 3D graphics transformations, solving systems of equations, Google's PageRank algorithm, machine learning (neural networks), quantum mechanics, and engineering stress analysis.