Matrix Calculator

How to use the matrix calculator

Pick an operation, choose 2×2 or 3×3, type your numbers, and press Calculate. Every result comes with step-by-step working.

Matrix operations explained

Addition and subtraction work entry by entry. Multiplication takes the dot product of each row of A with each column of B. The determinant is a single number that tells you whether a matrix can be inverted. The inverse A⁻¹ satisfies A × A⁻¹ = I (the identity matrix). The transpose flips rows and columns.

Worked example

Multiply A = [[1, 2], [3, 4]] by B = [[5, 6], [7, 8]]: C[1][1] = 1×5 + 2×7 = 19, C[1][2] = 1×6 + 2×8 = 22, C[2][1] = 3×5 + 4×7 = 43, C[2][2] = 3×6 + 4×8 = 50.

Frequently asked questions

The determinant is a scalar value computed from a square matrix. For 2×2 [[a,b],[c,d]] it is ad − bc. If the determinant is zero, the matrix has no inverse.

The number of columns of A must equal the number of rows of B. A 2×3 matrix times a 3×2 matrix gives a 2×2 result.

The inverse A⁻¹ undoes multiplication by A: A × A⁻¹ = I. Only square matrices with non-zero determinant have inverses.

Determinant and inverse formulas

For a 2 by 2 matrix, two short formulas do most of the work. The determinant combines the two diagonals, and the inverse reuses that same number, which is why the calculator checks the determinant first. If it is zero, there is no inverse to find.

For A = [[a, b], [c, d]]: det(A) = a*d – b*c, and A^-1 = (1 / det(A)) * [[d, -b], [-c, a]]

Notice the pattern in the inverse: a and d swap places, b and c change sign, and every entry is divided by the determinant. For a 3 by 3 matrix the idea is the same but the determinant is built from three smaller 2 by 2 determinants, so the working is longer.

Example: Determinant and inverse of [[4, 7], [2, 6]]

Step 1, Determinant: det = 4*6 – 7*2 = 24 – 14 = 10. Because the determinant is not zero, an inverse exists.

Step 2, Swap and flip: Swap 4 and 6, and change the signs of 7 and 2. This gives [[6, -7], [-2, 4]].

Step 3, Divide: Divide every entry by 10. The inverse is [[0.6, -0.7], [-0.2, 0.4]]. Multiplying A by this inverse gives the identity matrix.

Common mistakes

  • Trying to invert a zero determinant matrix: Dividing by a determinant of zero is impossible, so no inverse exists. Check the determinant before anything else.
  • Assuming order does not matter: In general A * B is not the same as B * A. Keep the matrices in the order the problem states.
  • Flipping the wrong entries: In the inverse, the main diagonal swaps and the off diagonal entries change sign. Swapping all four entries breaks the result.

When to use each operation

Reach for the determinant when you need to know whether a system of equations has a single solution. Use the inverse to actually solve such a system, or to undo a transformation in graphics and coding work. Multiplication combines two transformations into one, addition combines matching data tables entry by entry, and the transpose is the quick way to turn rows of data into columns.

More questions

It is the square matrix with 1s on the main diagonal and 0s elsewhere, such as [[1, 0], [0, 1]]. Multiplying any matrix by the identity leaves it unchanged, just as multiplying a number by 1 does.

Usually not. A * B and B * A often give different results, and sometimes only one of the two orders can even be multiplied. Always keep the order given in the problem.

It tells you the system does not have one unique solution. The equations are dependent or inconsistent, so there are either no solutions or infinitely many, and the matrix cannot be inverted.