Skip to content
MoneyDeck

Matrix Calculator

Add, multiply, invert and transpose matrices, and find determinants

Updated · Free, no signup

One row per line, or rows separated by ";" or written as [[1, 2], [3, 4]]. Up to 10×10.

Result

[  5   8 ]
[ 14  22 ]

Result size

2×2

Determinant of A

1

Shown only when A is square.

Rank of A

2

Trace of A

5

A is invertible?

Yes
  • det(A) = 1 — A is invertible.

Result matrix

RowCol 1Col 2
158
21422

About the Matrix Calculator

This matrix calculator handles the everyday operations of linear algebra: A + B, A − B, A × B, scalar multiples, the transpose, the determinant, the inverse and the rank. Type each matrix with one row per line and numbers separated by spaces or commas — for example "2 1" on the first line and "5 3" on the second for a 2×2 matrix. Rows separated by semicolons ("2 1; 5 3") and bracket notation such as [[2, 1], [5, 3]] are accepted too.

It is built for students checking homework, engineers and data people who need a quick inverse or determinant, and anyone solving a system of linear equations by hand. Whatever operation you choose, the calculator also reports the determinant, rank and trace of matrix A so you can tell at a glance whether it is invertible.

Matrices can be up to 10×10. The inverse, determinant and rank are computed with Gauss–Jordan elimination using partial pivoting, and results are rounded to six decimal places, so values like 0.333333 are the decimal form of 1/3.

How to use the matrix calculator

  1. 1Choose the operation you need.
  2. 2Type matrix A with one row per line and spaces or commas between numbers.
  3. 3For add, subtract or multiply, type matrix B the same way.
  4. 4Read the result matrix, its size, and the determinant, rank and trace of A.
  5. 5If you see an error, check that the sizes are compatible for that operation.

Formula and method

(AB)ᵢⱼ = Σₖ Aᵢₖ·Bₖⱼ; det [[a, b], [c, d]] = ad − bc; A⁻¹ = adj(A) ÷ det(A)

Matrix multiplication takes the dot product of each row of A with each column of B, so A must have as many columns as B has rows; the result has the rows of A and the columns of B. Addition and subtraction work entry by entry and need matrices of the same size.

For the determinant, rank and inverse the calculator uses Gauss–Jordan elimination with partial pivoting: it reduces A to the identity while applying the same row operations to an identity matrix, which becomes A⁻¹. The determinant is the product of the pivots, with the sign flipped for each row swap. If any pivot is zero, the matrix is singular and has no inverse.

A, B
Input matrices (rows on separate lines)
Aᵀ
Transpose: rows become columns
A⁻¹
Inverse: A × A⁻¹ = I (identity)
det(A)
Determinant — zero means A is not invertible

Worked examples

Multiply two 2×2 matrices

Row 1 of A (2, 1) times the columns of B gives 2·1 + 1·3 = 5 and 2·2 + 1·4 = 8. Row 2 (5, 3) gives 5·1 + 3·3 = 14 and 5·2 + 3·4 = 22. det(A) = 2·3 − 1·5 = 1.

Inverse of a 2×2 matrix

det = 4·6 − 7·2 = 10. Swap the diagonal, negate the off-diagonal and divide by 10: [[6, −7], [−2, 4]] ÷ 10 = [[0.6, −0.7], [−0.2, 0.4]].

Determinant of a 3×3 matrix

Expanding along the first row: 2·(0·5 − (−1)·4) − (−3)·(2·5 − (−1)·1) + 1·(2·4 − 0·1) = 8 + 33 + 8 = 49. Because it is non-zero, the matrix has full rank 3.

A singular matrix

The second row is exactly twice the first, so det = 1·4 − 2·2 = 0, the rank is only 1 and no inverse exists.

Bracket notation: transpose of a 2×3 matrix

Nested brackets are read row by row, so A is 2×3. Its transpose swaps rows and columns to give a 3×2 matrix. A is not square, so it has no determinant, trace or inverse (those outputs are hidden); its two rows are independent, so the rank is 2.

Frequently asked questions

How do you multiply two matrices?+

Each entry of the product is the dot product of a row of the first matrix with a column of the second. A must have as many columns as B has rows; an m×n matrix times an n×p matrix gives an m×p result.

Is matrix multiplication commutative?+

No. In general A × B ≠ B × A, and one of them may not even be defined when the sizes differ. That is why the order in which you enter the matrices matters.

When does a matrix have an inverse?+

A matrix is invertible only if it is square and its determinant is not zero (equivalently, its rank equals its size). A zero determinant means the rows are linearly dependent.

How do you find the inverse of a 2×2 matrix?+

For [[a, b], [c, d]], swap a and d, change the signs of b and c, and divide every entry by the determinant ad − bc. If ad − bc = 0 there is no inverse.

What does the determinant tell you?+

Its absolute value is the factor by which the matrix scales area (2D) or volume (3D), and its sign tells you whether orientation flips. A determinant of zero means the transformation squashes space into a lower dimension.

Related tools