Matrix Calculator
Add, subtract and multiply matrices, and find the determinant, inverse, transpose or a power, up to 8 × 8, with exact fractions and the working shown: cofactors, row operations and the row-times-column rule.
How to Use
- Choose the operation: A + B, A − B, A × B, det A, A⁻¹, Aᵀ or Aⁿ.
- Type matrix A one row per line, with the entries separated by spaces or commas. Fractions such as 1/2 are fine.
- For two-matrix operations type B the same way; for a power, set n (negative powers use the inverse).
- Read the result drawn as a matrix, with its size, determinant and trace; click a table cell to copy it.
- Show Work gives the cofactor expansion, the Gauss–Jordan row operations or the first dot product.
Worked Example
Inverse of [[1, 2], [3, 4]]. det = 1·4 − 2·3 = −2. Swap the diagonal, negate the others and divide by −2: [[4, −2], [−3, 1]] ÷ −2 = [[−2, 1], [3/2, −1/2]]. Check: [[1, 2], [3, 4]] × [[−2, 1], [3/2, −1/2]] = [[1, 0], [0, 1]].
A 3 × 3 determinant. For [[2, 0, 1], [1, 3, 2], [1, 1, 2]], expand along the first row: 2·(3·2 − 2·1) − 0·(…) + 1·(1·1 − 3·1) = 2·4 + 1·(−2) = 6.
The common mistake: multiplying entry by entry. [[1, 2], [3, 4]] × [[5, 6], [7, 8]] is not [[5, 12], [21, 32]]. Each entry is a row times a column: the top-left is 1·5 + 2·7 = 19.
Show Work
Formulas
Arrays Before Algebra
The Chinese Nine Chapters on the Mathematical Art (around 200 BC) solved systems of equations by arranging the coefficients in a grid and reducing it, essentially Gaussian elimination. Determinants appeared in Japan with Seki Takakazu and in Europe with Leibniz in the 1680s, long before matrices themselves.
Arthur Cayley defined matrix multiplication and the inverse in 1858, treating the grid as a single object. Werner Heisenberg’s 1925 quantum mechanics turned out to be matrix algebra, and today matrix multiplication is the core operation of computer graphics and machine learning.
About This Calculator
This calculator handles matrices up to 8 × 8 with exact fractions, so inverses come out as 3/2 rather than 1.5000001. It adds, subtracts and multiplies, finds determinants by cofactors or elimination, inverts by Gauss–Jordan with the check A × A⁻¹ = I, transposes, and raises to whole powers (negative ones through the inverse). For eigenvalues, rank and systems, use the Linear Algebra Lab.
Everything runs in your browser; nothing is sent anywhere.
Related calculators: Linear Algebra Lab, 3D Vector Lab, and Fraction Calculator.
Frequently Asked Questions
How do I multiply two matrices?
Each entry of A × B is a row of A times a column of B: multiply matching entries and add. For [[1, 2], [3, 4]] × [[5, 6], [7, 8]], the top-left entry is 1·5 + 2·7 = 19, and the whole product is [[19, 22], [43, 50]]. The number of columns of A must equal the number of rows of B, and A × B usually differs from B × A.
How do I find a determinant?
For 2 × 2, det [[a, b], [c, d]] = ad − bc: det [[1, 2], [3, 4]] = 4 − 6 = −2. For 3 × 3, expand along a row with alternating signs: each entry times the determinant of the 2 × 2 left when its row and column are removed. Bigger matrices are reduced to triangular form, where the determinant is the product of the diagonal.
How do I find the inverse of a matrix?
Write [A | I] and use row operations to turn A into the identity; the right half becomes A⁻¹. For 2 × 2 there is a shortcut: swap a and d, negate b and c, divide by the determinant. [[1, 2], [3, 4]]⁻¹ = 1/(−2) × [[4, −2], [−3, 1]] = [[−2, 1], [3/2, −1/2]].
When does a matrix have no inverse?
When its determinant is 0. Then the rows (and columns) are linearly dependent, one row is a combination of others, and the matrix squashes space into fewer dimensions, so the transformation can’t be undone. [[1, 2], [2, 4]] is singular because the second row is twice the first.
What are matrix powers used for?
Repeating a transformation or a step of a process. [[1, 1], [1, 0]]ⁿ contains Fibonacci numbers: the 10th power is [[89, 55], [55, 34]]. Powers of transition matrices give the probabilities of a Markov chain after n steps, and powers of rotation matrices turn repeatedly.
How do I use the Matrix Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Linear systems
Solve Ax = b as x = A⁻¹b once you have the inverse.
Homework
det [[2, 0, 1], [1, 3, 2], [1, 1, 2]] = 6 by cofactors.
Fibonacci
[[1, 1], [1, 0]]¹⁰ = [[89, 55], [55, 34]].
Graphics
Combine a rotation and a scaling into one matrix by multiplying.
Markov chains
A transition matrix squared gives two-step probabilities.
Last updated: