Perform matrix operations: addition, subtraction, multiplication, transpose, determinant, inverse, and scalar multiplication for 2×2 and 3×3 matrices.
Supports square 2 × 2 and 3 × 3 matrices. Fill in every cell; the singular test compares the determinant with the size of its own terms.
Enter matrix values to see results.
| Operation | Formula / Notes |
|---|---|
| Addition | C[i,j] = A[i,j] + B[i,j] |
| Multiply | C[i,j] = Σ A[i,k]·B[k,j] |
| Transpose | Aᵀ[i,j] = A[j,i] |
| det(2×2) | ad − bc |
| det(3×3) | Cofactor expansion along row 1 |
| Inverse 2×2 | (1/det)·[[d,−b],[−c,a]] |
| Inverse 3×3 | (1/det)·adjugate(A) |
| Scalar | (kA)[i,j] = k·A[i,j] |
| Property | Formula |
|---|---|
| (AB)ᵀ | = BᵀAᵀ |
| (AB)⁻¹ | = B⁻¹A⁻¹ |
| det(AB) | = det(A)·det(B) |
| det(Aᵀ) | = det(A) |
| A·A⁻¹ | = I (identity matrix) |
Matrix multiplication is not the same as multiplying matching entries, and A times B is usually not B times A. This calculator performs the true row-by-column product, along with addition, subtraction, scalar multiplication, transpose, determinant and inverse for square 2×2 or 3×3 grids. It also tells you plainly when a matrix has no inverse instead of returning a column of nonsense.
Typical case: A = [[1, 2], [3, 4]] and B = [[0, 1], [1, 0]]. Each entry of A × B is a row of A times a column of B, summed. The top-left entry is 1 × 0 + 2 × 1 = 2, and the full product is [[2, 1], [4, 3]]. Reverse the order and B × A = [[3, 4], [1, 2]], which is different. Multiplying matching entries would give [[0, 2], [3, 0]], and this page deliberately does not offer that because it is not matrix multiplication.
For the same A, det(A) = 1 × 4 − 2 × 3 = −2. It is not zero, so an inverse exists: (1 ÷ det) × [[d, −b], [−c, a]] = (1 ÷ −2) × [[4, −2], [−3, 1]] = [[−2, 1], [1.5, −0.5]]. For 3×3 matrices the page expands the determinant along the first row and builds the inverse as the adjugate divided by the determinant. For example, [[2, 0, 1], [1, 3, 2], [1, 1, 4]] has determinant 18.
Edge case: [[2, 4], [1, 2]] has det = 2 × 2 − 4 × 1 = 0, so the page answers that the matrix is singular and no inverse exists. A grid like [[1, 2, 3], [4, 5, 6], [7, 8, 9]] looks harmless but also has determinant 0, since its rows rise in steps of 3. The singular test is relative: the page compares |det| with the size of the products that make it up and calls the matrix singular only when |det| is at most 1e-12 times that size. A matrix with 1e-7 on its diagonal (determinant 1e-14, but products of the same size) is therefore inverted correctly and returns [[10000000, 0], [0, 10000000]]. Any blank cell stops the calculation, so type 0 explicitly. Very small or very large results are shown in exponent form, and a result that overflows gets a message.
Two sanity checks worth running. The 3×3 determinant above expands along the first row as 2 × (3 × 4 − 2 × 1) − 0 × (1 × 4 − 2 × 1) + 1 × (1 × 1 − 3 × 1) = 20 − 0 − 2 = 18. And determinants multiply: det(A) = −2 and det(B) = −1 for the earlier pair, and det(A × B) = 2 × 3 − 1 × 4 = 2, which equals −2 × −1.
No. Only square 2×2 and 3×3 grids are available, so the rectangular case is not supported.
Sometimes, for example when one matrix is the identity or both are diagonal. In general it is not, as the example above shows.
That the rows or columns are dependent, so the matrix squashes space flat and cannot be undone. That is why no inverse exists.
Multiply A by the inverse with the Multiply operation, typing the inverse into Matrix B. You should see the identity matrix, [[1, 0], [0, 1]] for 2×2, within rounding.
Yes. With k = -1 every entry changes sign. A blank or non-numeric k produces no result.
No. Adding the diagonal gives the trace. For [[1, 2], [3, 4]] the trace is 5 and the determinant is -2. This page calculates only the determinant.