Matrix Calculator

Add, multiply, transpose and invert matrices, and get the determinant, rank, trace and RREF instantly.

2 × 2

2 × 2

One row per line, numbers separated by spaces or commas. Up to 10 × 10.

Result

Result matrix
Size
Determinant
Rank
Trace
No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Type or paste two matrices — one row per line, numbers separated by spaces or commas — pick an operation and the answer appears as you type. This matrix calculator adds, subtracts and multiplies matrices, multiplies a matrix by a scalar, transposes it, raises a square matrix to a power, and computes the determinant, inverse, rank and reduced row echelon form (RREF). Every matrix result also reports its size, determinant, rank and trace, so you can sanity-check linear algebra homework without a second tool.

Determinants and inverses use Gaussian elimination with partial pivoting, the same numerically stable method textbooks teach, and rank and RREF come from Gauss–Jordan elimination with a small tolerance so floating-point dust does not turn a zero row into a non-zero one. Results are rounded to six decimals and snapped back to whole numbers when they are within rounding error, which is why an integer matrix gives integer answers. Everything runs in your browser with plain JavaScript: nothing is uploaded, there is no account and there are no ads.

Frequently asked questions

How do you multiply two matrices?

Each entry of the product is the dot product of a row of A with a column of B: multiply the paired numbers and add them up. For that to work the number of columns in A must equal the number of rows in B, and the result has A's row count and B's column count. Paste both matrices, choose "A × B", and the calculator does every dot product for you — if the sizes do not line up it tells you exactly which dimensions clash instead of silently guessing.

Why does my matrix have no inverse?

A matrix is invertible only if it is square and its determinant is not zero. When the determinant is zero the rows (or columns) are linearly dependent — one is a multiple or a sum of the others — so the matrix collapses information and cannot be undone. The calculator says the matrix is singular in that case; check the rank, which will be lower than the number of rows, to see how many independent rows you actually have.

How do I enter a matrix in this calculator?

Type one row per line and separate the numbers with spaces, tabs or commas — so a 2 × 3 matrix is "1 2 3" on the first line and "4 5 6" on the second. Decimals and negative numbers are fine, and you can paste a block straight from a spreadsheet or your notes. The size under each box updates as you type so you can confirm the dimensions before reading the answer.

Report a bug