Matrix Calculator

Type matrix A, one row on each line, and choose an operation. For add, subtract and multiply, type matrix B too. You get the result, the working of each step, and for the determinant and inverse whether the matrix is invertible.

Free Runs in your browser Checked Tuesday, November 10, 2026

Numbers in a row are separated by spaces. Decimals such as 0.5 and fractions such as 1/2 are allowed; put a minus sign in front of a negative number.

Same format as matrix A. For multiplication, the number of columns of A must equal the number of rows of B.

Result

Result — The answer in words, with its size or value.
Invertible? — A square matrix is invertible when its determinant is not 0.
Matrix

How it is worked out

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Type matrix A in Matrix A, one row on each line, with the numbers of a row separated by spaces.
  2. Choose the Operation. For add, subtract or multiply, type matrix B in Matrix B.
  3. Read Result and the Matrix. For the determinant and the inverse, check Invertible?.
  4. Go through How it is worked out to see each entry or row operation.

Products, sums and transposes

Two matrices are added or subtracted entry by entry, so they must have the same size. An entry of the product A × B is the sum of the products of a row of A with a column of B, so A must have as many columns as B has rows.

The transpose swaps rows and columns: the entry in row i and column j moves to row j and column i.

(A × B) in row i, column j = Σ a(i,k) × b(k,j), summed over k

Determinant, inverse and rank

The determinant of a square matrix is found by row reduction. Adding a multiple of one row to another keeps it, and swapping two rows changes its sign, so the determinant is the product of the diagonal of the triangular form, with that sign.

The inverse is found by Gauss-Jordan elimination: the same row operations that turn A into the identity turn the identity into A⁻¹. A matrix with determinant 0 is singular and has no inverse. The rank is the number of pivots in the reduced row echelon form.

What the calculator does not cover

  • Matrices larger than 8 rows or 8 columns, and matrices with complex numbers.
  • Eigenvalues, decompositions and matrix equations with unknowns; for linear systems use the equation system solver.
  • Decimal approximations: every result is exact, so a decimal input is shown as a fraction.

Worked example: the inverse of the matrix with rows 2 1 and 1 3

The determinant is 2 × 3 − 1 × 1 = 5, which is not 0, so the matrix has an inverse. Gauss-Jordan elimination gives the inverse, whose rows are 3/5 −1/5 and −1/5 2/5.

Check: the matrix with rows 2 1 and 1 3, multiplied by its inverse, gives the identity matrix with rows 1 0 and 0 1.

Result
Determinant 5
Inverse, row 1 3/5 and −1/5
Inverse, row 2 −1/5 and 2/5

Frequently asked questions

How do I type a matrix?

Put each row on its own line, and separate the numbers in a row with spaces. The matrix with rows 2 1 and 1 3 is typed as two lines: 2 1 and 1 3.

What does it mean when a matrix is singular?

A singular matrix has determinant 0. Its rows (or columns) depend on each other, so it has no inverse and the system it describes has no unique solution.

Why does the result show fractions instead of decimals?

The calculator works with exact fractions, so no rounding happens. For example, the inverse of the matrix with rows 2 1 and 1 3 has the entry 3/5, which is 0.6 written exactly.

Why can I not multiply some matrices?

To multiply A by B, the number of columns of A must equal the number of rows of B. A 2 × 2 matrix times a 3 × 1 matrix is not defined, so the calculator explains the sizes instead.

What is the rank of a matrix?

The rank is the number of pivots in the reduced row echelon form, which is the number of independent rows. A square matrix has full rank, which means the same size as the matrix, exactly when it is invertible.

Are the matrices I type sent to a server?

No. The calculation runs in your browser, and nothing you type is sent to us.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.