Home / Math / Matrix Calculator

Matrix Calculator: Determinant, Inverse, Transpose and Product

Type each matrix with one row per line and entries separated by spaces or commas. Choose an operation and get the result, with exact fractions when you enter whole numbers.

By Adzita Editorial Team · Updated 2026-11-03 · How we build and check our tools

One row per line.
Used for multiply, add and subtract only.

Determinant: what it is and how it is found

The determinant is a single number computed from a square matrix. For a 2 by 2 matrix with rows (a, b) and (c, d) it is ad − bc. For larger matrices the tool uses cofactor expansion along the first row: each entry is multiplied by the determinant of the smaller matrix left when its row and column are removed, with alternating plus and minus signs.

For the 3 by 3 matrix with rows (2, −3, 1), (2, 0, −1), (1, 4, 5) the expansion gives 2 × 4 − (−3) × 11 + 1 × 8 = 49. A determinant of zero means the rows are linearly dependent and the matrix is singular, so it has no inverse.

Inverse by cofactors

The inverse of A satisfies A × A−1 = I, the identity matrix. This tool builds it as the transposed cofactor matrix divided by the determinant. For a 2 by 2 matrix with rows (a, b) and (c, d) that is 1 ÷ (ad − bc) times the matrix with rows (d, −b) and (−c, a).

When every entry you type is a whole number, the entries of the inverse are shown as reduced fractions, with a decimal beside them, because the cofactors and the determinant are whole numbers and the division is exact. For decimal inputs the result is rounded to six places. Cofactor expansion is fine for these small sizes; large matrices are normally handled with elimination methods instead.

Multiplication, addition and transpose

Matrix addition and subtraction work entry by entry and require the same size. Multiplication needs the number of columns in A to equal the number of rows in B. Entry (i, j) of the product is the sum of A(i, k) × B(k, j) over k. A 2 by 3 matrix times a 3 by 2 matrix gives a 2 by 2 result.

Order matters: A × B and B × A are usually different, and one may not exist when the other does. The transpose swaps rows and columns, so entry (i, j) moves to (j, i), and a 2 by 3 matrix becomes 3 by 2.

Entering matrices and common errors

The tool does not do eigenvalues, rank or systems of equations. For solving a linear system, the inverse times the right-hand side gives the solution when the matrix is invertible.

Worked example

Multiply the 2 by 2 matrices [[1, 2], [3, 4]] and [[5, 6], [7, 8]]. Each result entry is a row of A times a column of B.

Inputs

OperationMultiply A × B
Matrix A1 2 3 4
Matrix B5 6 7 8

Result

Product A × B

Result is 2 by 2.

Product A × B

Col 1Col 2
1922
4350

Accuracy note: Results use standard double-precision arithmetic, so very large or very small values may be rounded. Check important results by another method.

Frequently asked questions

How do I find the determinant of a 3 by 3 matrix?

Expand along the first row: multiply each entry by the determinant of the 2 by 2 matrix left after deleting its row and column, alternating plus and minus signs, and add the results.

When does a matrix have no inverse?

A square matrix has no inverse when its determinant is zero. Such a matrix is called singular, and its rows or columns are linearly dependent.

Why can I not multiply some pairs of matrices?

The number of columns in the first matrix must equal the number of rows in the second. A 2 by 3 matrix cannot be multiplied by another 2 by 3 matrix.

Is matrix multiplication commutative?

No. In general A times B is not equal to B times A, and the reversed product may not even be defined for the given sizes.

Why are some inverse entries shown as fractions?

With whole-number input, each inverse entry is a whole cofactor divided by a whole determinant, so a reduced fraction is exact while a decimal may be rounded.

Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers with simplified, mixed and decimal answers.Quadratic Formula CalculatorSolve ax² + bx + c = 0: real or complex roots, discriminant, vertex, axis and factored form.Percentage CalculatorPercent of a number, percent change, and increase or decrease by a percent, with working.Scientific CalculatorEvaluate typed expressions with trig, logs, roots, powers and factorials in degrees or radians.

References and sources

  1. Strang, G. Introduction to Linear Algebra, 5th edition, Wellesley-Cambridge Press.

Check primary sources for anything you rely on.