Free Matrix Calculator
Add, subtract, multiply, transpose, invert, and reduce matrices, plus determinant, rank, eigenvalues, and solving Ax = b — up to 8×8, with one-tap copy. Free and private.
A full matrix calculator — determinant, inverse, multiply, RREF, rank, eigenvalues, and solve Ax = b — running entirely in your browser.
Cells accept whole numbers, decimals (1.5 or 1,5), fractions (1/3, -2/5) and simple expressions like sqrt(2), pi or 2^3. The shaded column b is the right-hand side for Solve Ax = b.
Tip: paste a whole matrix from Excel or Google Sheets straight into a grid, and move between cells with the arrow keys.
🔒 Every calculation happens locally in your browser — nothing you type is sent anywhere.
Common uses
- Determinant CalculatorFind the determinant of any square matrix up to 8×8 using stable Gaussian elimination.
- Matrix Inverse CalculatorCompute A⁻¹ via Gauss-Jordan elimination, or learn why a matrix is not invertible.
- Matrix Multiplication CalculatorMultiply two matrices, with an automatic check that the inner dimensions match.
- Matrix Transpose CalculatorFlip a matrix over its diagonal to swap its rows and columns.
- Eigenvalue CalculatorFind the eigenvalues of a square matrix, including complex ones.
- RREF CalculatorReduce any matrix to reduced row echelon form step toward solving systems.
How It Works
A full matrix calculator: add, subtract and multiply two matrices, or transpose, find the determinant, inverse, reduced row echelon form (RREF), rank, eigenvalues, and solve a linear system Ax = b — for matrices up to 8×8. The core operations use numerically stable Gaussian elimination with partial pivoting and run entirely in your browser.
- 1Size your matricesUse the steppers to set the rows and columns of A and B (1–8). Fill with random numbers, the identity, or zeros to start quickly.
- 2Type the valuesEnter each cell — decimals and negatives are fine. Non-numeric cells are flagged.
- 3Pick an operationA+B, A−B, A×B (checks that columns of A equal rows of B), transpose, determinant, inverse, RREF, rank, eigenvalues, or solve Ax = b (B's first column is b).
- 4Copy the resultCopy the answer as tab-separated text to paste into a spreadsheet. Nothing is uploaded.
Every calculation happens locally in your browser — nothing you type is sent anywhere.
Guide
Worked example
Click into Matrix A and type 2 and 1 in the top row, then 1 and 3 in the bottom row. Press "det(A)" and the result reads "det(A) = 5"; opening "Step-by-step working (1)" shows "ad − bc = 2·3 − 1·1 = 5". Press "Inverse A" and the result grid shows 3/5, -1/5, -1/5 and 2/5, with five steps that start at "[A | I]". Under "Show answers as", pick "Decimals" and the same grid reads 0.6, -0.2, -0.2 and 0.4. The shaded column b already holds 1 and 2, so "Solve Ax = b" returns a column of 1/5 and 3/5. "Characteristic polynomial" gives "p(λ) = λ² − 5λ + 5", and "Eigenvalues & eigenvectors" gives 1.381966 and 3.618034. Editing any cell clears the old answer, so press the operation again.
Which settings to use, and the limits
- Type each cell the way you would write it. A cell takes whole numbers, decimals (1.5 or 1,5), fractions (1/3, -2/5) and simple expressions such as sqrt(2), pi, e, abs(-3), 2^3, (1+2)/3 and 2pi. The signs × ÷ − and ** also work. A lone comma is a decimal comma, so "1,5" is 1.5, but if a cell has both a comma and a point, the commas are dropped and "1,000.5" is 1000.5. Decimals are read exactly, so 0.5 is held as 1/2. An empty cell, a division by zero and the square root of a negative number are rejected, and the cell gets a red outline.
- Set the size, and use the b column for equations. Matrix A and Matrix B each go from 1 to 8 rows and 1 to 8 columns, set with the − and + buttons next to "Rows" and "Cols". New cells start at 0 and cells you keep are unchanged. "Random" fills with whole numbers from -9 to 9, "Identity" puts 1 on the diagonal and "Zeros" clears the grid. The shaded column b beside Matrix A is the right-hand side for "Solve Ax = b" and always has one entry per row of A. The arrow keys and Enter move between cells, and Enter goes down.
- Match the operation to the shape of the matrix. "A + B" and "A − B" need two grids of the same size. "A × B" needs the columns of A to equal the rows of B, so a 2 × 3 A multiplies a 3 × 2 B. "det(A)", "Inverse A", "Trace (A)", "Characteristic polynomial", "Eigenvalues & eigenvectors", "A^k" and "Solve Ax = b" all need a square A. "Transpose A", "RREF A", "rank(A)" and "k · A" work on any size. The buttons sit under "On matrix A", "A and B together", "Solve a linear system" and "With a number k".
- Know when the answer is exact and when it is rounded. If every cell used is a whole number, decimal or fraction, the answer is exact: the 2 × 2 inverse above is 3/5, not 0.6. Then det, inverse, RREF and Solve list their row operations under "Step-by-step working". A cell with sqrt(2), pi or e switches that calculation to decimals shown to 6 places, and the page says "Step-by-step working needs exact entries (integers, decimals or fractions). Cells with sqrt, pi or e are calculated in decimals." The "Fractions" and "Decimals" buttons only change the display, and a fraction with a numerator or denominator of a billion or more is shown as a decimal in both.
- Use the eigenvalue button for a square matrix. "Eigenvalues & eigenvectors" is the one operation that uses a separate maths engine. It loads the first time you press the button, which reads "Loading…" meanwhile, and it works in decimals with no steps. Complex pairs are shown as "±i" or "1 ± 2i". Eigenvectors are scaled so the first non-zero entry is 1, which can differ from a textbook that scales them another way. For A = [[2, 1], [1, 3]] the value 1.381966 pairs with (1, -0.618034) and 3.618034 with (1, 1.618034).
- Paste from a spreadsheet, and copy answers out. Paste a block of cells from Excel or Google Sheets into either grid and it resizes to fit, up to 8 × 8; extra rows and columns are cut off, and cells missing from a short row become 0. Rows are separated by new lines, and cells by tabs, semicolons or spaces. Pasting into a b cell takes the first column of what you paste. Under a matrix result, "Copy for Excel" copies tab-separated cells, "Copy LaTeX" copies a bmatrix with fractions as \frac, and "Use as A" or "Use as B" moves the answer into a grid with exact fractions kept.
Common problems and how to fix them
- It says "Cell A12 isn't a number or expression we can read. Try 3, 1/3, 1,5, sqrt(2) or pi." (with your own cell name).
- The name is the row then the column, so A12 is row 1, column 2 of Matrix A. A b cell is named by its row, such as b2. Causes include an empty cell, letters other than pi, e, sqrt and abs, a division by zero such as 1/0, the square root of a negative number, two numbers separated only by a space, or a bracket left open. Only the grids the button uses are checked, so a bad cell in Matrix B does not stop "det(A)".
- It says "Dimension mismatch — the number of columns in A must equal the number of rows in B." or "Dimension mismatch — both matrices must be the same size."
- The first message belongs to "A × B", the second to "A + B" and "A − B". Compare the Rows and Cols of the two grids. A 2 × 3 Matrix A needs a Matrix B with 3 rows to multiply, and a sum needs both grids to have the same rows and columns. Resize with the − and + buttons; cells you keep stay as they are and new cells start at 0.
- It says "The determinant is 0 — this matrix has no inverse."
- A square matrix whose rows depend on each other, such as [[1, 2], [2, 4]], has determinant 0 and no inverse. "det(A)" gives 0 and "rank(A)" gives 1, which is less than the 2 rows. For cells with sqrt, pi or e, a pivot smaller than 1e-10 counts as zero, so a nearly singular matrix can be reported this way. A^k with a negative k uses the inverse and gives the same message.
- It says "The coefficient matrix is singular — the system has no unique solution." or "No solution — the system is inconsistent."
- "Solve Ax = b" reads Matrix A and the shaded b column. Singular means the rows of A depend on each other, so there are either no solutions or many; the tool does not list a family of solutions. Inconsistent means the equations contradict each other. With A = [[1, 2], [2, 4]], b = (1, 2) gives the first message and b = (1, 3) the second. A non-square A shows "This operation requires a square matrix."
- It says "Matrix powers need a whole-number exponent k." or "The exponent k must be between -20 and 20."
- "A^k" and "k · A" share the box after "k =", labelled "Scalar k (also the exponent for A^k)". For A^k it must be a whole number from -20 to 20: 2.5 gets the first message and 21 the second. "k · A" takes any number, fraction or expression. If the k box cannot be read at all, you see "Every cell, and k, must be a number or a simple expression such as 1/3, 1,5 or sqrt(2)." A^0 is the identity matrix.
How it compares
This is a quick matrix calculator for grids up to 8 × 8, and it shows its working for the usual course topics: determinant, inverse, RREF and solving a system. Exact fractions make it handy for checking homework or a hand calculation, and the Excel and LaTeX copy buttons move answers elsewhere. It is not a computer algebra system. Cells hold numbers only, so there are no symbolic variables or complex entries. It has no LU, QR or SVD decomposition and no least-squares fit, and "Solve Ax = b" handles a square A with one answer. Eigenvalues come from a numerical method in decimals. For bigger matrices, symbolic work or scripted jobs, use MATLAB, Octave, NumPy or a computer algebra system. Nothing you type is sent anywhere.
Related Tools
Equation Solver
Solve linear, quadratic, and cubic equations plus 2×2 and 3×3 systems — with real and complex roots, the discriminant, and the vertex. Free, private, with steps in your browser.
Ratio Calculator
Simplify a ratio, solve a proportion (a:b = c:x), or split a total into ratio parts.
Barcode Generator
Generate EAN-13/8, UPC, Code 128, Code 39, ITF-14, ISBN, GS1-128, Data Matrix, PDF417 and QR barcodes with correct check digits — download as PNG or SVG. Free for commercial use.