Matrix Calculator
Pick an operation and a size, then fill in matrix A (and matrix B to add, subtract or multiply). A 2×2 determinant is a₁₁a₂₂ - a₁₂a₂₁. A 2×2 inverse swaps a₁₁ and a₂₂, changes the sign of the other two entries and divides everything by the determinant.
Last updated by Ultra Calculator
Matrix Calculator
How to calculate it
det(A) = a₁₁a₂₂ - a₁₂a₂₁ (2×2) A⁻¹ = (1 ÷ det(A)) × [a₂₂ -a₁₂ ; -a₂₁ a₁₁] (2×2) det(A) = a₁₁(a₂₂a₃₃ - a₂₃a₃₂) - a₁₂(a₂₁a₃₃ - a₂₃a₃₁) + a₁₃(a₂₁a₃₂ - a₂₂a₃₁) (3×3) A⁻¹ = adj(A) ÷ det(A) (3×3) (A × B)ᵢⱼ = Σₖ aᵢₖ × bₖⱼ
- A, B
- the two matrices; A is always used, B only for addition, subtraction and multiplication
- aᵢⱼ, bᵢⱼ
- the entry in row i, column j (the A₁₁ to B₃₃ boxes)
- det(A)
- the determinant of A
- A⁻¹
- the inverse of A, which exists only when det(A) is not 0
- adj(A)
- the adjugate of A: the matrix of cofactors, transposed
- (A × B)ᵢⱼ
- the entry in row i, column j of the product
- Σₖ
- the sum over k = 1 to 2 for a 2×2 matrix, or 1 to 3 for a 3×3
Addition and subtraction work entry by entry, and the transpose swaps rows for columns. Each cofactor is the 2×2 determinant left when you cross out an entry's row and column, with signs alternating in a chessboard pattern that starts with + at the top left.
Worked example
Adding two 2×2 identity matrices
Adding the identity matrix to itself doubles every entry, giving rows 2 0 and 0 2.
| Operation | Addition (A + B) |
|---|---|
| Matrix size | 2×2 Matrix |
| A₁₁ | 1 |
| A₁₂ | 0 |
| A₂₁ | 0 |
| A₂₂ | 1 |
| B₁₁ | 1 |
| B₁₂ | 0 |
| B₂₁ | 0 |
| B₂₂ | 1 |
| Result | 2 0 0 2 |
|---|---|
| Operation | Addition (A + B) |
| Matrix size | 2x2 |
How to use this calculator
- Choose the Operation: addition, subtraction, multiplication, determinant, inverse or transpose.
- Choose the Matrix size, 2×2 or 3×3.
- Type the entries of matrix A into the boxes A₁₁ to A₃₃. The first number is the row and the second the column, so A₁₂ is row 1, column 2. With the 2×2 size the third row and column are ignored.
- For addition, subtraction or multiplication, fill in matrix B the same way.
- Read the Result, laid out one row per line like the matrix itself. For a determinant or inverse, the Determinant line shows det(A). If the determinant is 0, the calculator tells you the matrix has no inverse.
Frequently asked questions
How do you find the determinant of a 2×2 matrix?
Multiply the two entries on the main diagonal, a₁₁ × a₂₂, then subtract the product of the other two, a₁₂ × a₂₁. For rows 2 3 and 1 4 that is 8 - 3 = 5.
How do you find the determinant of a 3×3 matrix?
Expand along the top row. Multiply each top-row entry by the 2×2 determinant left when you cross out its row and column, then combine the three results with the signs +, -, +. The calculator uses exactly this expansion.
When does a matrix have no inverse?
A square matrix has no inverse when its determinant is 0. Such a matrix is called singular: it squashes space into a line or a plane, so the original can't be recovered. The calculator says there is no inverse when the determinant is 0. Decimals such as 0.1 are stored rounded, so a determinant within the rounding error of the products it is built from counts as 0, while a matrix of small entries, such as 0.000001 on the diagonal, still has its inverse. When the determinant is only just bigger than that rounding error, the calculator still gives the inverse but adds a note saying how far off it could be.
How do you multiply two matrices?
Each entry of A × B comes from a row of A and a column of B: multiply them pair by pair and add. Order matters, because A × B is usually different from B × A.
How do you find the inverse of a 3×3 matrix?
Work out the nine cofactors, arrange them as a matrix, transpose it (this is the adjugate) and divide every entry by the determinant. For rows 1 2 3, 0 1 4 and 5 6 0 the determinant is 1, so the inverse is the adjugate itself: rows -24 18 5, 20 -15 -4 and -5 4 1.
Learn more
What the determinant tells you
A 2×2 matrix maps the unit square to a parallelogram, and the absolute value of the determinant is that parallelogram's area (for 3×3, the volume of the shape the unit cube becomes). A negative determinant means the shape has been flipped over. A determinant of 0 means everything has been flattened, which is why such a matrix has no inverse.
Identity and inverse
The identity matrix has 1s on the diagonal and 0s elsewhere, and multiplying by it changes nothing. The inverse A⁻¹ undoes A, so A × A⁻¹ gives the identity. That gives you a quick way to check any inverse.
The transpose
The transpose Aᵀ turns row 1 into column 1, row 2 into column 2, and so on. A matrix that equals its own transpose is called symmetric.
- Checking linear algebra or Further Maths homework on 2×2 and 3×3 matrices
- Solving two simultaneous equations by writing them as A × x = b and using x = A⁻¹ × b
- Testing whether three vectors are independent: they are if the 3×3 determinant is not 0
- Combining a rotation and a stretch in 2D by multiplying their matrices
- Finding the area of a parallelogram from the two vectors along its sides: it is the absolute value of their 2×2 determinant
Multiplying entry by entry
Matrix multiplication is row times column, not matching entries. Rows 1 2 and 3 4 times rows 5 6 and 7 8 starts with 1 × 5 + 2 × 7 = 19, not 1 × 5 = 5.
Putting the matrices in the wrong order
A × B and B × A usually differ. When the matrices act on column vectors, put the matrix you apply first on the right: to rotate and then stretch, the product is stretch × rotation.
Getting the middle sign wrong in a 3×3 determinant
The top-row expansion uses +, -, +, so the a₁₂ term is subtracted. Forgetting it is an easy way to get a hand-worked 3×3 determinant wrong.
Mixing up rows and columns
In A₂₃ the first number is the row and the second is the column. Typing a matrix in column by column gives you its transpose, which has the same determinant but a different product and inverse.
- Check an inverse by multiplying it back: A × A⁻¹ should give the identity, apart from rounding.
- To build an identity matrix, put 1 in A₁₁, A₂₂ (and A₃₃) and 0 everywhere else.
- If the determinant comes out as 0, the matrix has no inverse, so there is no need to try that operation.
Methodology and sources
Each box is read as a decimal number, and an empty box counts as 0. With the 2×2 size, the third row and column are ignored. Addition, subtraction and the transpose work entry by entry, and multiplication uses the row-by-column rule. Determinants are expanded along the top row. An inverse is the adjugate (the matrix of cofactors, transposed) divided by the determinant, and the calculator refuses it when the determinant is 0. A determinant counts as 0 only when it is within the most that rounding the entries and products can produce (3 rounding steps of the 2×2 terms, 8 of the 3×3 terms); a determinant only a little larger than that is kept, with a note that rounding could change it by a stated share, because its inverse can then be well off. Any other answer smaller than the rounding error of the products it comes from, such as 0.1 × 3 - 0.3, is shown as 0, while a genuinely small answer is kept. Results are rounded to 4 decimal places, or 4 significant figures below 0.0001 (with a power of ten below 0.000001), and shown one row per line, so an inverse with recurring decimals, such as thirds, gives the identity only approximately when you multiply it back by A.