Matrix Calculator
Determinant, inverse, transpose, rank, RREF, eigenvalues and matrix arithmetic, with every step and exact fractions.
Entries can be whole numbers, decimals or fractions such as 3/4. Empty boxes count as 0.
How do you find the determinant and inverse of a matrix?
For a 2 × 2 matrix [[a, b], [c, d]] the determinant is ad − bc. If it is not 0, the inverse is 1/(ad − bc) × [[d, −b], [−c, a]]. Larger matrices use cofactor expansion for the determinant and Gauss–Jordan row reduction for the inverse.
Checked by the All Math Solver team · Last reviewed · How we check our answers
About the Matrix Calculator
Determinant, inverse, transpose, rank, RREF, eigenvalues and matrix arithmetic with exact fractionsA matrix is a rectangular table of numbers with \(m\) rows and \(n\) columns. Two matrices of the same size are added entry by entry, while the product \(AB\) is defined only when the number of columns of \(A\) equals the number of rows of \(B\): each entry is a row of \(A\) times a column of \(B\).
For a \(2 \times 2\) matrix the determinant is \(ad - bc\) and the inverse is \(\frac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}\). Larger matrices are handled with cofactor expansion and Gauss–Jordan elimination; every row operation is shown, and fractions stay exact instead of turning into rounded decimals.
How to use the matrix calculator
- Choose the operation: determinant, inverse, transpose, rank, RREF, trace, eigenvalues, a power Aⁿ, k × A, or A + B, A − B and A × B.
- Pick the size of each matrix (up to 5 × 5) and type the entries. Whole numbers, decimals and fractions such as
3/4are fine; an empty box counts as 0. - Press Calculate. You see every step: the 2 × 2 formulas, cofactor expansion, or each row operation of Gauss–Jordan elimination, with exact fractions.
Example: Inverse of A = [[1, 2], [3, 4]] → det A = 1·4 − 2·3 = −2, so A⁻¹ = (1/−2)[[4, −2], [−3, 1]] = [[−2, 1], [3/2, −1/2]]
What matrices are used for, and how to read the steps
Matrices are a compact way to handle many numbers that belong together. A system of linear equations can be written as Ax = b, and if A has an inverse the solution is x = A⁻¹b, which is why the inverse is one of the most used operations. In computer graphics, rotations, reflections and scalings are 2 × 2 or 3 × 3 matrices, and applying one transformation after another is matrix multiplication. Statistics, economics and engineering use matrices for regression, input–output models and networks of forces, while Markov chains use a matrix of probabilities to predict how a system changes over time.
The determinant has a geometric meaning that makes it easier to remember: it is the factor by which the matrix scales area (in 2D) or volume (in 3D). A determinant of 0 means the matrix squashes the space flat, so no inverse can undo it, and the calculator tells you the matrix is singular. Order matters in multiplication: for A = [[1, 2], [3, 4]] and B = [[0, 1], [1, 0]], AB = [[2, 1], [4, 3]] but BA = [[3, 4], [1, 2]]. When you check homework, make sure the matrices were entered in the same order as in the question.
For larger matrices the calculator shows each row operation of Gauss–Jordan elimination, such as R2 → R2 − 3R1, so you can follow the method and reproduce it in an exam. It works with exact fractions throughout, which avoids the rounding errors that build up when decimals such as 0.333 are used in long calculations. We test every operation, from determinants and inverses to rank, RREF and eigenvalues, against results computed independently, including singular matrices and sizes that cannot be multiplied, which are reported with a clear message.
Frequently asked questions
How do you find the determinant of a matrix?
For a 2 × 2 matrix [[a, b], [c, d]] the determinant is ad − bc. For a 3 × 3 matrix, expand along the first row: multiply each entry by the determinant of the 2 × 2 matrix left after crossing out its row and column, with signs +, −, +. Larger matrices are row reduced to triangular form and the diagonal entries are multiplied.
When does a matrix have an inverse?
Only a square matrix can have an inverse, and only when its determinant is not 0. If the determinant is 0 the matrix is called singular and the calculator tells you that no inverse exists.
When can two matrices be multiplied?
A × B is defined 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. In general A × B is not equal to B × A.
What is RREF and rank?
Reduced row echelon form (RREF) is what remains after row operations make every pivot 1 and clear the rest of its column. The rank is the number of non-zero rows in that form, which is the number of independent rows or columns.
Are the answers exact?
Yes. The calculator works with exact fractions, so an inverse such as [[−2, 1], [3/2, −1/2]] is shown with fractions instead of rounded decimals.
How do I use this matrices calculator for multiplication?
Choose A × B, set the size of each matrix and type the entries; the number of columns of A must equal the number of rows of B. Each entry of the answer is a row of A times a column of B, added up. For [[1, 2], [3, 4]] × [[5, 6], [7, 8]] the top-left entry is 1·5 + 2·7 = 19, and the result is [[19, 22], [43, 50]]. Every product is shown step by step.