Skip to content
toolgrid

No tool found. Try another word.

Matrix Calculator

Add, subtract and multiply matrices, and find the determinant, inverse and transpose of matrices up to 6×6. Type rows on separate lines.

One row per line; numbers separated by spaces or commas. "1 2; 3 4" also works.

Check the matrices: one row per line, numbers separated by spaces, and sizes that fit the operation.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the Matrix Calculator

  1. 1 Choose the operation.
  2. 2 Type matrix A, one row per line, with the numbers separated by spaces or commas (or use ";" between rows). For two-matrix operations, type matrix B as well.
  3. 3 Read the result and copy it into a spreadsheet or document.

About the Matrix Calculator

Matrices are typed as plain text: each line is a row and the numbers on a line are separated by spaces or commas, so "1 2" and "3 4" on two lines is the 2×2 matrix with rows (1, 2) and (3, 4). You can also write it on one line as "1 2; 3 4". Matrices can be up to 6×6.

Addition and subtraction work entry by entry and need two matrices of the same size. Multiplication A × B needs A to have as many columns as B has rows; each entry of the result is the dot product of a row of A and a column of B. Note that A × B is usually not the same as B × A.

The determinant is computed by Gaussian elimination with partial pivoting, and the inverse by Gauss-Jordan elimination on [A | I]. A matrix has an inverse only when its determinant is not 0. Results are rounded to 12 significant digits, and tiny rounding leftovers (smaller than 10⁻¹⁰) are shown as 0.

Frequently asked questions

How do I multiply two matrices?

Choose A × B and type both matrices. 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 matrix.

When does a matrix have no inverse?

When it is singular: its determinant is 0. This happens when a row (or column) is a combination of the others, for example when two rows are equal.

What is the transpose?

The transpose swaps rows and columns: the first row becomes the first column. A 2×3 matrix becomes a 3×2 matrix.

Why do I see 0.333333333333 instead of 1/3?

The calculator works with decimal numbers and rounds to 12 significant digits. Fractions such as 1/3 therefore appear as decimals.

Can I paste a matrix from a spreadsheet?

Yes. Rows copied from Excel or Google Sheets are separated by tabs and new lines, which the calculator understands.