Matrix Calculator
Matrix Calculator
Find the determinant, inverse, rank or transpose of a matrix, or add, subtract and multiply two matrices, up to 6 by 6. Answers are exact fractions, with every step worked out and a check, so an inverse is proved by multiplying back to the identity.
Separate numbers with spaces or commas and rows with new lines or semicolons. Fractions such as 3/4 and decimals are fine.
Result
Check
All arithmetic uses exact fractions, so an inverse such as 3/5 is exact rather than 0.6000000001, and decimals you type are converted to fractions first. Determinants of 2 by 2 and 3 by 3 matrices are worked by cofactors; larger ones by row reduction to a triangle, multiplying the diagonal. Inverses use Gauss Jordan elimination on A beside the identity and are checked by multiplying back. A times B needs A to have as many columns as B has rows. The CSV, image and printed report contain the values you entered, nothing preloaded.
How to use this tool
Choose what to calculate, then type the matrix into the box with one row per line and spaces or commas between the numbers. Semicolons work in place of new lines, so [1 2; 3 4] can be typed on a single line. For A times B, A plus B or A minus B, a second box appears for matrix B. Fractions such as 3/4 and decimals such as 0.25 are fine.
The input people most often get wrong is the size. A determinant or an inverse needs a square matrix, and for A x B the number of columns in A must match the number of rows in B. The size of each matrix is shown under its box, and a plain message explains any mismatch.
What the calculation is doing
Every operation is done with exact fractions. A determinant of a 2 x 2 or 3 x 3 matrix is found by cofactor expansion, the method taught by hand, and larger ones by row reducing to a triangle and multiplying the diagonal. An inverse is found by writing the identity matrix beside A and row reducing until A becomes the identity; the identity has then turned into the inverse.
Because the arithmetic is exact, the inverse can be proved rather than trusted: the calculator multiplies A by its inverse and shows the identity matrix that comes out. The same exactness means an inverse such as 3/5 is shown as 3/5, not 0.6000000001.
![Three panels: [1 2; 3 4] times [5 6; 7 8] with row 1 and column 1 highlighted giving 19, and the reversed product [23 34; 31 46]; a parallelogram with sides (3, 1) and (1, 2) of area 5 equal to the determinant; and [4 7; 2 6] times its inverse [3/5 −7/10; −1/5 2/5] giving the identity](https://calculatgeek.com/wp-content/uploads/2026/09/matrix-multiply-determinant-inverse.png)
What a matrix actually does
A matrix is a transformation. Multiplying a point by a 2 x 2 matrix moves it somewhere else in the plane, stretching, rotating, shearing or flipping the whole grid at once. The columns of the matrix say where the two unit arrows end up, and the determinant is how much any area gets scaled: [3 1; 1 2] turns the unit square into a parallelogram of area 5.
This picture explains the rules that surprise people. Multiplying matrices is doing one transformation after another, and a rotation then a stretch is not the same as a stretch then a rotation, so A x B is usually not B x A. A determinant of 0 means the plane has been squashed onto a line; points that were different have landed in the same place, which is why nothing can undo it and no inverse exists. And determinants multiply, det(AB) = det A x det B, because scaling area twice multiplies the factors.
Rules worth knowing
| Expression | Equals | Example or note |
|---|---|---|
| det(AB) | det A x det B | [1 2; 3 4] and [5 6; 7 8]: (−2)(−2) = 4 = det of the product |
| det(A transpose) | det A | transposing never changes the determinant |
| det(kA), n x n | k to the power n x det A | doubling a 3 x 3 multiplies det by 8 |
| (AB) inverse | B inverse x A inverse | the order reverses |
| (AB) transpose | B transpose x A transpose | the order reverses here too |
| A x I | A | the identity changes nothing |
| AB | usually not BA | [5 6; 7 8] x [1 2; 3 4] = [23 34; 31 46] |
A worked example you can check on paper
Find the inverse of A = [4 7; 2 6]. First the determinant: 4 x 6 − 7 x 2 = 24 − 14 = 10, which is not zero, so an inverse exists. For a 2 x 2 matrix, swap the diagonal entries, change the signs of the other two, and divide by the determinant: [6 −7; −2 4] ÷ 10 = [3/5 −7/10; −1/5 2/5].
Check by multiplying. The top left entry of A times the inverse is 4 x 3/5 + 7 x (−1/5) = 12/5 − 7/5 = 1, and the top right is 4 x (−7/10) + 7 x 2/5 = −28/10 + 28/10 = 0. The other two entries come out as 0 and 1, giving the identity matrix, so the inverse is right.
Mistakes that catch people out
Multiplying entry by entry. A x B is not the matrix of products of matching entries. Each entry is a row of A times a column of B.
Reversing the order. A x B and B x A are different, and when solving AX = B the answer is A inverse times B, not B times A inverse.
Dropping the alternating signs. In a 3 x 3 cofactor expansion the middle term is subtracted. Forgetting that minus is the most common hand error.
Inverting a nearly singular matrix from rounded data. If the determinant is tiny compared with the entries, small changes in the inputs make huge changes in the inverse.
Assuming det(A + B) = det A + det B. Determinants multiply across products but do not add across sums.
Popular calculations
Each opens the calculator with those matrices filled in, and they can be changed once it is open.
Determinants
Inverses
Multiplying matrices
Adding and subtracting
Transpose and rank
How this was checked
The engine works in exact fractions throughout. Determinants were checked against an independent floating point library, including the 4 x 4 example with determinant 72, and every inverse was multiplied back to confirm the identity exactly. Products were checked entry by entry, and the identities det(AB) = det A x det B and det(A transpose) = det A were confirmed on the examples above. Singular matrices were confirmed to give determinant 0 and no inverse.
Every address in the lists above was then opened and checked for a distinct title, the right answer, drawings that render, and clean CSV, image and print output containing only that calculation, at desktop, tablet and phone widths.
Common questions
How do you find the determinant of a 2 x 2 matrix?
For [a b; c d] the determinant is ad − bc. For [1 2; 3 4] that is 1 x 4 − 2 x 3 = 4 − 6 = −2. For a 3 x 3 matrix, expand along a row: each entry times the determinant of the 2 x 2 left when its row and column are removed, with signs alternating + − +.
How do you find the inverse of a matrix?
For a 2 x 2 matrix [a b; c d], swap a and d, change the signs of b and c, and divide by the determinant: [4 7; 2 6] has determinant 10, so its inverse is [6 −7; −2 4] ÷ 10 = [3/5 −7/10; −1/5 2/5]. For larger matrices, row reduce [A | I] until the left half is the identity.
When does a matrix have no inverse?
When its determinant is 0. Then at least one row is a combination of the others, the matrix squashes space into fewer dimensions, and the lost information cannot be recovered. [1 2; 2 4] is an example: its second row is twice the first.
How do you multiply two matrices?
Each entry of A x B is a row of A times a column of B, multiplied term by term and added. For [1 2; 3 4] x [5 6; 7 8], the top left entry is 1 x 5 + 2 x 7 = 19. A must have as many columns as B has rows.
Why is A x B not equal to B x A?
Matrix multiplication combines rows of the first with columns of the second, so swapping them combines different numbers. [1 2; 3 4] x [5 6; 7 8] = [19 22; 43 50], but the other order gives [23 34; 31 46]. Order matters, like applying two transformations one after the other.
What is the rank of a matrix?
The number of independent rows, found by counting the leading 1s after row reduction. [1 2 3; 4 5 6; 7 8 9] has rank 2 because its third row is twice the second minus the first. A square matrix has an inverse only if its rank equals its size.
Related Calculators and Reference
- System of Equations Calculator: solve AX = B for two or three unknowns, step by step.
- Fraction Calculator: work with the exact fraction entries.
- Scientific Calculator: evaluate single entries and cofactors.
- Trig Calculator: the sines and cosines inside rotation matrices.
- Vector Calculator: dot and cross products, and the angle between two vectors.
- NIST DLMF 1.3: Determinants: formal definitions and properties of determinants.
