Matrix Calculator

A matrix is a rectangular grid of numbers. This matrix calculator finds inverses by Gauss–Jordan elimination, row-reduces to reduced row echelon form, works out determinants and transposes, and adds, subtracts or multiplies matrices up to 6 × 6. It uses exact fractions, so there are no rounding errors.

Separate entries with spaces and rows with new lines or semicolons.
Separate entries with spaces and rows with new lines or semicolons.
Try:

How to use the matrix calculator

  1. Choose an operation, such as inverse or multiply.
  2. Type matrix A with one row per line, entries separated by spaces.
  3. Add matrix B if needed, then press Calculate.

Formula

AA−1=IA A^{-1} = I
(AB)ij=∑kaikbkj(AB)_{ij} = \sum_k a_{ik} b_{kj}

Worked example: Inverse of 2×2

  • Operation: Inverse A⁻¹
  • Matrix A: 2 1 5 3

✓ Answer checked

A−1=(3−1−52)A^{-1} = \begin{pmatrix}3 & -1 \\ -5 & 2\end{pmatrix}
Determinant
11
Step-by-step working (5 steps)
  1. Check the determinant

    A matrix has an inverse only if its determinant is not 0.

    ∣A∣=1≠0|A| = 1 \neq 0
  2. 2×2 shortcut 2×2 inverse formula

    Swap the diagonal, negate the off-diagonal, divide by the determinant.

    A−1=11(3−1−52)\begin{gathered}A^{-1} = \frac{1}{1}\begin{pmatrix}3 & -1 \\ -5 & 2\end{pmatrix}\end{gathered}
  3. Write [A | I]

    Put the identity matrix next to A.

    (21105301)\begin{gathered}\left(\begin{array}{cc|cc}2 & 1 & 1 & 0 \\ 5 & 3 & 0 & 1\end{array}\right)\end{gathered}
  4. Row-reduce Gauss–Jordan elimination

    Apply row operations until the left side becomes the identity matrix.

    R1→12 R1R2→R2−5 R1R2→2 R2R1→R1−12 R2\begin{gathered}R_{1} \to \frac{1}{2}\,R_{1}\\R_{2} \to R_{2} - 5\,R_{1}\\R_{2} \to 2\,R_{2}\\R_{1} \to R_{1} - \frac{1}{2}\,R_{2}\end{gathered}
  5. Read off the inverse

    The right-hand side is now A⁻¹.

    A−1=(3−1−52)\begin{gathered}A^{-1} = \begin{pmatrix}3 & -1 \\ -5 & 2\end{pmatrix}\end{gathered}
Formulas used
AA−1=IA A^{-1} = I
(abcd)−1=1ad−bc(d−b−ca)\begin{pmatrix}a&b\\c&d\end{pmatrix}^{-1} = \frac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}
How this was checked
  • ✓ A × A⁻¹ and A⁻¹ × A both equal the identity matrix exactly.

Frequently asked questions

When does a matrix have an inverse?

Only when it is square and its determinant is not 0. A matrix with determinant 0 is called singular.

Can any two matrices be multiplied?

Only if the number of columns of the first equals the number of rows of the second. A 2×3 times a 3×4 gives a 2×4 matrix.

What is RREF?

Reduced row echelon form: each leading entry is 1, it is the only non-zero entry in its column, and leading entries move to the right as you go down.

Related calculators

Related guides