A 2x2 matrix calculator for students and anyone working through introductory linear algebra. Enter the four numbers of one or two two-by-two matrices and add, subtract or multiply them, or find the determinant and inverse of a single matrix — all instantly and in your browser.
How it works
Writing a matrix as [a b; c d], the five operations are:
- Add / subtract — element by element:
[a₁±a₂ b₁±b₂; c₁±c₂ d₁±d₂]. - Multiply — row-by-column dot products.
A × B = [ae+bg, af+bh; ce+dg, cf+dh], where B =[e f; g h]. - Determinant —
det = ad − bc, a single number. - Inverse —
1 ÷ (ad − bc) × [d −b; −c a]. If the determinant is zero the matrix is singular and has no inverse; the tool reports this instead of dividing by zero.
Worked example
For A = [1 2; 3 4]:
- Determinant =
(1×4) − (2×3) = 4 − 6 = −2. - Inverse =
1/(−2) × [4 −2; −3 1] = [−2 1; 1.5 −0.5].
Multiplying A by B = [5 6; 7 8]:
[1×5+2×7, 1×6+2×8; 3×5+4×7, 3×6+4×8] = [19 22; 43 50].
| Operation | Formula |
|---|---|
| Determinant | ad − bc |
| Inverse | 1/(ad−bc) × [d −b; −c a] |
| Multiply (A×B) | [ae+bg, af+bh; ce+dg, cf+dh] |
What the operations mean geometrically
2×2 matrices represent linear transformations of the 2D plane — rotations, scaling, shearing, and reflections. Understanding what each operation does geometrically helps make sense of the numbers:
Determinant. The determinant ad − bc equals the signed area of the parallelogram formed by the two column vectors of the matrix. A determinant of 1 means the transformation preserves area; a determinant of 2 means it doubles it; a negative determinant means the transformation includes a reflection (it flips orientation). A determinant of exactly zero means the matrix collapses 2D space onto a line — it destroys one dimension, which is why no inverse exists.
Inverse. The inverse of a matrix is the transformation that undoes it. If A rotates the plane 45°, A⁻¹ rotates it −45°. Multiplying A by A⁻¹ always gives the identity matrix [1 0; 0 1] — the transformation that leaves every point unchanged.
Multiplication order. Matrix multiplication is not commutative — A×B and B×A produce different results in general. This is because the order of transformations matters: rotating then scaling is not the same as scaling then rotating.
Common mistakes to avoid
- Confusing element-wise multiplication (Hadamard product) with matrix multiplication. For 2×2 matrices, the standard multiplication uses the row-by-column dot product, not simple element-by-element products.
- Expecting an inverse when the determinant is zero. If
ad = bc, the matrix is singular — check your values if the tool reports no inverse. - Getting the row and column order wrong. Matrix
[a b; c d]hasaandbin the first row,canddin the second. Mixing these up flips the matrix (the transpose) and changes multiplication results.
Nothing is uploaded — all the matrix algebra happens locally on your device.