Join Discord

Matrix Calculator

Determinant, inverse, product and more, with exact fractions.

A
B

Whole numbers, decimals or fractions like 3/4.

Matrix Calculator by AIPreciseTools · Open the full calculator ↗

Determinant

For a 2×2 matrix [a b; c d] the determinant is ad − bc. For larger matrices the calculator uses row reduction with exact fractions. A determinant of 0 means the matrix has no inverse.

Example: the default 3×3 matrix A = [2 −1 0; 1 3 2; 0 1 4] has determinant 2(3·4 − 2·1) − (−1)(1·4 − 2·0) + 0 = 20 + 4 = 24.

Inverse and product

The inverse A⁻¹ is the matrix with A × A⁻¹ = I. It's found with Gauss-Jordan elimination on [A | I]. Matrix multiplication takes each row of the first matrix times each column of the second, so A × B and B × A are usually different.

What a matrix calculator does

A matrix is a rectangular grid of numbers. Matrices describe systems of equations, rotations and scalings, networks, and the data tables behind computer graphics and machine learning. The calculator works with 2×2, 3×3 and 4×4 grids and performs addition, subtraction, multiplication, squaring, the determinant, the inverse and the transpose, using exact fractions so that answers do not suffer from rounding.

Each operation has its own rules. Addition and subtraction need matrices of the same size and work entry by entry. Multiplication needs the number of columns of the first to equal the number of rows of the second. The determinant and inverse apply only to square matrices.

Determinant

For a 2×2 matrix [a b; c d] the determinant is ad − bc. For 3×3, expand along a row: a(ei − fh) − b(di − fg) + c(dh − eg). The default matrix A = [2 −1 0; 1 3 2; 0 1 4] has determinant 2(12 − 2) − (−1)(4 − 0) + 0 = 20 + 4 = 24. Larger matrices are reduced to triangular form by row operations, and the determinant is the product of the diagonal, with a sign change for each row swap.

The determinant measures how a matrix scales area or volume. A 2×2 matrix with determinant 3 triples the area of any shape it transforms, and a negative determinant also flips orientation. A determinant of zero means the matrix squashes space onto a lower dimension and has no inverse.

Determinants and invertibility

The table lists six matrices. The third, [1 2 ; 2 4], has a second row that is twice the first, so the determinant is zero. The last, [1 2 3 ; 4 5 6 ; 7 8 9], also has a determinant of zero, because the rows are linearly dependent: row 3 = 2 × row 2 − row 1.

MatrixDeterminantInvertible?
[ 1 2 ; 3 4 ]-2yes
[ 2 0 ; 0 5 ]10yes
[ 1 2 ; 2 4 ]0no
[ 4 7 ; 2 6 ]10yes
[ 2 -1 0 ; 1 3 2 ; 0 1 4 ]24yes
[ 1 2 3 ; 4 5 6 ; 7 8 9 ]0no

When the determinant is zero the matrix is called singular. The calculator reports that no inverse exists instead of giving a misleading number.

Inverse

The inverse A⁻¹ satisfies A × A⁻¹ = I, the identity matrix. For a 2×2 matrix, swap the diagonal entries, negate the others and divide by the determinant. For [4 7 ; 2 6] the determinant is 10, so the inverse is [ 3/5 -7/10 ; -1/5 2/5 ]. For larger matrices the calculator uses Gauss-Jordan elimination on [A | I].

For the default 3×3 matrix, the inverse is [ 5/12 1/6 -1/12 ; -1/6 1/3 -1/6 ; 1/24 -1/12 7/24 ]. Because the calculator works in exact fractions, you can check the result by multiplying back: A × A⁻¹ gives the identity.

Multiplication is not commutative

To multiply, take each row of the first matrix times each column of the second. For A = [1 2 ; 3 4] and B = [0 1 ; 1 0], A × B = [ 2 1 ; 4 3 ] and B × A = [ 3 4 ; 1 2 ]. The two products differ, so the order matters.

Swapping the columns of A happens when B is on the right, and swapping the rows when it is on the left. A matrix times its inverse, however, commutes with it, since both orders give the identity.

Solving systems of equations

A system such as 2x − y = 1 and x + 3y = 11 can be written A × v = b, with A = [2 −1 ; 1 3], v = [x ; y] and b = [1 ; 11]. The solution is v = A⁻¹ × b. The determinant is 7, and A⁻¹ = [3/7 1/7 ; −1/7 2/7], so x = (3 + 11)/7 = 2 and y = (−1 + 22)/7 = 3. Check: 4 − 3 = 1 and 2 + 9 = 11.

If the determinant is zero, the system has either no solution or infinitely many, because the equations are not independent. That is the same thing as saying the lines are parallel or identical.

Transpose and the identity

The transpose flips a matrix across its diagonal, turning rows into columns. For [1 2 3 ; 4 5 6] it is [1 4 ; 2 5 ; 3 6]. The identity matrix has ones on the diagonal and zeros elsewhere, and leaves any matrix unchanged when you multiply by it.

Useful rules include (A × B)ᵀ = Bᵀ × Aᵀ and det(A × B) = det(A) × det(B). They help to check a result by a second route.

Where matrices are used

Computer graphics use matrices to rotate, scale and move objects. Engineers use them for circuits and structures. Economists use them for input-output models, and search engines use huge matrices to rank pages. In statistics, a regression is solved with matrix algebra.

To work with the numbers inside a matrix, the fraction calculator shows exact arithmetic, and the scientific calculator handles decimal work.

More questions people ask

Why does the calculator use fractions?

Fractions keep results exact. Decimals would round at each step, and a determinant that should be zero might appear as a tiny non-zero number.

Can I multiply a 2×3 matrix by a 3×2 matrix?

Yes. The inner sizes match (3 and 3), and the result is 2×2. The reverse order gives a 3×3 matrix.

What does a determinant of zero mean?

The matrix has no inverse, and its rows or columns are linearly dependent.

How big a matrix can I use?

The calculator handles 2×2, 3×3 and 4×4 matrices. Larger matrices are better handled in dedicated software such as a spreadsheet or a numerical library.

Worked examples on this page were calculated with the same formulas as the calculator above. Written and last reviewed by Shaun Longbottom, November 2026.

Frequently asked questions

How do you find the determinant of a 3×3 matrix?

Expand along a row: a(ei − fh) − b(di − fg) + c(dh − eg), or reduce it to triangular form and multiply the diagonal. This calculator does the second, with exact fractions.

When does a matrix have no inverse?

When its determinant is 0. Its rows (or columns) are then linearly dependent.

Was this calculator helpful?

Run a blog, class page or shop? Put this calculator on your site, free. It fits any page and keeps working on phones.