CalcArcade.

Matrix Calculator

Type one or two matrices, with the rows separated by semicolons, and choose an operation. You get the result as a matrix, exactly worked out.

Your numbers

Result

How we calculate it

Type each row with its numbers separated by spaces or commas, and separate the rows with semicolons, so 1 2; 3 4 is the matrix with rows (1, 2) and (3, 4). Adding and subtracting work entry by entry and need matrices of the same size. In a product A × B the number of columns of A must equal the number of rows of B, and each entry is a row of A times a column of B.

The determinant, rank and inverse are found by exact whole-number arithmetic (the Bareiss method), so a determinant of 0 really is 0, even for a matrix such as 1 2 3; 4 5 6; 7 8 9. The inverse is the adjugate matrix divided by the determinant. For example, A = 1 2; 3 4 has the determinant −2 and the inverse −2 1; 1.5 −0.5, and A × B with B = 5 6; 7 8 is 19 22; 43 50.

Assumptions and limits

  • Matrices can have up to 4 rows and 4 columns. Numbers can have up to 6 decimal places and be as large as 1,000,000 in size. Exponents such as 1e5 are not accepted.
  • Sums, differences, products, determinants, ranks and traces are exact. Entries of an inverse that are not finite decimals, such as 1/3, are shown to 12 significant digits.
  • Only a square matrix has a determinant, a trace and an inverse, and only when its determinant is not 0 does it have an inverse.

Frequently asked questions

How do I multiply two matrices?

The entry in row i and column j of the product is the sum of each entry in row i of the first matrix times the matching entry in column j of the second. The first must have as many columns as the second has rows.

What is the determinant of a matrix?

It is a single number worked out from a square matrix. For 1 2; 3 4 it is 1 × 4 − 2 × 3 = −2. A determinant of 0 means the matrix has no inverse.

What is the rank of a matrix?

The rank is the number of rows that are independent of each other, that is, not made up from the others. 1 2 3; 4 5 6; 7 8 9 has rank 2 because the third row is twice the second minus the first.

Related calculators

Worked example (a fixed example using the starting numbers, it does not change as you type)

Inputs: Operation = A × B (multiply); Matrix A (rows separated by ;) = 1 2; 3 4; Matrix B (rows separated by ;) = 5 6; 7 8.

  • Result [[19, 22], [43, 50]]
  • Size 2 × 2

Embed this calculator

Add this calculator to your own page. Paste the code where you want it. The small link keeps credit to the source.

More math calculators

Last reviewed: . Formulas and assumptions are described on our methodology page. For information only; not professional advice.