Matrix Calculator

Enter matrices with one row per line and numbers separated by spaces or commas, choose an operation and get the result.

How it works

Addition and subtraction work element by element and need matrices of the same size. Multiplication needs the number of columns of A to equal the number of rows of B. The determinant and inverse need a square matrix and are found by Gaussian elimination.

(AB)ij = Σk Aik Bkj
A−1 exists only if det(A) ≠ 0

Worked example

Using the default values: Operation = A x B; Matrix A = 1 2, 3 4; Matrix B = 5 6, 7 8.

The calculator returns: A × B: 2 × 2.

Limits and assumptions

  • Matrices up to 4 by 4 are supported for the inverse and determinant; products and sums work for larger sizes up to 8 by 8.
  • Results are floating point, rounded to 6 decimal places.
  • A matrix with determinant 0 (singular) has no inverse.

Last reviewed: 2026-12-01. Found a mistake? Please use the Contact page and tell us the inputs you used.

Frequently asked questions about the Matrix Calculator

When can I multiply two matrices?

When the number of columns in the first equals the number of rows in the second. The result has the rows of the first and the columns of the second.

What does the determinant tell me?

A non-zero determinant means the matrix is invertible. A zero determinant means the rows are linearly dependent.

How do I type a matrix?

Put each row on its own line and separate the numbers with spaces or commas.

Advertisement