home / Math / matrix calculator

Matrix Calculator

The Matrix Calculator is a free online tool for linear algebra operations. It adds, subtracts and multiplies matrices, and computes the determinant, inverse, transpose and rank of a single matrix.

Enter each matrix with one row per line and values separated by spaces or commas.

one row per line
one row per line

Related: Scientific Calculator | Statistics Calculator | Exponent Calculator

Matrix Operation Chart

OperationRequirementResult size
Addition and subtractionIdentical dimensionsSame as the inputs
MultiplicationColumns of A = rows of BRows of A × columns of B
Scalar multiplicationAnyUnchanged
TransposeAnyDimensions swapped
DeterminantSquareA single number
InverseSquare, determinant not zeroSame size

Multiplication Is Not Commutative

AB and BA are generally different, and one may not even be defined. Each entry of AB is the dot product of a row of A with a column of B, which is why the inner dimensions must match. The order encodes meaning: applying a rotation then a scaling is not the same as scaling then rotating.

The Determinant

For a 2×2 matrix it is ad − bc. Geometrically, it is the factor by which the transformation scales area — or volume in three dimensions. A determinant of 2 doubles areas; a determinant of −1 preserves area while flipping orientation.

A determinant of zero means the transformation collapses space into a lower dimension, which is why such a matrix has no inverse: information has been destroyed and cannot be recovered.

The Inverse

A−1 undoes what A does: A × A−1 = I. It exists only for square matrices with a non-zero determinant. Solving a linear system Ax = b is x = A−1b in principle — though in practice Gaussian elimination is faster and numerically more stable than computing the inverse.

Where Matrices Are Used

  • Computer graphics — every rotation, scale and translation is a matrix multiplication, which is what GPUs are built to do quickly.
  • Machine learning — neural network layers are matrix operations, and training is largely matrix arithmetic at scale.
  • Engineering — structural analysis, circuit networks, and control systems.
  • Statistics — regression coefficients come from a matrix expression, and covariance is a matrix.
  • Economics — input-output models of whole economies.

Frequently Asked Questions

What is the identity matrix?

A square matrix with ones on the diagonal and zeros elsewhere. It is the matrix equivalent of the number one: multiplying by it changes nothing.

Why does the size have to match for multiplication?

Because each entry of the result is a dot product between a row of A and a column of B, and dot products require vectors of equal length.

What does the transpose do geometrically?

For rotation matrices it reverses the rotation, since the transpose equals the inverse. In general it reflects the matrix across its main diagonal and appears throughout statistics and optimisation.