Exact matrix calculations with work shown
Use this matrix calculator to check homework in an introductory US linear algebra course. It finds an inverse with Gauss-Jordan elimination, calculates a determinant by row reduction or cofactor expansion, and produces reduced row echelon form, or RREF. Addition, multiplication and transpose remain available. The loaded example already shows an actual inverse, so you can compare an answer before entering your own problem.
Choose the number of rows and columns, then enter matrix A row by row. Both grids share those dimensions. Each dimension can run from one through four. Inverse and determinant require square matrices; RREF and transpose also accept rectangular matrices. Matrix B is needed only for addition and multiplication. Because both grids share dimensions, use square grids for multiplication here. For a general system of equations, the separate linear system solver may fit your assignment better.
Enter fractions without rounding
Entries accept signed integers, finite decimals, scientific notation and fractions written with a slash. For example, entering 1/3 keeps that rational value through every operation. Decimal text is converted exactly to a fraction before calculation. The calculator uses BigInt numerators and denominators and reduces each fraction to lowest terms. It never converts the answer to a rounded decimal display.
Enter an explicit zero for a zero entry. A blank required cell is missing input and causes a correction message when you calculate. A fraction cannot have a zero denominator. Each entry is limited to 100 characters, and scientific notation exponents must be between negative 100 and positive 100. These limits keep classroom calculations manageable in a browser. Irrational constants, complex numbers and symbolic variables are outside this tool's scope.
Worked example: inverse by Gauss-Jordan elimination
The loaded matrix is A = [[1,2],[3,4]]. Its inverse is [[−2,1],[3/2,−1/2]]. These results and the steps below were computed by running the same exact arithmetic library used by the page. The second grid starts at B = [[5,6],[7,8]].
To find the inverse, append the identity matrix to A, giving [A | I]. Subtract three times the first row from the second row. The second row of the augmented matrix becomes [0,−2,−3,1]. Multiply that row by −1/2 to get [0,1,3/2,−1/2]. Finally, subtract twice the second row from the first row. The left block becomes the identity and the right block is the inverse printed above.
Every displayed row operation applies to the entire augmented row, including the identity block. The vertical separator distinguishes the original coefficient columns from the appended columns. To verify your answer independently, enter the inverse into B and multiply A by B. The product should be the identity. Keep fractions as fractions when copying; replacing them with short decimals changes the problem.
Determinants by two methods
For the loaded matrix, both determinant methods give −2. Cofactor expansion along the first row calculates +(1) × (4) and −(2) × (3), then adds the contributions. The output names the row and column removed for each minor and shows the recursive minor determinants. The alternating signs belong to the cofactor expansion and must be retained even when an entry is negative.
Row reduction instead subtracts three times the first row from the second. The resulting triangular matrix has diagonal entries 1 and −2. Their product is −2. Row replacements preserve the determinant. Every row interchange changes its sign, and the calculator tracks that sign separately. This determinant procedure does not scale pivot rows, which avoids an extra scaling correction. The displayed final expression includes the diagonal product and the row-swap sign.
RREF, pivots and singular matrices
RREF uses elementary row operations to make each pivot equal to one and clear its column above and below. Zero rows end up below pivot rows. The calculator reports rank as the number of pivots and shows the starting matrix followed by a new matrix after every swap, scaling or row replacement. A matrix already in RREF may need no operations beyond the starting snapshot.
For the loaded nonsingular square matrix, RREF is the identity. For A = [[1,2],[2,4]], the RREF is [[1,2],[0,0]] and the rank is one. Its dependent rows prevent the left block of [A | I] from becoming the identity. The inverse operation therefore reports that no inverse exists and keeps the elimination steps available for inspection. A zero determinant is a valid mathematical result, not an input error.
Check the operation and input order
Addition combines matching entries. With the loaded matrices it gives [[6,8],[10,12]]. Multiplication uses row-column dot products and gives [[19,22],[43,50]]. Transpose exchanges rows and columns, giving [[1,3],[2,4]] for A. Matrix multiplication generally depends on operand order; the multiply button always calculates A times B.
Editing a grid, changing dimensions or changing the determinant method clears the previous answer. Choose an operation again to calculate from the new inputs. Load example restores the original grids and inverse result. Compare the displayed operations with your written work when preparing for a midterm or final exam. For individual scalar checks, use the scientific calculator.