Matrix Calculator

Operation
Matrix A
Matrix B
Result[6, 8; 10, 12]
6.00008.000010.000012.0000

A matrix is a rectangular grid of numbers, and matrix algebra is the backbone of computer graphics, physics, statistics, and machine learning. This calculator works with two 2x2 matrices and performs addition, subtraction, multiplication, the determinant, and the inverse. Each operation follows the standard rules of linear algebra, with multiplication combining rows of the first matrix with columns of the second.

Formula

det = ad - bc for [[a,b],[c,d]]; product entry (i,j) = sum over k of A(i,k)*B(k,j)

a, b, c, d
The four entries of a 2x2 matrix, read left to right, top to bottom
det
Determinant ad - bc; the inverse exists only when det is not zero
product (i,j)
Each entry of the matrix product, formed from a row of A and a column of B

How it works

  1. Enter the four entries of matrix A and, for binary operations, the four entries of matrix B, each as a 2x2 grid.
  2. Choose an operation: add, subtract, and multiply combine A and B; determinant and inverse use matrix A alone.
  3. The calculator returns the resulting matrix (formatted as rows separated by a semicolon), or a single number for the determinant. If a matrix has a determinant of zero, it has no inverse and the calculator reports that it is not invertible.

Worked examples

Multiply A = [[1, 2], [3, 4]] by B = [[5, 6], [7, 8]].

  1. Top-left: 1x5 + 2x7 = 5 + 14 = 19; top-right: 1x6 + 2x8 = 6 + 16 = 22.
  2. Bottom-left: 3x5 + 4x7 = 15 + 28 = 43; bottom-right: 3x6 + 4x8 = 18 + 32 = 50.
  3. Assemble the result row by row.

The product is [[19, 22], [43, 50]].

Find the determinant and inverse of A = [[4, 7], [2, 6]].

  1. Determinant: 4x6 - 7x2 = 24 - 14 = 10.
  2. Inverse = (1/det) x [[6, -7], [-2, 4]].
  3. Divide each entry by 10: [[0.6, -0.7], [-0.2, 0.4]].

The determinant is 10 and the inverse is [[0.6, -0.7], [-0.2, 0.4]].

Frequently asked questions

What size matrices does this calculator support?
It works with 2x2 matrices. You enter the four entries for matrix A, and for addition, subtraction, and multiplication you also enter the four entries for matrix B.
Why does matrix multiplication not just multiply matching entries?
Matrix multiplication combines each row of the first matrix with each column of the second using dot products. That is why the order matters: in general A times B is not the same as B times A.
When does a matrix have no inverse?
A matrix is not invertible when its determinant is zero. For such a matrix the inverse formula would require dividing by zero, so the calculator reports that the matrix is not invertible.
What does the determinant tell me?
The determinant is a single number that measures how the matrix scales area, and whether it is invertible. A determinant of zero means the matrix collapses space and cannot be reversed.