Matrix Calculator
Add, subtract and multiply matrices; determinant, transpose and inverse for 2×2 and 3×3.
Matrix operations are simple rules applied relentlessly. Addition and subtraction are entry-by-entry and need both matrices to be the same shape. Multiplication is the row-by-column rule: each entry of the product is a dot product of a row of A with a column of B, which is why A must have as many columns as B has rows — and why order matters, since A × B and B × A are generally different matrices. The worked example on this page multiplies [[1, 2], [3, 4]] by [[5, 6], [7, 8]] to get [[19, 22], [43, 50]]: the top-left entry is 1×5 + 2×7 = 19, and the other three follow the same pattern.
Determinants and inverses are offered for 2×2 and 3×3 matrices, the sizes that can be written out in full honestly. A singular matrix (determinant 0) has no inverse and the tool says so. Everything is calculated in your browser; nothing is uploaded or stored.
Quick answers
What is [[1, 2], [3, 4]] × [[5, 6], [7, 8]]?
[[19, 22], [43, 50]]. Each entry is a row-by-column dot product: 19 = 1×5 + 2×7, 22 = 1×6 + 2×8, 43 = 3×5 + 4×7, 50 = 3×6 + 4×8.
The product is 2×2 because A is 2×2 and B is 2×2; in general an m×n times an n×p gives an m×p result.
What is the determinant of [[1, 2], [3, 4]]?
−2. For a 2×2 matrix [[a, b], [c, d]] the determinant is ad − bc, here 1×4 − 2×3 = −2.
Because the determinant is not 0, this matrix has an inverse: [[−2, 1], [1.5, −0.5]].
How to use
- Type matrix A, one row per line, with entries separated by commas or spaces.
- For add, subtract or multiply, type matrix B the same way; for determinant, transpose or inverse only A is used.
- Pick the operation from the list.
- Read the result matrix entry by entry — or, for a determinant, the single number, and for an inverse the determinant it was divided by.
About this tool
Determinants and inverses are offered for the sizes that can be written out in full: 2×2 and 3×3. The determinant of [[1, 2], [3, 4]] is 1×4 − 2×3 = −2, and that single number decides whether an inverse exists at all: a determinant of 0 means the matrix is singular — it flattens its input and cannot be undone — so the tool says “no inverse” instead of dividing by zero and dressing the wreckage up as an answer. The transpose, flipping rows into columns, is included for matrices of any shape the page can parse.
Frequently asked questions
Why can some matrices not be multiplied?
Because the row-by-column rule needs matching lengths: to multiply A × B, the number of columns of A must equal the number of rows of B. A 2×3 matrix can multiply a 3×2 matrix (giving a 2×2 product) but not another 2×3. When the shapes do not match, this page says which two numbers disagreed instead of failing silently.
What does a determinant of 0 mean?
That the matrix is singular: it squashes space flat in at least one direction, different inputs land on the same output, and no inverse matrix can undo it. Determinant 0 is also the test this page applies before computing an inverse — if det = 0, there is no inverse to compute.
How is a 2×2 inverse calculated?
Swap the two diagonal entries, negate the two off-diagonal entries, and divide everything by the determinant. For [[1, 2], [3, 4]] with determinant −2, the inverse is [[−2, 1], [1.5, −0.5]] — multiply it by the original and you get the identity matrix, which is the check worth doing.
Does matrix multiplication commute — is A × B the same as B × A?
Almost never. Even when both products exist (both matrices square and the same size), the entries generally differ, because each product pairs rows of the first matrix with columns of the second, and swapping the factors changes every pairing. Equal products are the special case, not the rule.
First time embedding? Read the step-by-step guide →
More free tools
Scientific Calculator
Full scientific calculator: trig, logs, powers, factorial. Free, private, runs in your browser.
Fraction Calculator
Add, subtract, multiply and divide fractions — reduced, as a mixed number and as a decimal.
Percentage Calculator
Work out percentages, increases and discounts in one click.
Age Calculator
Find your exact age in years, months and days.
BMI Calculator
Check your Body Mass Index in seconds.
Tip Calculator
Split the bill and work out the tip in seconds.