Matrix Calculator
Type or paste matrices up to 6 × 6 and get the determinant, inverse, product, RREF, rank, eigenvalues and more. Answers come as exact fractions (or decimals) with every step shown.
Type or paste the whole matrix
Type or paste the whole matrix
Each row of A is one equation: the numbers before x₁, x₂, x₃ … and b is what it equals.
Cells take whole numbers, decimals or fractions: 3, −2.5, 3/4 or 1 1/2. An empty cell counts as 0. The maths is always done exactly.
How your answer is worked out
Your matrix, step by step: check the size, pick the rule, do the work, then read off the answer.
- 1
Read your matrix
A is 3 × 3row 1: 2, −1, 0square ✓
- 2
Rule: make a triangle
zeros underthe diagonaldet = diagonal product
- 3
Work it out
R2 → R2 − (1/2)R1R3 → R3 − (2/7)R20 swaps
- 4
Your answer
2 × (7/2) × (24/7)det(A) = 24
Read more: the formulas, a worked example and every operation explained
A matrix is a grid of numbers with rows and columns. A 2 × 3 matrix has 2 rows and 3 columns. Matrices hold systems of equations, rotations and other transformations, networks and data tables. This calculator does every common operation exactly: decimals you type become fractions (0.1 is 1/10), so there is no rounding until you ask for decimals at the end.
The formula
A ± B: add or subtract matching cells (same size)
A × B: cᵢⱼ = row i of A · column j of B (columns of A = rows of B)
2 × 2 determinant: det = ad − bc
n × n determinant: det(A) = Σ (−1)^(i + j) × aᵢⱼ × det(minor ij) along any row or column
inverse: A⁻¹ = adj(A) ÷ det(A), or [A | I] → [I | A⁻¹]
trace = a₁₁ + a₂₂ + … + aₙₙ; rank = number of pivots in the RREF
eigenvalues: det(A − λI) = 0; eigenvectors: (A − λI)v = 0
system Ax = b: row-reduce [A | b], or xᵢ = det(Aᵢ) ÷ det(A) (Cramer)
Worked example
Take A with rows (2, −1, 0), (1, 3, 2) and (0, 1, 4). Determinant by cofactors along row 1: 2 × (3 × 4 − 2 × 1) − (−1) × (1 × 4 − 2 × 0) + 0 × (1 × 1 − 3 × 0) = 2 × 10 + 4 + 0 = 24. By row reduction: R2 → R2 − (1/2)R1 makes row 2 (0, 7/2, 2), then R3 → R3 − (2/7)R2 makes row 3 (0, 0, 24/7). There were no swaps, so det(A) = 2 × 7/2 × 24/7 = 24.
Inverse: the cofactors are C₁₁ = 10, C₁₂ = −4, C₁₃ = 1, C₂₁ = 4, C₂₂ = 8, C₂₃ = −2, C₃₁ = −2, C₃₂ = −4, C₃₃ = 7. Transposing gives adj(A) with rows (10, 4, −2), (−4, 8, −4), (1, −2, 7). Divide by 24: A⁻¹ has rows (5/12, 1/6, −1/12), (−1/6, 1/3, −1/6) and (1/24, −1/12, 7/24).
Solving Ax = b with b = (1, 8, 9): x = A⁻¹b. x₁ = 5/12 × 1 + 1/6 × 8 − 1/12 × 9 = (5 + 16 − 9)/12 = 1. x₂ = −1/6 + 8/3 − 9/6 = (−1 + 16 − 9)/6 = 1. x₃ = 1/24 − 8/12 + 63/24 = (1 − 16 + 63)/24 = 2. So x₁ = 1, x₂ = 1, x₃ = 2, and A × (1, 1, 2) = (1, 8, 9) checks out.
Which sizes work for each operation
| Operation | Sizes needed | Answer size |
|---|---|---|
| A + B, A − B | Same size | Same size |
| A × B | A is m × n, B is n × p | m × p |
| k × A, transpose | Any | Same / n × m |
| Determinant, inverse, trace, power, eigenvalues, LU | Square (n × n) | Number or n × n |
| RREF, REF, rank | Any | Same size / a number |
| Solve Ax = b | b has one number per row of A | One value per column of A |
Row operations
There are three: swap two rows (Rᵢ ↔ Rⱼ), multiply or divide a row by a non-zero number (Rᵢ → Rᵢ ÷ 2), and add a multiple of one row to another (R₂ → R₂ − 3R₁). They never change the solutions of a system or the rank. For a determinant, a swap flips the sign, dividing a row by k divides the determinant by k, and adding a multiple of a row changes nothing.
Systems with no solution or many solutions
If a row of the reduced [A | b] reads 0 = 5, the equations contradict each other and there is no solution. The calculator then also gives the least-squares best fit, the x that makes Ax as close to b as possible (it solves AᵀA x = Aᵀb when that has one answer). If a column of A has no pivot, its unknown is free: it can be any number, written t, s, r …, and the others are given in terms of it.
Eigenvalues: exact or numeric
The eigenvalues are the roots of the characteristic polynomial det(λI − A). The calculator finds it exactly and tests fractions p/q (the rational root test). What is left, if it is a quadratic or splits into quadratics, is solved exactly with the quadratic formula, giving answers like 1/2 ± √5/2 or 1 ± 2i. Anything else is found numerically with the QR algorithm (repeated QR factorisations of the matrix) and shown as decimals. A repeated eigenvalue with fewer eigenvectors than its count means the matrix can’t be diagonalised.
Typing and pasting
- Copy cells in Excel, Google Sheets or Numbers and paste into any cell: the grid grows to fit (up to 6 × 6).
- Or open “Type or paste the whole matrix” and type rows separated by semicolons or new lines: 1 2 3; 4 5 6. [[1, 2], [3, 4]] works too.
- Use ↑ ↓ or Enter to move between rows. An empty cell counts as 0.
- “Copy answer” copies the result with tabs, so it pastes back into a spreadsheet as cells.
All results except numeric eigenvalues are exact. Very large powers can make numbers with hundreds of digits; the calculator stops if they get too big to show.
Common questions
How do you find the determinant of a 3 × 3 matrix?
Expand along a row: multiply each number by the determinant of the 2 × 2 left when you cross out its row and column, with signs + − +. For the rows (2, −1, 0), (1, 3, 2), (0, 1, 4): 2 × (3 × 4 − 2 × 1) − (−1) × (1 × 4 − 2 × 0) + 0 = 20 + 4 = 24. Row reducing to a triangle and multiplying the diagonal gives the same 24.
How do you find the inverse of a matrix?
Write A next to the identity, [A | I], and row-reduce until the left side is I. The right side is then A⁻¹. For a 2 × 2, swap a and d, change the signs of b and c, and divide by ad − bc. For (4, 7), (2, 6): ad − bc = 24 − 14 = 10, so A⁻¹ = (3/5, −7/10), (−1/5, 2/5). If the determinant is 0, there is no inverse.
How do you multiply two matrices?
The number of columns in A must equal the number of rows in B. Each answer cell is a row of A times a column of B: multiply the pairs and add. With A’s first row (2, −1, 0) and B’s first column (1, 0, 3), the top-left cell is 2 × 1 + (−1) × 0 + 0 × 3 = 2. A × B is usually not the same as B × A.
What are RREF and rank?
Reduced row echelon form (RREF) is what you get when row operations leave a leading 1 in each pivot column with zeros above and below it. The rank is the number of those leading 1s, which is the number of independent rows. For the rows (1, 2, 3), (4, 5, 6), (7, 8, 9) the RREF has a row of zeros, so the rank is 2.
How do you solve a system of equations with matrices?
Put the coefficients in A and the right-hand sides in b, then row-reduce [A | b]. For 2x − y = 1, x + 3y + 2z = 8 and y + 4z = 9, the RREF reads x = 1, y = 1, z = 2. A row that says 0 = 5 means there is no solution, and a column without a pivot means infinitely many.
What are eigenvalues and eigenvectors?
An eigenvector v is only stretched by A, not turned: Av = λv, and λ is its eigenvalue. Find λ by solving det(A − λI) = 0. For the rows (4, 1), (2, 3) that is λ² − 7λ + 10 = 0, so λ = 5 or λ = 2, with eigenvectors (1, 1) and (−1, 2).
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.