Matrix calculator

Determinant, inverse, rank, transpose, sum, product and powers of matrices up to 6×6. It works with exact fractions (1/3, not 0.333) and shows every row operation.

A
B

Pick an operation. The example matrices are already filled in so you can try it.

How to use the matrix calculator

Choose the number of rows and columns for each matrix, fill in the entries and press an operation. The one-matrix operations (determinant, inverse, rank, transpose, powers and multiplying by a number k) use A. Sum, difference and product use A and B. Entries can be whole numbers, fractions such as 1/3 or decimals such as 0.75.

For the determinant, the inverse and the rank you can open "Show steps". These are the actual row operations the calculator performed, written as R2 → R2 − (1/2)·R1, with the matrix after each one, so you can check your own Gaussian elimination line by line.

Three examples worked out with this calculator

  • Determinant of the preset matrix A: two row operations make it upper triangular with diagonal 2, 5/2 and 18/5, so det(A)=252185=18\det(A) = 2 \cdot \tfrac{5}{2} \cdot \tfrac{18}{5} = 18.
  • Inverse of the same A, by Gauss-Jordan on [A | I]:
    A1=(11182911829491911819518)A^{-1} = \left(\begin{array}{ccc} \frac{11}{18} & -\frac{2}{9} & \frac{1}{18} \\ -\frac{2}{9} & \frac{4}{9} & -\frac{1}{9} \\ \frac{1}{18} & -\frac{1}{9} & \frac{5}{18} \end{array}\right)
  • Rank of (123456789)\left(\begin{array}{ccc} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{array}\right): the calculator gives rank 2 and determinant 0, because row 3 equals 2 × row 2 minus row 1. That matrix has no inverse.

Working on a system of linear equations? You don't need to build the augmented matrix by hand: the equation solver solves it by Gaussian elimination and tells you whether it has one solution, infinitely many or none. For the fraction arithmetic behind these steps there is the fraction calculator, and the rest of the free study tools are one click away.

Frequently asked questions

Can I enter fractions and decimals?

Yes. Type 1/3, -2/5 or 0.75 in any cell (use a point for decimals; a comma is rejected so that 1,5 is never misread). Everything is computed with exact fractions, so the inverse comes out the way it does in your textbook instead of as rounded decimals. Empty cells count as 0.

How does it find the determinant?

With Gaussian elimination: row operations put zeros below the main diagonal, then the determinant is the product of the diagonal entries, with the sign flipped once for every row swap. "Show steps" lists each operation and the matrix after it. For a 3×3 matrix you get the same value as with cofactor expansion or the rule of Sarrus.

Why can't I multiply A and B?

AB is only defined when the number of columns of A equals the number of rows of B. If A is 2×3, B has to be 3×n. Matrix multiplication isn't commutative either: AB and BA usually give different results.

How do I know if a matrix is invertible?

A square matrix has an inverse exactly when its determinant isn't 0, which is the same as saying its rank equals its size. The calculator finds the inverse with Gauss-Jordan elimination: it row reduces the augmented matrix [A | I] until the left block is I, and the right block is then A⁻¹.

How is the rank worked out?

The matrix is row reduced to reduced row echelon form and the rank is the number of pivots (the number of nonzero rows). It works for any size, square or not.

More free tools