Matrix Calculator

How to use it

  1. Set the size of matrix A (and B, if the operation needs it) with the two menus, up to 8 by 8, and type the entries. Whole numbers, decimals, fractions such as −3/4 and mixed numbers such as 2 1/2 all work; an empty cell counts as 0.
  2. Or press Text and paste a matrix: one row per line, entries separated by spaces or commas, as it comes out of a spreadsheet or a textbook PDF.
  3. Pick an operation. The result appears as exact fractions; switch on Decimals to see them as decimals, and open Row operations to see how a row-reduced form or an inverse was found.

Exact fractions, not rounded decimals

Most online matrix calculators work in floating-point numbers, so the inverse of a simple matrix comes back full of 0.333333 and 1.1102e-16 where the true entries are 1/3 and 0. This one keeps every entry as a fraction of two whole numbers of any length and only reduces it at the end. The inverse of [[2, 1, 1], [1, 3, 2], [1, 0, 0]], for example, is exactly [[0, 0, 1], [−2, 1, 3], [3, −1, −5]] with determinant −1, and a 6 × 6 matrix of fractions keeps every digit of its determinant.

What each operation does

OperationNeedsNotes
A + B, A − Bsame sizeentry by entry
A × Bcolumns of A = rows of Bthe result has the rows of A and the columns of B; B × A is usually different
det(A)squarefound by elimination; each row swap flips the sign; 0 means A has no inverse
A−1square, det ≠ 0found by reducing [A | I] to [I | A−1]; the steps are listed
RREF(A), rank(A)any sizereduced row echelon form by Gauss-Jordan elimination; the rank is the number of pivots
Ansquaren from −64 to 64; negative powers use the inverse; computed by repeated squaring
A x = BB is one columnreports one solution, no solution (a row reads 0 = nonzero) or infinitely many (with the free variables named)

Reading the row operations

Row reduction uses three moves: swap two rows (R1 ↔ R2), multiply a row by a nonzero number (R1 → (1/2)R1), and add a multiple of one row to another (R3 → R3 − 2R1). None of them changes the solutions of the system, which is why they can be used to solve equations and invert matrices. The calculator works column by column from the left, takes the first nonzero entry it finds as the pivot, scales it to 1 and clears the rest of its column. Doing the moves in a different order can give different intermediate matrices, but the reduced row echelon form at the end is always the same.

What we tested

On October 15, 2026 we ran the page’s own functions on 1,500 random matrices from 1 × 1 to 6 × 6 with whole-number, fraction and decimal entries, and compared every result with the SymPy computer-algebra library: sums, products, scalar multiples, transposes, row-reduced forms and ranks for all of them; determinants, traces and powers for the 1,166 square ones; exact inverses for the 970 invertible ones, and an error message rather than an answer for the 196 singular ones and for every size mismatch. All 19,639 recorded row operations were replayed on the original matrices and produced SymPy’s reduced form. Systems A x = b came out as 971 with one solution (each checked by multiplying back), 334 with none and 195 with infinitely many, all agreeing with SymPy. There were no differences. In Chromium: the default matrix showed its exact inverse and determinant −1; RREF gave rank 3 with its row operations; A × B worked and a size mismatch gave a message; [[1, 2], [3, 4]] pasted as text inverted to [[−2, 1], [3/2, −1/2]] (−2, 1, 1.5, −0.5 as decimals) and copied as tab-separated text; A x = (5, 6) gave x = (−4, 9/2); A⁻¹ by power −1 matched; a singular matrix gave a message; everything survived a reload; a random 6 × 6 determinant fitted a 390 px phone with no errors. We also checked the check: leaving out the sign change on row swaps made 40 determinants wrong and the test failed.

Frequently Asked Questions

How do I find the inverse of a matrix?+
Enter it as matrix A and choose A⁻¹. The calculator reduces [A | I] to [I | A⁻¹] and lists each row operation. If the determinant is 0 the matrix has no inverse and you get a message instead.
How is the determinant calculated?+
By elimination: the matrix is reduced to triangular form and the determinant is the product of the pivots, with the sign flipped once for every row swap. The result is an exact fraction.
What is RREF?+
Reduced row echelon form: every pivot is 1, it is the only nonzero entry in its column, and each pivot is to the right of the one above. It shows the rank and solves systems of equations directly.
Can I use fractions and decimals?+
Yes. Type fractions such as −3/4, mixed numbers such as 2 1/2, or decimals such as 0.25. All arithmetic stays exact.
Why does A × B give an error?+
Matrix multiplication needs the number of columns of A to equal the number of rows of B. A 2×3 matrix can multiply a 3×4 matrix, but not a 2×3 one.
How big can the matrices be?+
Up to 8 rows and 8 columns. Entries can be as large as you like, because whole-number arithmetic has no fixed size here.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service