Enter one or two matrices up to 4×4 and pick an operation. Answers are exact fractions, not rounded decimals, and you can show every row operation.
How each operation works
- Add or subtract: combine matching entries. Both matrices must be the same size.
- Multiply A × B: each entry is a row of A times a column of B, multiplied pair by pair and added. A's column count must equal B's row count. A × B is usually not the same as B × A.
- Transpose: rows become columns.
- Determinant: for a 2×2 matrix, ad − bc. Larger ones are found by row reduction: the product of the pivots, with the sign flipped for each row swap.
- Inverse: row-reduce [A | I] until the left side is the identity matrix I. The right side is then A⁻¹. If the determinant is 0, there's no inverse.
- Rank and RREF: reduced row echelon form has a leading 1 in each pivot row and zeros above and below it. The rank is the number of pivots.
2×2 inverse: [a b; c d]⁻¹ = 1/(ad − bc) × [d −b; −c a]
Worked example
For A = [4 7; 2 6], det(A) = 4 × 6 − 7 × 2 = 10. The inverse is 1/10 × [6 −7; −2 4] = [3/5 -7/10; -1/5 2/5], which is [0.6 −0.7; −0.2 0.4] as decimals. Multiply it by A and you get the identity matrix.
Why exact fractions?
Most online matrix tools work in decimals, so the inverse of a matrix like [2 −1 0; −1 2 −1; 0 −1 2] comes back as 0.75, 0.4999999 and similar. This calculator does every step with exact fractions (using arbitrarily large whole numbers), so you get 3/4 and 1/2 exactly, the same as you'd get by hand.
Limits
- Matrices go up to 4×4, with up to about 15 digits per entry.
- Entries must be real numbers. Square roots, π and variables aren't supported: use a decimal approximation instead, and the answer will be exact for that decimal.
- For very large matrices or ones with measured, noisy data, numerical software with partial pivoting is the better tool.
Sources
How we checked this
Before every update, this calculator is run in a real browser with these known answers, and it must match all of them:
- Inverse of [2 −1 0; −1 2 −1; 0 −1 2] is exact: 3/4 1/2 1/4 … ✓
- det [1 2 3; 4 5 6; 7 8 10] = −3 ✓
- 4×4 determinant = −11 ✓
- Fractions: det [1/2 1/3; 1/4 1/5] = 1/60 ✓
- [1 2; 3 4] × [5 6; 7 8] = [19 22; 43 50] ✓
- Rank of [1 2 3; 4 5 6; 7 8 9] is 2 ✓
- [1 2; 2 4] has determinant 0, so no inverse ✓
Last checked October 26, 2026. Spotted something wrong? The math is done in your browser with the formula shown on this page, so you can check any result by hand.
Questions people ask
How do I find the inverse of a matrix?
Write A next to the identity matrix, [A | I], and row-reduce until the left side is I. The right side is A⁻¹. For a 2×2 matrix you can use the shortcut 1/(ad − bc) × [d −b; −c a].
When does a matrix have no inverse?
When its determinant is 0. Then its rows (and columns) are linearly dependent, row reduction leaves a row of zeros, and the matrix is called singular.
What is RREF?
Reduced row echelon form: every nonzero row starts with a 1 (a pivot), each pivot is to the right of the one above, and pivot columns are zero everywhere else. It's what you get by Gauss–Jordan elimination.
Why can't I multiply these two matrices?
For A × B, the number of columns in A must equal the number of rows in B. A 2×3 matrix can multiply a 3×4 matrix, giving a 2×4 result, but not a 2×2 one.
What does the determinant tell me?
How much the matrix scales area (2×2) or volume (3×3), and whether it flips orientation (a negative determinant). A determinant of 0 means it squashes space flat.