Matrix Calculator
Add, subtract, scale, multiply or transpose matrices up to 3×3, and find the determinant or inverse — with the result laid out as a grid and shaded by magnitude.
- Operation
- A + B
- Result
- matrix
Calculator
Result heatmap
Step-by-step solution
- c₁₁ = 1 + 5 = 6
- c₁₂ = 2 + 6 = 8
- c₂₁ = 3 + 7 = 10
- c₂₂ = 4 + 8 = 12
About this calculator
This calculator performs the most common matrix operations on matrices up to 3×3: addition, subtraction, scalar multiplication, matrix multiplication, transpose, determinant, and inverse. Enter your matrix values, pick an operation, and the result appears instantly alongside a magnitude heatmap that highlights the relative size of each entry.
How to read your results
For scalar operations such as the determinant, the headline number is the result. For matrix operations the result card names the operation, and the heatmap grid below it shows the output matrix — each cell is shaded according to how large its absolute value is relative to the biggest entry, so you can spot dominant entries at a glance. The stat strip at the top of the page confirms the current operation and whether the output is a scalar or a full matrix.
How it's calculated
Addition and subtraction add or subtract corresponding entries. Scalar multiplication multiplies every entry by the constant k. Matrix multiplication follows the dot-product rule: entry (i, j) of the result is the dot product of row i of A and column j of B. The transpose flips a matrix over its main diagonal, exchanging rows and columns. The determinant is computed by cofactor expansion along the first row (Wolfram MathWorld: Determinant). The inverse uses the adjugate divided by the determinant (Wolfram MathWorld: Matrix Inverse); a singular matrix with determinant 0 has no inverse.
Worked example
Set both matrices to 2×2, choose Multiply, and use A = [[1, 2], [3, 4]] with B = [[5, 6], [7, 8]].
The product A × B is [[19, 22], [43, 50]]. Entry (1,1) = 1×5 + 2×7 = 19; entry (1,2) = 1×6 + 2×8 = 22; and so on — the heatmap shows 50 as the darkest cell because it is the largest value in the result.
Frequently asked questions
When is matrix multiplication defined?
Matrix multiplication A × B is defined only when the number of columns in A equals the number of rows in B. For two square matrices of the same size this is always satisfied, but note that A × B and B × A generally give different results — matrix multiplication is not commutative.
What does the determinant tell you?
The determinant is a single number that summarises a square matrix. A non-zero determinant means the matrix has a unique inverse and the corresponding system of equations has exactly one solution. A determinant of zero means the matrix is singular — its rows are linearly dependent and no inverse exists.
How is the inverse calculated?
The calculator uses the adjugate (classical adjoint) method: it forms the cofactor matrix, transposes it to get the adjugate, then divides every entry by the determinant. For the 2×2 case [[a,b],[c,d]] this gives [[d,−b],[−c,a]] divided by (ad − bc). If the determinant is zero an error is shown instead.
Sources
Reviewed by the YouCalc Team · Last reviewed
Spot a translation issue, a calculation issue, or have a suggestion? Let us know.