Skip to content
K Knidox Search…
Math · Linear Algebra

Matrix Calculator

Add, subtract, and multiply 2×2 matrices, and get their determinants.

Matrix A
Matrix B
Result (2×2)
19224350

det(A) = -2 · det(B) = -2

To multiply two 2×2 matrices, each entry is the dot product of a row of the first and a column of the second. For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], A × B = [[19, 22], [43, 50]], since 1×5 + 2×7 = 19. The determinant is ad − bc.

How 2×2 matrix operations work

Addition and subtraction are easy — they work element by element, position against matching position. Multiplication is different: each entry of the product is the dot product of a row from the first matrix and a column from the second. That mixing is why order matters.

det [[a, b], [c, d]] = ad − bc

the 2×2 determinant; zero means the matrix is singular (no inverse)

Worked example

Multiply A = [[1, 2], [3, 4]] by B = [[5, 6], [7, 8]]:

  1. 1
    Top row of A against each column of B. 1×5 + 2×7 = 19 and 1×6 + 2×8 = 22 — the top row of the product is [19, 22].
  2. 2
    Bottom row of A against each column of B. 3×5 + 4×7 = 43 and 3×6 + 4×8 = 50 — the bottom row is [43, 50].
  3. 3
    Assemble and check the determinant of A. A×B = [[19, 22], [43, 50]]; det A = 1×4 − 2×3 = −2, so A is invertible.

2×2 operations at a glance

For A = [[a, b], [c, d]] and B = [[e, f], [g, h]].

OperationResultNotes
A + B[[a+e, b+f], [c+g, d+h]]Element by element
A − B[[a−e, b−f], [c−g, d−h]]Element by element
A × B[[ae+bg, af+bh], [ce+dg, cf+dh]]Rows × columns; not commutative
det Aad − bcZero ⇒ no inverse

Why order and the determinant matter

A×B ≠ B×A in general. Matrix multiplication is not commutative — swapping the order usually changes the result, so always keep the factors in order.

A determinant of zero means singular. The matrix collapses area to zero and has no inverse; the corresponding linear system has no unique solution.

The determinant is a scaling factor. Its absolute value is how much the matrix stretches or shrinks area, and a negative sign means it also flips orientation.

What size matrices are supported?
2×2 for now. Larger sizes are planned.
Why does A×B ≠ B×A?
Matrix multiplication isn’t commutative — each product entry mixes a row of one matrix with a column of the other, so the order changes the result.
What does det = 0 mean?
The matrix is singular: it has no inverse, and the associated linear system has no unique solution.
How is multiplication actually computed?
Each entry is the dot product of a row from the left matrix and a column from the right one — for example the top-left entry is ae + bg.
What does the determinant represent?
Its absolute value is the area-scaling factor of the matrix; a negative sign indicates a flip in orientation.
How do I add or subtract two matrices?
Element by element: add or subtract entries in matching positions. Unlike multiplication, the matrices must be the same size and the order does not matter.