Matrix calculator

Add, subtract or multiply matrices, or calculate a transpose, determinant, inverse or rank using exact fractions within bounded dimensions.

Coefficients and operation
Coefficient matrix A
Matrix B

Addition and subtraction require equal dimensions. Multiplication requires A’s column count to match B’s row count. Determinants and inverses require square matrices; a nonexistent inverse is an explicit result.

Enter integers or finite decimals. Digits 0–9, ٠–٩ and ۰–۹, a +, - or − sign, and decimal separator . or ٫ are accepted. No whitespace, grouping separators, fractions such as 1/2, scientific notation or expressions. Line breaks are not allowed and are not removed to join digits into a number.

Each coefficient allows at most 48 text units and 30 total digits, including up to 18 after the decimal separator; leading zeroes count. Up to 6 rows, 6 columns, 72 input cells and 8,192 text units per operation.

Cells outside the visible dimensions, c in linear mode and B in unary operations are excluded from calculation. Their values remain on this page while hidden. A rejected cell stays rejected until that same cell is corrected or cleared.

Exact rational arithmetic inside your browser, with one worker and a 5-second deadline. Reports are limited to 64 KiB. No automatic storage or requests carrying coefficients. Work or intermediate-number limits can reject a calculation.

How to use

Choose the operation and A’s dimensions. Enter A’s cells, then B’s dimensions and cells when shown. Calculate and inspect the result type, dimensions and report. Operations can return a matrix, a scalar or an explicit diagnosis that no inverse exists. Copy the complete report or download TXT.

Try an example

For A=[[1,2],[3,4]] and B=[[5,6],[7,8]], A+B=[[6,8],[10,12]] and A×B=[[19,22],[43,50]]. A’s determinant is −2, its inverse is [[−2,1],[3/2,−1/2]], and its rank is 2.

Support & limits

Multiplication is ordinary row-by-column matrix multiplication, not element-wise multiplication; the order of A and B matters. Rectangular matrices are accepted for transpose, rank and dimension-compatible operations. Rational results are reduced with positive denominators, without decimal rounding. Complex matrices, eigenvalues and pseudoinverses are unsupported. When an operation or dimension change hides B or a cell, the hidden value is excluded from calculation and its rejection state remains on this page.

Common questions

What happens if the matrix has no inverse?

A singular square matrix produces an explicit no-inverse result without inventing a replacement matrix. You can calculate its rank or determinant using another operation. Incompatible dimensions are a correctable input error; exceeding a work limit or deadline stops the calculation without a partial result.

Related tools