CalcPro

Matrix Calculator

Add, subtract or multiply 2×2 / 3×3 matrices and find determinants.

How it works

A matrix is a rectangular grid of numbers, and this calculator performs the four operations you reach for most: addition, subtraction, multiplication and determinant. Enter each matrix row by row, pick an operation, and the result updates immediately — all computed in your browser.

The formula

Addition/subtraction: add or subtract each pair of matching entries — Cᵢⱼ = Aᵢⱼ ± Bᵢⱼ. Both matrices must be the same size.

Multiplication: entry Cᵢⱼ is the dot product of row i of A and column j of B — Cᵢⱼ = Σ Aᵢₖ·Bₖⱼ. The number of columns in A must equal the number of rows in B.

Determinant (2×2): det = ad − bc for matrix [[a,b],[c,d]]. Determinant (3×3): expand along the top row using the standard cofactor expansion.

Worked example

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

  • C₁₁ = (1×5)+(2×7) = 19
  • C₁₂ = (1×6)+(2×8) = 22
  • C₂₁ = (3×5)+(4×7) = 43
  • C₂₂ = (3×6)+(4×8) = 50
  • Result: [[19, 22], [43, 50]]

For the determinant of A alone: det = (1×4) − (2×3) = 4 − 6 = −2. Since it's non-zero, A is invertible.

Tips

  • Double-check dimensions before multiplying — A×B only works when A's column count matches B's row count; this is the most common input mistake.
  • A zero determinant is a signal, not an error — it means the matrix can't be inverted and any linear system it represents either has no solution or infinitely many.
  • Matrix multiplication order matters. If you need B×A instead of A×B, swap the inputs — don't assume the result will be the same.

Frequently asked questions

How do I enter a matrix?

Type rows separated by semicolons and values separated by commas. For a 2×2 matrix "1, 2; 3, 4" means row one is 1, 2 and row two is 3, 4.

Can I add or subtract matrices of different sizes?

No — addition and subtraction require both matrices to have identical dimensions, since the operation is element-by-element. The calculator will flag a mismatch rather than guess.

What does a determinant tell you?

The determinant is a single number that describes a square matrix's scaling effect and whether it's invertible. A determinant of zero means the matrix is singular — it has no inverse, and the system of equations it represents has no unique solution.

Does matrix multiplication work like regular multiplication?

No. Matrix multiplication multiplies rows of A by columns of B and sums the products, and crucially A×B usually does not equal B×A. The number of columns in A must match the number of rows in B.

What sizes does this calculator support?

2×2 and 3×3 matrices, which cover the large majority of textbook and applied linear-algebra problems (transformations, systems of two or three equations, determinants for area/volume).