Proofwell
Menu

Matrix Calculator

Calculate determinants, inverses, ranks, reduced row echelon forms, eigenvalues and eigenvectors, or add, subtract and multiply matrices up to 8 × 8. Every result uses exact fractions, and the working lists each row operation in order.

Mathematics · Linear algebraUpdated Sources cited

Operation
Matrix A3 × 3

Entries can be integers, decimals or fractions such as -3/4. All arithmetic is exact.

Result

det⁡(A)=49\det(A) = 49
Assumptions behind this result
  • Entries are exact rational numbers: decimals such as 0.1 are treated as exactly 1/10.

Step-by-step solution

Every step is computed from your input
  1. Step 1: Reduce to upper triangular form

    Adding a multiple of one row to another leaves the determinant unchanged, and each row swap changes its sign. Eliminating below each pivot gives an upper triangular matrix.

  2. Step 2: Swap rows 1 and 3.

    R1↔R3:[14520−12−31]R_{1} \leftrightarrow R_{3}:\quad \begin{bmatrix} 1 & 4 & 5 \\ 2 & 0 & -1 \\ 2 & -3 & 1 \end{bmatrix}
  3. Step 3: Subtract 2 × row 1 from row 2.

    R2→R2−2R1:[1450−8−112−31]R_{2} \to R_{2} - 2R_{1}:\quad \begin{bmatrix} 1 & 4 & 5 \\ 0 & -8 & -11 \\ 2 & -3 & 1 \end{bmatrix}
  4. Step 4: Subtract 2 × row 1 from row 3.

    R3→R3−2R1:[1450−8−110−11−9]R_{3} \to R_{3} - 2R_{1}:\quad \begin{bmatrix} 1 & 4 & 5 \\ 0 & -8 & -11 \\ 0 & -11 & -9 \end{bmatrix}
  5. Step 5: Subtract 11/8 × row 2 from row 3.

    R3→R3−(118)R2:[1450−8−1100498]R_{3} \to R_{3} - \left(\frac{11}{8}\right)R_{2}:\quad \begin{bmatrix} 1 & 4 & 5 \\ 0 & -8 & -11 \\ 0 & 0 & \frac{49}{8} \end{bmatrix}
  6. Step 6: Multiply the diagonal entries

    The determinant of a triangular matrix is the product of its diagonal. There was 1 row swap, so the sign flips.

    det⁡(A)=−(1)(−8)(498)=49\det(A) = -(1)(-8)(\frac{49}{8}) = 49

What the calculator does

Choose an operation, enter one or two matrices, and press Calculate.

Operation What you get
Determinant det(A), by row reduction to triangular form
Inverse A⁻¹ by Gauss–Jordan elimination, or an explanation if A is singular
RREF the reduced row echelon form, with every row operation
Rank the number of pivots, the dimension of A’s row and column space
Eigenvalues the characteristic polynomial, eigenvalues and eigenvectors
Transpose, trace Aᵀ and the sum of the diagonal
A + B, A − B, A × B matrix arithmetic, with size checks

How to use it

  1. Pick the operation. Operations that need a square matrix lock the grid to a square shape.
  2. Set the number of rows and columns, then type the entries. Integers, decimals and fractions like −3/4 all work.
  3. Empty cells are reported as errors rather than treated as zero. To fill every empty cell with 0, use Fill empty cells with 0.

The formulas

Determinant

For a 2 × 2 matrix:

det⁡[abcd]=ad−bc\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc

For larger matrices, the calculator uses row reduction: adding a multiple of one row to another leaves the determinant unchanged, and swapping two rows changes its sign. Once the matrix is upper triangular, the determinant is the product of the diagonal entries. This takes about n³ operations, compared with n! for cofactor expansion.

Inverse

Write the augmented matrix [A | I] and row-reduce. If the left half becomes the identity, the right half is A⁻¹:

[ A∣I ]→row operations[ I∣A−1 ]\left[\,A \mid I\,\right] \xrightarrow{\text{row operations}} \left[\,I \mid A^{-1}\,\right]

For a 2 × 2 matrix this gives the familiar formula

A−1=1ad−bc[d−b−ca]A^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

Eigenvalues

A number λ is an eigenvalue of A if Av = λv for some non-zero vector v. That happens exactly when A − λI is singular:

det⁡(λI−A)=0\det(\lambda I - A) = 0

The left side is the characteristic polynomial, of degree n. Its roots are the eigenvalues, and for each eigenvalue, the solutions of (A − λI)v = 0 are its eigenvectors.

Worked example

Find the determinant of

A=[2−3120−1145]A = \begin{bmatrix} 2 & -3 & 1 \\ 2 & 0 & -1 \\ 1 & 4 & 5 \end{bmatrix}
  1. Swap rows 1 and 3, so the first pivot is 1. This keeps the arithmetic simple, but it changes the sign of the determinant.
  2. Eliminate below the first pivot. Subtract 2 × row 1 from row 2 to get (0, −8, −11), and 2 × row 1 from row 3 to get (0, −11, −9).
  3. Eliminate below the second pivot. Subtract 11/8 × row 2 from row 3 to get (0, 0, 49/8).
  4. Multiply the diagonal and correct the sign. det(A) = −(1)(−8)(49/8) = 49.

The calculator gives det(A) = 49, with the same row operations in its working. Cofactor expansion along the first row confirms it: 2(0·5 − (−1)·4) + 3(2·5 − (−1)·1) + 1(2·4 − 0·1) = 8 + 33 + 8 = 49.

Common mistakes

  • Multiplying entry by entry. Matrix multiplication combines rows of A with columns of B. Entry-by-entry multiplication is a different operation.
  • Assuming AB = BA. Matrix multiplication is generally not commutative, and the two products may not even have the same size.
  • Forgetting the sign change from a row swap when computing a determinant by row reduction.
  • Scaling a row and forgetting the determinant changes. Multiplying a row by k multiplies the determinant by k.
  • Trusting a decimal determinant near zero. With rounded arithmetic, a singular matrix can show a tiny non-zero determinant. Exact arithmetic avoids this.

Practical applications

  • Systems of linear equations. A system Ax = b has a unique solution exactly when A is invertible.
  • Computer graphics. Rotations, scalings and projections are matrix multiplications.
  • Physics and engineering. Eigenvalues give natural frequencies of vibrating structures and principal stresses.
  • Data science. Principal component analysis finds the eigenvectors of a covariance matrix.
  • Markov chains. Long-run probabilities are an eigenvector for eigenvalue 1.

Assumptions and limitations

Matrices can be up to 8 × 8 with rational entries. Determinants, inverses, ranks and reduced forms are exact. Eigenvalues are exact when they are rational or quadratic surds; otherwise they are computed numerically. Eigenvectors are exact for rational eigenvalues. For simple irrational or complex eigenvalues they are computed numerically and checked; for repeated irrational eigenvalues they are not shown, because floating-point arithmetic cannot reliably determine the dimension of the eigenspace.

Frequently asked questions

When does a matrix have an inverse?

A square matrix has an inverse exactly when its determinant is not zero, which is the same as saying its rank equals its size and its rows are linearly independent. Such a matrix is called invertible or non-singular.

Why are the answers fractions instead of decimals?

The calculator uses exact rational arithmetic, so 1/3 stays 1/3. Decimal arithmetic accumulates rounding errors, which can make a singular matrix look invertible or give an inverse that is slightly wrong.

Can I multiply a 2 × 3 matrix by a 3 × 2 matrix?

Yes. A product AB exists when the number of columns of A equals the number of rows of B. A 2 × 3 matrix times a 3 × 2 matrix gives a 2 × 2 matrix. The product BA also exists here but is 3 × 3, which shows that matrix multiplication is not commutative.

What is the difference between row echelon form and reduced row echelon form?

In row echelon form, each leading entry is to the right of the one above and everything below each leading entry is zero. In reduced row echelon form, each leading entry is also 1 and is the only non-zero entry in its column. The reduced form is unique; the plain echelon form is not.

What does it mean if a matrix is not diagonalizable?

It has a repeated eigenvalue whose eigenspace is smaller than its multiplicity, so there are not enough independent eigenvectors to form a basis. The matrix [[1, 1], [0, 1]] is the standard example.

References

  1. Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press.
  2. Anton, H. & Rorres, C. (2013). Elementary Linear Algebra (11th ed.). Wiley.
  3. Faddeev, D. K. & Faddeeva, V. N. (1963). Computational Methods of Linear Algebra. W. H. Freeman. Source of the characteristic polynomial algorithm used here.
  4. Weisstein, E. W. Determinant. MathWorld, Wolfram Research.