Determinant, inverse, transpose, and multiplication for 2×2 through 4×4
For a 2×2 matrix [[a, b], [c, d]]: det = ad − bc, and the inverse is (1/det) × [[d, −b], [−c, a]]. So [[4, 7], [2, 6]] has det = 24 − 14 = 10 and inverse [[0.6, −0.7], [−0.2, 0.4]]. A 3×3 determinant expands along a row: [[2, 1, 3], [0, 4, 5], [1, 2, 6]] gives 2(14) − 1(−5) + 3(−4) = 21. If det = 0 the matrix is singular — no inverse exists.
| Operation | Formula | Works when |
|---|---|---|
| 2×2 determinant | det = ad − bc | Always |
| 2×2 inverse | (1/det) × [[d, −b], [−c, a]] | det ≠ 0 |
| 3×3 determinant | a(ei − fh) − b(di − fg) + c(dh − eg) | Always (expansion along row 1) |
| Transpose | Entry (i, j) moves to (j, i) | Always |
| Multiply A × B | Row of A into column of B; (AB)ᵢⱼ = Σₖ AᵢₖBₖⱼ | Columns of A = rows of B |
| Identity I | 1s on the diagonal, 0s elsewhere; A × I = A | Always |
The calculator computes 4×4 determinants and inverses by Gaussian elimination (row reduction with partial pivoting), which is the same method software libraries use. Results are exact for integer-friendly inputs and rounded to 4 decimals otherwise.
Matrices package a system of linear equations into a grid you can compute with. The determinant tells you whether the system has a unique solution, the inverse undoes the transformation, and multiplication chains transformations together. This calculator handles all four operations on square matrices up to 4×4 and shows the formula behind each answer.
For 2×2, it's ad − bc, the difference of the diagonal products. For 3×3, cofactor expansion along the first row: a(ei − fh) − b(di − fg) + c(dh − eg). The determinant is the signed scale factor of the transformation — det 10 means areas grow 10×, det 0 means space collapses flat.
The inverse undoes a matrix: A × A⁻¹ = I, the identity. For 2×2 it's swap-and-negate over the determinant. For 3×3 and 4×4 the calculator uses Gauss-Jordan elimination, row-reducing [A | I] until the left half becomes I and the right half is A⁻¹. Singular matrices (det = 0) get flagged instead of producing garbage.
Transpose flips rows and columns across the main diagonal. Multiplication takes each row of A into each column of B — element (i, j) of the product is the dot product of row i of A with column j of B. Order matters: AB ≠ BA in general, so enter the matrices in the order the problem gives.
Start with A = [[4, 7], [2, 6]]. Determinant: (4)(6) − (7)(2) = 10. Inverse: (1/10) × [[6, −7], [−2, 4]] = [[0.6, −0.7], [−0.2, 0.4]]. Multiply A × A⁻¹ and you get [[1, 0], [0, 1]] — the identity, which is the definition of an inverse and a free way to check your work.
Now 3×3: [[2, 1, 3], [0, 4, 5], [1, 2, 6]]. Expanding along the first row: 2(4·6 − 5·2) − 1(0·6 − 5·1) + 3(0·2 − 4·1) = 2(14) − 1(−5) + 3(−4) = 28 + 5 − 12 = 21. Nonzero, so an inverse exists, and the calculator gives it to 4 decimals: [[0.67, 0, −0.33], [0.24, 0.43, −0.48], [−0.19, −0.14, 0.38]].
Counter-example worth knowing: [[2, 4], [1, 2]] has det = 4 − 4 = 0. The second row is half the first, so the matrix squashes the plane onto a line and no inverse exists.
Multiply the main diagonal, multiply the anti-diagonal, subtract: det = ad − bc. For [[4, 7], [2, 6]] that's (4)(6) − (7)(2) = 24 − 14 = 10. If the result is 0, the matrix is singular and has no inverse.
Swap the diagonal entries, negate the off-diagonal entries, and divide everything by the determinant: inverse = (1/det) × [[d, −b], [−c, a]]. For [[4, 7], [2, 6]], det = 10, so the inverse is [[6/10, −7/10], [−2/10, 4/10]] = [[0.6, −0.7], [−0.2, 0.4]]. Check it: A × A⁻¹ should give the identity matrix.
Cofactor expansion along the first row. For [[2, 1, 3], [0, 4, 5], [1, 2, 6]]: det = 2(4·6 − 5·2) − 1(0·6 − 5·1) + 3(0·2 − 4·1) = 2(14) − 1(−5) + 3(−4) = 28 + 5 − 12 = 21. Expand along whichever row or column has the most zeros — the zeros make minors vanish.
When its determinant is 0 — a singular matrix. Geometrically, the transformation squashes space flat (all of 2D onto a line, or 3D onto a plane), and information is lost that no matrix can recover. Algebraically, some system Ax = b under it has no solution or infinitely many. Rows that are multiples of each other, like [[2, 4], [1, 2]], always produce det = 0.
Yes. AB and BA are usually different matrices, and sometimes only one of them is even defined when the shapes differ. For [[1, 2], [3, 4]] × [[5, 6], [7, 8]] the product is [[19, 22], [43, 50]], but reversing the order gives [[23, 34], [31, 46]]. Multiply row-into-column in the order the problem states.
The matrix with rows and columns swapped: entry (i, j) moves to (j, i). The transpose of [[1, 2, 3], [4, 5, 6]] is [[1, 4], [2, 5], [3, 6]]. A symmetric matrix equals its own transpose, and (AB)ᵀ = BᵀAᵀ — the order flips.