Skip to content

Matrix Calculator

Add, subtract and multiply matrices, or find the determinant, inverse, transpose, rank, trace and any whole power of a matrix up to 8 × 8.

Formulas last reviewed: September 2026

Disclaimer: Results are calculated with standard formulas and are meant for learning and quick checks. Please double-check important work, especially anything used for exams, engineering, finance or safety.

Working with grids of numbers

A matrix is a rectangular grid of numbers. Matrices describe systems of equations, transformations in graphics, networks and data tables, and they are a staple of engineering and computer science courses.

Enter a matrix with one row per line and this calculator can add, subtract and multiply matrices, multiply by a number, and find the transpose, determinant, inverse, rank, trace and any whole power. Sizes up to 8 × 8 are supported.

How it is calculated

Entry (i, j) of A × B = sum of A(i, k) × B(k, j)
det [[a, b], [c, d]] = ad − bc
Inverse (2 × 2) = 1 ÷ det × [[d, −b], [−c, a]]

Worked example

A = [[1, 2], [3, 4]]

Determinant
−2
Trace (1 + 4)
5
Invertible?
Yes, because the determinant is not zero

Size rules

  • Add or subtract matrices only if they have the same size.
  • To multiply A × B, the number of columns of A must equal the number of rows of B.
  • Only square matrices have a determinant, an inverse or a power.
  • Matrix multiplication is not commutative: A × B is usually different from B × A.

Frequently asked questions

What does a zero determinant mean?

The matrix is singular: it has no inverse, and its rows or columns are linearly dependent.

How do I enter a matrix?

Type one row per line and separate the entries with spaces or commas, for example 1 2 on the first line and 3 4 on the second.

What is the rank of a matrix?

The rank is the number of independent rows (or columns). A full-rank square matrix is invertible.

What is the transpose?

It flips the matrix over its diagonal so rows become columns.