MC
Matrix Calculator
Add, subtract, multiply, find the determinant, or invert 2×2 matrices, with results shown in a clean matching grid layout.
More Math Tools
How to Use Matrix Calculator
Fill in the four numbers of Matrix A and Matrix B, then choose an operation: Add, Subtract, Multiply, Det(A), Det(B), or Inverse(A). The result grid, or single number for determinants, updates live. If Matrix A's determinant is zero, the Inverse option clearly explains why no inverse exists instead of showing a broken calculation.
About Matrix Calculator
A matrix is a rectangular grid of numbers used to represent and transform data — from image and video compression, to computer graphics rotations, to solving systems of linear equations in engineering and economics. A 2×2 matrix, the simplest useful size, has four numbers arranged in two rows and two columns, and already supports the same core operations, addition, subtraction, multiplication, determinant, inverse, used on much larger matrices in real applications.
Adding or subtracting two matrices of the same size is straightforward: you simply add or subtract each pair of matching positions. If Matrix A is [[a, b], [c, d]] and Matrix B is [[e, f], [g, h]], then A + B is [[a+e, b+f], [c+g, d+h]], position-by-position, nothing more complicated than ordinary addition repeated four times.
Matrix multiplication is where most people's intuition breaks down, because it is not element-by-element the way addition is. Instead, each entry of the result comes from multiplying a full row of the first matrix by a full column of the second and summing the products — for a 2×2 case, the top-left entry of A×B is (a×e + b×g), combining the first row of A with the first column of B. This "row times column" rule is what makes matrix multiplication useful for chaining transformations, like rotating an image and then scaling it, in a single combined operation, but it also means A×B usually does not equal B×A, unlike ordinary number multiplication.
The determinant of a 2×2 matrix [[a, b], [c, d]] is calculated as (a×d) − (b×c), and it's a single number that captures something essential about the matrix: whether it can be "undone", or inverted, at all, and by how much it scales areas when used as a geometric transformation. If the determinant is zero, the matrix is called singular, and it has no inverse — geometrically, this means the transformation squashes all of 2D space down onto a line or a point, an operation that can't be reversed because information has been permanently lost, since multiple different starting points get mapped to exactly the same result.
Worked example for the determinant: for A = [[3, 2], [1, 4]], det(A) = (3×4) − (2×1) = 12 − 2 = 10.
Worked example for the inverse: for the same matrix A, since det(A) = 10 is nonzero, the inverse exists and is (1/10) × [[4, −2], [−1, 3]], which is [[0.4, −0.2], [−0.1, 0.3]]. Multiplying A by its inverse should give the identity matrix [[1, 0], [0, 1]], a useful way to double-check the answer by hand.
A common misconception, especially for anyone first learning matrices, is assuming matrix multiplication works like addition, multiplying entry-by-entry instead of using the row-times-column rule. Another frequent mistake is assuming every matrix has an inverse the way every nonzero number has a reciprocal; a matrix with a zero determinant simply doesn't, no matter how you try to compute it, which is exactly why this calculator checks for that case explicitly rather than dividing by zero silently.
Details & Tips
The formulas: addition gives [[a+e, b+f], [c+g, d+h]]. Subtraction gives [[a−e, b−f], [c−g, d−h]]. Multiplication, A×B, gives [[a×e + b×g, a×f + b×h], [c×e + d×g, c×f + d×h]]. Determinant is (a×d) − (b×c). Inverse, when the determinant is nonzero, is (1/det) × [[d, −b], [−c, a]].
Worked examples: multiplying A = [[1, 2], [3, 4]] by B = [[2, 0], [1, 2]] gives a top-left entry of (1×2 + 2×1) = 4, a top-right entry of (1×0 + 2×2) = 4, a bottom-left entry of (3×2 + 4×1) = 10, and a bottom-right entry of (3×0 + 4×2) = 8, for a final result of [[4, 4], [10, 8]]. For the inverse of a singular matrix, A = [[2, 4], [1, 2]] has det(A) = (2×2) − (4×1) = 4 − 4 = 0, so Matrix A has no inverse — geometrically, both rows point in the same direction, since row 2 is exactly half of row 1, meaning the transformation collapses 2D space onto a single line.
Edge cases this widget handles: a determinant of exactly zero for the Inverse(A) operation displays "Singular matrix — no inverse (determinant is 0)" instead of dividing by zero or showing "Infinity" in every cell. Non-numeric or empty cells in either matrix stop the calculation and prompt for valid numbers in every cell, rather than silently treating a blank as zero. Determinant results, Det(A) and Det(B), are shown as a single scalar number in a wider box, rather than forcing a 1×1 "grid" that would look inconsistent with the 2×2 result layout used for the other operations. Very large or very small results still format correctly using the same six-decimal, trailing-zero-trimmed display used throughout the rest of this tool.
Practical tip: before computing an inverse, it's often faster to check the determinant first using the Det(A) operation — if it's zero, you already know the inverse doesn't exist and can skip straight to figuring out why, usually because one row is a multiple of the other, meaning the two equations or transformations aren't actually independent of each other. This quick check is exactly what professional tools and textbooks recommend before attempting a full inverse calculation by hand, since attempting it blindly on a singular matrix wastes time on arithmetic that was never going to produce a usable answer in the first place.
Frequently Asked Questions
What size matrices does this support?
Only 2×2 matrices — the simplest useful size that still demonstrates every core matrix operation.
Why isn't matrix multiplication the same as multiplying matching cells?
Matrix multiplication uses a "row times column" rule, summing products across a row and a column, not simple element-by-element multiplication.
What is a determinant used for?
It tells you whether a matrix can be inverted, and by how much the matrix scales area as a geometric transformation.
Why does Inverse(A) sometimes say "Singular matrix"?
This happens when det(A) equals 0 — such a matrix cannot be inverted, since the transformation it represents can't be undone.
Does A×B always equal B×A?
No — unlike ordinary number multiplication, matrix multiplication is generally not commutative; order matters.
How is the determinant calculated?
For a 2×2 matrix [[a,b],[c,d]], det = (a×d) − (b×c).
How is the inverse calculated?
(1/det(A)) × [[d, −b], [−c, a]], only when det(A) is not zero.
Can I check an inverse result myself?
Yes — multiplying Matrix A by its correctly-computed inverse should give the identity matrix [[1,0],[0,1]].
What does Det(B) do differently from Det(A)?
It calculates the determinant of Matrix B instead of Matrix A, using the exact same formula.
Why do results show as a single number for determinants but a grid for other operations?
A determinant is a single scalar value by definition, while addition, subtraction, multiplication and inversion all produce a full 2×2 matrix.
What happens if I leave a cell blank?
The calculator asks you to enter valid numbers in every cell before it will compute a result.
Are larger matrices (3×3 and up) supported?
Not in this tool — it's focused specifically on 2×2 matrices; larger matrices need more advanced elimination-based methods.
Also Available As
matrix math calculator, 2x2 matrix solver, determinant calculator, matrix inverse calculator, linear algebra calculator, matrix multiplication
Explore More Tools
View all toolsFound a Problem?
Let us know if something with Matrix Calculator isn't working as expected.
Something went wrong. Please try again.
Thanks — we'll take a look.