Skip to content

Matrix Calculator

This matrix calculator works with matrices up to 4 × 4. Type each matrix with commas between entries and semicolons between rows, like 1, 2; 3, 4. Then choose to add, subtract or multiply A and B, or find the determinant, inverse or transpose of A. Answers stay exact as fractions, and the steps show how each entry is built.

Last updated November 6, 2026 · Topic: Algebra

Rows separated by ; and entries by commas

Rows separated by ;

What is a matrix?

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are used to store data, describe transformations and solve systems of linear equations.

This calculator handles matrices up to 4 by 4 for adding, subtracting and multiplying, and up to 3 by 3 for determinants and inverses.

Matrix formulas for each operation

∣abcd∣=ad−bc,A−1=1ad−bc[d−b−ca]\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc, \qquad A^{-1} = \frac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

(AB)ᵢⱼ is the sum of Aᵢₖ × Bₖⱼ over k.

How to use the matrix calculator

  1. Type matrix A with rows separated by semicolons and entries by commas.
  2. Choose the operation.
  3. If the operation needs two matrices, type matrix B.
  4. Read the result and the steps.
  5. Check sizes if the tool shows a message.

Matrix examples

Example 1: Multiplying

Multiply A = [1 2; 3 4] by B = [5 6; 7 8]. Entry (1,1) is 1 × 5 + 2 × 7 = 19. Entry (1,2) is 1 × 6 + 2 × 8 = 22. Entry (2,1) is 3 × 5 + 4 × 7 = 43. Entry (2,2) is 3 × 6 + 4 × 8 = 50. The product is [19 22; 43 50].

Example 2: Adding

Add the same A and B. Add entry by entry: 1 + 5 = 6, 2 + 6 = 8, 3 + 7 = 10 and 4 + 8 = 12. The sum is [6 8; 10 12].

Example 3: Determinant and inverse

For A = [1 2; 3 4], the determinant is 1 × 4 − 2 × 3 = −2. Since it is not zero, the inverse exists: (1 ÷ −2) × [4 −2; −3 1] = [−2 1; 3/2 −1/2].

Example 4: A 3 by 3 determinant

Find the determinant of [2 1 1; 1 3 2; 1 0 0]. Expanding along the bottom row gives 1 × (1 × 2 − 1 × 3) = −1. The tool uses row reduction and gets the same answer, −1.

When each operation works

OperationSize rule
A + B, A − BA and B must be the same size
A × Bcolumns of A must equal rows of B; a 2 × 3 times a 3 × 4 gives a 2 × 4
DeterminantA must be square
InverseA must be square with a determinant that is not 0
Transposeany size

If multiplication shows an error, the inner sizes do not match. Swapping A and B can change the answer or make it impossible, because matrix multiplication is not commutative.

When does an inverse exist?

Only when the determinant is not zero. For [[2, 4], [1, 2]], the determinant is 2 × 2 − 4 × 1 = 0, so there is no inverse. The rows are multiples of each other, and the matrix squashes the plane onto a line. The determinants and inverses guide shows the 2 × 2 shortcut and the 3 × 3 method.

What the calculator does not do

It does not reduce to row echelon form (RREF), find eigenvalues or raise a matrix to a power. For A², multiply A by itself. To solve a system such as 2x + y = 5 and x − y = 1, find the inverse of the coefficient matrix and multiply it by the column of constants. Inputs can have up to six decimal places.

Tips

  • Use a semicolon between rows and a comma between entries.
  • Check the size rule before multiplying.
  • A determinant of 0 means no inverse.
  • The tool keeps exact fractions.
  • Read matrices basics explained for the ideas.

Common mistakes

  • Multiplying entry by entry. That is not matrix multiplication.
  • Assuming AB = BA.
  • Adding matrices of different sizes.
  • Looking for the inverse of a non-square matrix.

Real-life uses

Matrices drive computer graphics, which rotate and scale images, as well as machine learning, economics, networks and physics. A system of equations can be written with a matrix and solved with its inverse. In data science, tables of numbers are matrices. The 3D video game you play is built on thousands of matrix multiplications per second. For fractions in your answers, use the fraction calculator.

FAQ

Frequently asked questions

01How do I enter a matrix?

Type the rows separated by semicolons and the entries separated by commas. For the 2 by 2 matrix with rows 1, 2 and 3, 4, type 1, 2; 3, 4. You can use decimals and fractions such as 1/2. Every row needs the same number of entries, and the largest size is 4 by 4.

02When can I multiply two matrices?

You can multiply A by B when the number of columns of A equals the number of rows of B. A 2 by 3 matrix times a 3 by 2 matrix gives a 2 by 2 matrix. The order matters: A times B is usually not B times A. The tool checks the sizes for you.

03What is a determinant?

The determinant is a single number found from a square matrix. For a 2 by 2 matrix with entries a, b, c and d, it is ad − bc. It tells you whether the matrix has an inverse: if the determinant is zero, there is no inverse. It also measures how the matrix scales areas.

04What is the inverse of a matrix?

The inverse of A is the matrix that multiplies with A to give the identity matrix, which has 1s on the diagonal and 0s elsewhere. Only square matrices with a nonzero determinant have an inverse. It is used to solve systems of equations. The tool finds it by row reduction with exact fractions.

05What is the transpose?

The transpose swaps rows and columns. The first row becomes the first column, and so on. A 2 by 3 matrix becomes a 3 by 2 matrix. For a square matrix, the entries reflect across the main diagonal. It is written with a small T, as in Aᵀ.

06Why does the tool show fractions?

Matrix operations, such as finding an inverse, often give fractions. The calculator keeps exact fractions instead of rounding, so you can see the true answer. For example, the inverse of the matrix 1, 2; 3, 4 has the entries 3/2 and −1/2. Use the fraction calculator to turn them into decimals.

07How large can the matrices be?

Up to 4 rows and 4 columns. That covers most homework on 2 × 2 and 3 × 3 systems. Every row must have the same number of entries, and each entry can be a whole number or a decimal with up to six decimal places.

08When does a matrix have an inverse?

When it is square and its determinant is not 0. If the determinant is 0, the calculator tells you there is no inverse. That happens when one row is a multiple of another, or more generally when the rows are linearly dependent.