Matrix Calculator is loading…
It multiplies, adds and subtracts matrices, finds the inverse, determinant, transpose, trace, rank and reduced row echelon form (RREF), raises a matrix to a power, and multiplies by a number. Every answer comes with the row operations or entry-by-entry work, using exact fractions instead of rounded decimals.
Pick an Operation
| Operation | What you need | What you get |
|---|---|---|
| A × B | Columns of A = rows of B | An (rows of A) × (columns of B) matrix |
| A + B, A − B | Same size | Same size, entry by entry |
| Inverse \(A^{-1}\) | Square, \(\det A \ne 0\) | The matrix that undoes A |
| Determinant | Square | One number |
| Transpose \(A^T\) | Any size | Rows become columns |
| RREF and rank | Any size | Simplest row form and the number of pivots |
| Power \(A^k\) | Square | A multiplied by itself k times |
Type matrices one row at a time: spaces between numbers, semicolons between rows. For example, 1 2; 3 4 is \(\begin{bmatrix}1 & 2\\ 3 & 4\end{bmatrix}\).
Matrix Multiplication: Row Times Column
To get the entry in row \(i\), column \(j\) of \(AB\), take row \(i\) of A and column \(j\) of B, multiply matching numbers, and add.
Order matters. In general \(AB \ne BA\). Try both orders in the calculator and you will usually get two different answers.
Finding an Inverse With [A | I]
The method that works for any size is Gauss–Jordan elimination:
- Write A next to the identity matrix. This makes the “augmented” matrix \([A \mid I]\).
- Row reduce the left side to I. Use row swaps, scaling, and adding multiples of rows.
- Read the answer on the right. When the left side is I, the right side is \(A^{-1}\).
- Check. Multiply \(A \cdot A^{-1}\). You should get I. The calculator does this check for you.
For a 2×2 matrix there is also a shortcut: \(\begin{bmatrix}a & b\\ c & d\end{bmatrix}^{-1} = \frac{1}{ad – bc}\begin{bmatrix}d & -b\\ -c & a\end{bmatrix}\). For \(\begin{bmatrix}2 & 1\\ 7 & 4\end{bmatrix}\), the determinant is \(8 – 7 = 1\), so the inverse is \(\begin{bmatrix}4 & -1\\ -7 & 2\end{bmatrix}\).
If the determinant is 0, the matrix is singular and has no inverse at all.
RREF and Rank, Explained Simply
Reduced row echelon form is the cleanest version of a matrix you can reach with row operations. Each pivot is a 1, and it is the only nonzero number in its column. For example:
\[\begin{bmatrix}1 & 2 & -1\\ 2 & 4 & 1\\ 3 & 6 & 0\end{bmatrix} \;\longrightarrow\; \begin{bmatrix}1 & 2 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0\end{bmatrix}\]
There are two pivots, so the rank is 2. A row of zeros means one of the original rows was a combination of the others. RREF is also how you solve a system of linear equations: put the coefficients and the right side into one augmented matrix and reduce it.
Where Matrices Show Up
- Computer graphics: every rotation, zoom and 3D projection is a matrix multiplication.
- Calculus: the Jacobian matrix holds all the partial derivatives of a function, and the eigenvalues of a matrix solve systems of differential equations.
- Data and AI: spreadsheets of data are matrices, and neural networks are mostly matrix multiplication.
- Sequences: powers of \(\begin{bmatrix}1 & 1\\ 1 & 0\end{bmatrix}\) produce the Fibonacci numbers. Try power 10 above.
Learn the Math Behind the Matrix Calculator
Matrices organize systems of equations. In calculus they appear as Jacobians, Wronskians and in systems of differential equations.
Frequently Asked Questions
Why can’t I multiply a 2×3 matrix by a 2×3 matrix?
The number of columns in the first matrix (3) must match the number of rows in the second (2). They do not match, so the product is not defined. Multiplying a 2×3 by a 3×2 matrix works and gives a 2×2 matrix.
Does the calculator use fractions or decimals?
It keeps exact fractions whenever every entry is a whole number, fraction, or terminating decimal. If you enter something like sqrt(2), it switches to decimals.
What is the difference between REF and RREF?
Row echelon form (REF) only needs zeros below each pivot. Reduced row echelon form (RREF) also needs zeros above each pivot and every pivot equal to 1. RREF is unique; REF is not.
How big can my matrix be?
Any size works for addition, multiplication, transpose and RREF. For the determinant, matrices up to 8×8 are supported.
Related Tools and Guides
- Determinant calculator with cofactor expansion steps
- Eigenvalue and eigenvector calculator
- Cross product calculator for 3D vectors