How to calculate a matrix inverse
Use this calculator for a square matrix from 1×1 through 8×8. It applies Gauss-Jordan elimination to the augmented matrix [A | I], uses exact fraction arithmetic, and displays the elimination steps.
Enter the matrix, then click Calculate. When the left side reduces to the identity matrix, the right side is A−1.
Enter matrix values
Use Size (n × n) to choose the square grid. The control is limited to 1–8; values outside that range are clamped to the supported range. Changing the size rebuilds the grid and hides the current result and visible error.
Fill every cell with one plain number or simple fraction:
- Signed integers and decimals, such as
-3and2.5 - Fractions, such as
3/4and-7/2
Blank cells, invalid characters, and fractions with a zero denominator produce an error naming the affected cell. Variables, expressions, and code are not accepted.
Calculate and read the result
- Set Size (n × n) and enter a value in every cell.
- Click Calculate to parse the grid and row-reduce [A | I].
- Check Matrix size, Rank, and Status in the result.
For an invertible matrix, the result shows A−1 and the augmented-matrix step list. The steps include row swaps, pivot normalization, row elimination, and the matrix after each step. A singular matrix is reported as having no inverse, with its rank shown.
Copy or download the result
Copy result copies the input matrix, the final inverse or singular status, and the rank. Download result (.txt) downloads the same text output. Neither output includes the displayed elimination steps.
Limits and calculation behavior
- The interface creates square matrices only, from 1×1 through 8×8.
- Each cell accepts one plain number or simple fraction, not variables, expressions, or code.
- Arithmetic uses reduced BigInt-backed fractions instead of floating-point rounding.
- The tool does not evaluate general numerical conditioning beyond its documented size limit.
Reset the calculator
Click Reset to rebuild a blank matrix grid. It hides the result and clears the visible error state.
Privacy and browser processing
The matrix parser and calculation run in the browser, and the local tool script contains no matrix upload. The imported page also loads analytics scripts, so this page does not make an absolute claim that nothing entered on it is sent anywhere.
Frequently asked questions
What is the formula for a matrix inverse?
For a small matrix, the inverse can be written as A−1 = adj(A) / det(A). This calculator uses Gauss-Jordan elimination instead: it row-reduces [A | I] until the left side is the identity matrix, leaving A−1 on the right.
What size matrices can I use?
Use a square matrix from 1×1 through 8×8. The Size (n × n) control is limited to that range, and the interface does not create non-square grids.
How are results kept exact?
Entries are stored as reduced exact fractions with integer numerators and denominators. Row-reduction arithmetic preserves values such as 7/12 instead of rounding them to a decimal.
How does it detect a matrix with no inverse?
If elimination cannot find a pivot for every column on the A side, the rank is lower than the matrix size. The calculator reports the matrix as singular and states that no inverse exists. It does not evaluate general numerical conditioning.
Does the calculator execute my input as code?
No. Each cell is parsed as a plain number or simple fraction such as 3/4. Other characters and expressions are rejected; cell input is not executed as code.