Skip to content

Matrix Calculator

Type two matrices into the grids, choose their sizes, and click an operation.

MathUpdated Free · No sign-up

How to use the Matrix Calculator

  1. Open the Matrix Calculator above.
  2. Type with your keyboard or tap the on-screen buttons; the result appears straight away.
  3. Change any value and run it again as often as you like. Nothing you enter leaves your device.

Matrix operations

A matrix is a rectangular grid of numbers with a given number of rows and columns. A 2 × 3 matrix has 2 rows and 3 columns. Which operations are allowed depends on the sizes:

Operation Size rule How
A + B, A − B same size add or subtract matching entries
A × B columns of A = rows of B row of A times column of B for each entry
k × A any multiply every entry by k
Transpose Aᵀ any rows become columns
det(A), A⁻¹, Aⁿ square see below
rank(A) any number of independent rows

Multiplying matrices

Each entry of the product is a dot product: entry (i, j) of A × B is row i of A multiplied term by term with column j of B, then added up. For A = [1 2; 3 4] and B = [5 6; 7 8], the top-left entry is 1 × 5 + 2 × 7 = 19 and the full product is [19 22; 43 50]. Order matters: B × A is usually different, so the calculator offers both.

The determinant

The determinant is a single number that tells you whether a square matrix can be inverted and how it scales areas or volumes. For a 2 × 2 matrix [a b; c d] it is ad − bc, so det [1 2; 3 4] = 4 − 6 = −2. For 3 × 3 the calculator shows the cofactor expansion along the first row. Larger matrices are reduced to triangular form by Gaussian elimination; the determinant is then the product of the diagonal pivots, with the sign flipped for every row swap.

The inverse

The inverse A⁻¹ undoes A, so A × A⁻¹ = I, the identity matrix. It exists only when the determinant is not zero. For 2 × 2:

[a b; c d]⁻¹ = (1 ÷ (ad − bc)) × [d −b; −c a]

For [4 7; 2 6] the determinant is 24 − 14 = 10, giving [0.6 −0.7; −0.2 0.4]. Larger inverses use Gauss–Jordan elimination on A placed next to the identity matrix. If the determinant is 0 the matrix is singular and the calculator says so instead of printing huge meaningless numbers.

Rank and powers

The rank is the number of rows that are not combinations of other rows. [1 2; 2 4] has rank 1 because the second row is twice the first. Powers multiply a square matrix by itself; A⁰ is the identity and a negative power uses the inverse. Results are rounded to ten significant digits and values within about 10⁻¹⁰ of zero are shown as 0, which hides floating-point noise. Use “Copy to A” to chain operations.

Frequently asked questions

When can two matrices be multiplied?

When the number of columns in the first equals the number of rows in the second. A 2 × 3 matrix times a 3 × 4 matrix gives a 2 × 4 matrix.

Why does my matrix have no inverse?

Its determinant is zero, which means one row (or column) is a combination of others. Such a matrix is called singular and cannot be inverted.

Is A × B the same as B × A?

Usually not. Matrix multiplication is not commutative, which is why the calculator offers both orders.

Can I enter fractions?

Yes. Type entries like 1/3 or −2/5, or expressions such as √2. Results are shown as decimals.