Matrix Calculator
Type one or two matrices, pick an operation, and get an exact answer with the row operations that led to it.
https://flxcode.com/matrix-calculator/
Example
A × B is a 3 × 3 matrix.
A × B (3 × 3)
[ 5 7 7 ] [ -3 7 4 ] [ 7 12 7 ]
Rule
- A 3 × 3 matrix times a 3 × 3 matrix gives a 3 × 3 matrix. Each entry is a row of A times a column of B.
- Entry (1,1) = 2·1 + 1·3 + 3·0 = 5.
- Order matters: A × B and B × A are usually different.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Worked examples
| Operation | Input | Result | Note |
|---|---|---|---|
| A × B | [1 2; 3 4] and [5 6; 7 8] | [19 22; 43 50] | Row of A times column of B. 1·5 + 2·7 = 19 is the first entry. |
| Determinant | [3 8; 4 6] | det(A) = -14 | ad − bc = 3·6 − 8·4 = 18 − 32 |
| Determinant 3 × 3 | [6 1 1; 4 −2 5; 2 8 7] | det(A) = -306 | Row reduction gives the same number as the cofactor rule |
| Inverse | [4 7; 2 6] | [3/5 -7/10; -1/5 2/5] | det = 10, swap the diagonal, flip the signs of the other two, divide by 10 |
| Singular | [1 2; 2 4] | det(A) = 0 | Row 2 is twice row 1, so det = 0 and there is no inverse |
| Rank | [1 2 3; 2 4 6; 1 0 1] | rank(A) = 2 | Row 2 repeats row 1, so only 2 rows are independent |
| RREF of a system | [1 1 1 6; 0 2 5 −4; 2 5 −1 27] | [1 0 0 5; 0 1 0 3; 0 0 1 -2] | The last column reads off the solution: x = 5, y = 3, z = −2 |
The three row operations
Every step in this tool is one of these. Swap two rows. Multiply a row by a nonzero number. Add a multiple of one row to another. Row reduction uses only these three, which is why it never changes the solutions of a system or the rank. A swap flips the sign of the determinant, and adding a multiple of a row leaves it alone.
Why the answers are fractions
The inverse of a whole-number matrix usually has fractions, with the determinant on the bottom. The tool keeps them exact (BigInt fractions) and shows a 4-place decimal below them. A float calculator would show 0.30000000000000004 and call a tiny leftover a pivot. Here, 0 is 0.
Solving a linear system
Write the coefficients as rows and the constants as the last column, then choose RREF. If the left side turns into the identity, the last column is the solution. A row like 0 0 0 | 1 means no solution. A column with no pivot means a free variable and many solutions. For a single quadratic equation use the quadratic formula calculator, and for fractions on their own the fraction calculator.
Numbers this uses
- Size: 1 × 1 up to 6 × 6 for each matrix.
- Entries: whole numbers, decimals or fractions, up to 40 digits each, stored as exact fractions.
- Determinant: row reduction with a pivot swap when needed (not the cofactor expansion), exact.
- Steps: at most 60 row operations are listed, then a count of the rest.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
How do I enter a matrix?
One row per line, entries separated by spaces or commas. You can use whole numbers, decimals and fractions like 1/2. A semicolon also starts a new row, so 1 2; 3 4 is a 2 × 2 matrix. Every row needs the same number of entries. The limit is 6 rows and 6 columns.
When can I multiply two matrices?
When the number of columns of A equals the number of rows of B. A 2 × 3 times a 3 × 4 gives a 2 × 4. The order matters: A × B is usually not B × A, and one of them may not exist at all. The tool says which sizes it found if they do not fit.
What is the determinant for?
It is one number that says whether a square matrix can be inverted (nonzero) or not (zero). It is also the factor by which the matrix scales area or volume. The tool finds it by row reduction on exact fractions, so a determinant that should be 0 is 0, not 1e-16.
Why does my matrix have no inverse?
It is singular: its determinant is 0, which means one row or column is a combination of the others. Only square matrices can have an inverse. The tool tells you which of the two problems it found and shows the determinant.
How is the inverse found?
Write the matrix next to the identity matrix, [A | I], and row-reduce until the left side is the identity. The right side is then the inverse. Every row operation is listed, and the last block multiplies A by the answer so you can see it comes out as the identity.
What is the rank of a matrix?
The number of independent rows, which equals the number of independent columns. You find it by row-reducing and counting the nonzero rows (the pivots). A square n × n matrix has rank n exactly when its determinant is not 0.
What is RREF and what is it good for?
Reduced row echelon form: each pivot is 1 and is the only nonzero entry in its column, and the pivots step down to the right. Put a linear system in as an augmented matrix, with the constants in the last column, and the RREF shows the solution or shows that there is none.
Are my numbers saved or sent anywhere?
No. Every matrix is worked out in your browser. What you type is not put in the address bar, not stored and not counted. We only count which operation you used, such as determinant or inverse.
More from FLXCode
Quadratic Formula CalculatorNew
Solve ax² + bx + c = 0 with exact roots, complex roots, discriminant, vertex form, steps and a small graph.
Square Root CalculatorNew
Exact simplified radicals (√72 = 6√2), decimals to your digits, cube and n-th roots, perfect-square check, steps.
Fraction CalculatorNew
Add, subtract, multiply and divide fractions and mixed numbers. Simplified answer with the steps in words.
Long Division CalculatorNew
Long division laid out like on paper, with the remainder and the decimal, repeating part marked.