Skip to content

Matrix Calculator: Determinant, Inverse, Multiply and More

Add, subtract and multiply matrices, scale or transpose them, reduce to row echelon form, and find the determinant, inverse, rank, trace and eigenvalues.

4 min read

A matrix is a rectangular grid of numbers. Matrices are used to solve systems of equations, transform shapes in computer graphics, model networks and run the statistics behind machine learning. The arithmetic is mechanical but error-prone by hand. Our matrix calculator performs the common operations and gives the key properties of a matrix in one go. This guide explains what each operation and property means.

How to use the calculator

  1. Matrix A: type one row per line, with numbers separated by spaces.
  2. Operation: properties of A, A + B, A − B, A × B, k × A, transpose A, or row echelon form (RREF).
  3. Matrix B and scalar k: used by the operations that need them.

The default 3 × 3 matrix is:

4 -2 1 3 6 -4 2 1 8

Its properties are: determinant 263, rank 3, trace 18, and eigenvalues 4.81 + 2.87i, 4.81 − 2.87i and 8.38, along with its inverse.

Matrix addition, subtraction and scaling

Addition and subtraction work entry by entry, so both matrices must be the same size.

Scaling multiplies every entry by the number k. 2 × A doubles every entry.

Matrix multiplication

To multiply A × B, each entry of the result is a row of A times a column of B, multiplied entry by entry and added.

Example: A = [1 2; 3 4] and B = [5 6; 7 8], where a semicolon separates the rows.

Top-left: 1 × 5 + 2 × 7 = 19. Top-right: 1 × 6 + 2 × 8 = 22. Bottom-left: 3 × 5 + 4 × 7 = 43. Bottom-right: 3 × 6 + 4 × 8 = 50.

Two important rules:

  • The number of columns of A must equal the number of rows of B.
  • Order matters: A × B is usually not the same as B × A.

Transpose

The transpose swaps rows and columns: the first row becomes the first column, and so on. A 2 × 3 matrix becomes 3 × 2.

Determinant

The determinant is a single number calculated from a square matrix. For a 2 × 2 matrix [a b; c d]:

For [1 2; 3 4]: 1 × 4 − 2 × 3 = −2.

What it tells you:

  • If the determinant is zero, the matrix has no inverse, and the system of equations it represents has no unique solution.
  • Its absolute value is the factor by which the matrix scales area (2D) or volume (3D).
  • A negative sign means the transformation flips orientation, like a mirror.

Inverse

The inverse A⁻¹ undoes A: A × A⁻¹ gives the identity matrix. For a 2 × 2 matrix:

For [1 2; 3 4]: (1 ÷ −2) × [4 −2; −3 1] = [−2 1; 1.5 −0.5].

Inverses solve matrix equations: if A × x = b, then x = A⁻¹ × b.

Rank, trace and eigenvalues

  • Rank: the number of independent rows (or columns). A full-rank square matrix has an inverse.
  • Trace: the sum of the diagonal entries. For the default, 4 + 6 + 8 = 18. It also equals the sum of the eigenvalues.
  • Eigenvalues: special numbers λ where A × v = λ × v for some vector v. They describe how the matrix stretches space along particular directions, and can be complex numbers. For [1 2; 3 4] they are about −0.372 and 5.372. Their product equals the determinant (−2) and their sum equals the trace (5).

Row echelon form and solving equations

Reduced row echelon form (RREF) simplifies a matrix using row operations: swapping rows, scaling a row and adding multiples of one row to another. Write a system of equations as an augmented matrix, reduce it, and the solutions can be read straight off.

Example: x + 2y = 5 and 3x + 4y = 11 becomes [1 2 5; 3 4 11]. Its RREF is [1 0 1; 0 1 2], so x = 1, y = 2.

Where matrices are used

  • Computer graphics: every rotation, scaling and projection in a 3D game is a matrix multiplication.
  • Engineering: structural analysis and electrical circuits produce large systems of equations. The Ohm's law calculator covers a single circuit element.
  • Statistics and data science: regression and principal component analysis are matrix calculations. The statistics calculator handles single-variable summaries.
  • Economics: input-output models of industries.

Frequently asked questions

Why can I not multiply my two matrices?

The number of columns in A must match the number of rows in B. A 2 × 3 matrix can multiply a 3 × 4 matrix, but not a 2 × 4 one.

Why does my matrix have no inverse?

Its determinant is zero, which means its rows are not independent. Such a matrix is called singular.

Can eigenvalues be complex?

Yes. Matrices that involve rotation often have complex eigenvalues, which come in conjugate pairs.

How do I enter a matrix?

Put each row on its own line and separate the numbers with spaces. All rows must have the same number of entries.

Share

Try it yourself

Run your own numbers with our free tool: Matrix calculator. No sign-up, and it works on any device.

Open the calculator