Skip to content

Matrix Calculator

Multiply, add, invert and transpose matrices.

Inputs

Example: A × B
[[19, 22], [43, 50]]

Use this calculator on your own site

Free embed

  • Two lines of HTML, unlimited views
  • Shows a small CalculateEveryday bar, with a credit link under the calculator

What each Matrix input means

Operation
Multiply, add or subtract two matrices, or find the inverse, determinant or transpose of A alone. The determinant and inverse need a square A.
Matrix A
Matrix A, row by row: entries separated by spaces or commas, rows by semicolons or new lines, so 1 2 3; 4 5 6 is a 2 × 3. Up to 6 × 6, and every row needs the same number of entries.
Matrix B
Matrix B, in the same format, used only for A × B, A + B and A − B. For a product, B needs as many rows as A has columns; for a sum, the same size as A.

Matrix formula

(A × B)ᵢⱼ = Σₖ Aᵢₖ·Bₖⱼ — row i of A times column j of B. Inverse: row-reduce [A | I] until the left side is I; the right side is A⁻¹

Addition and subtraction work entry by entry and need matrices of the same size. Multiplication pairs each row of A with each column of B, so A must have as many columns as B has rows. The inverse is found by writing A beside the identity matrix and row-reducing; if a pivot turns out to be zero the determinant is zero and no inverse exists.

Formula last checked against OpenStax College Algebra 2e, §7.5 'Matrices and Matrix Operations' and §7.7 'Solving Systems with Inverses' (inverse by augmenting with the identity) on 2 October 2026. Built and maintained by Suman Kumar · How we check

Matrix worked example

For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], the top-left entry is 1×5 + 2×7 = 19 and the top-right is 1×6 + 2×8 = 22. The bottom row gives 43 and 50, so A × B = [[19, 22], [43, 50]].

More Matrix examples

The inverse of [[4, 7], [2, 6]]: its determinant is 4 × 6 − 7 × 2 = 10, so the inverse is [[6, −7], [−2, 4]] ÷ 10 = [[0.6, −0.7], [−0.2, 0.4]]. Multiplying the two together gives the identity matrix, which is the check.

A 2 × 3 times a 3 × 2 gives a 2 × 2. Top left: 1 × 7 + 2 × 9 + 3 × 11 = 58; top right: 1 × 8 + 2 × 10 + 3 × 12 = 64; the bottom row works out to 139 and 154. So A × B = [[58, 64], [139, 154]].

The determinant of [[2, 0, 1], [1, 3, 2], [1, 1, 1]] is 2(3 − 2) − 0 + 1(1 − 3) = 0, so this matrix has no inverse. The reason is visible in the columns: the third, (1, 2, 1), is half the first plus half the second.

Where the Matrix calculator can give the wrong answer

  • Order matters: A × B is generally not B × A. With the example matrices, B × A is [[23, 34], [31, 46]].
  • Only square matrices have a determinant or an inverse, and only those with a non-zero determinant have an inverse.
  • Inverses are computed in floating point and shown to four decimals. An entry such as 1/3 appears as 0.3333, and a nearly singular matrix can produce large, unreliable entries.
  • Matrices up to 6 × 6 are accepted. Every row needs the same number of entries or the page says which matrix is ragged.

Spotted a mistake? Tell us

Matrix reference table

Matrix operations: what each needs and what it gives
OperationSizes allowedSize of the resultDoes order matter?
A + B, A − BThe same size, m × nm × nNot for A + B; A − B = −(B − A)
A × BA is m × n and B is n × pm × pYes: A × B is generally not B × A
Transpose of AAny m × nn × m—
Determinant of ASquare, n × nA single number—
Inverse of ASquare, with a determinant other than 0n × nA × A⁻¹ = A⁻¹ × A = I
Source: OpenStax College Algebra 2e, §7.5 'Matrices and Matrix Operations' and §7.7 'Solving Systems with Inverses'

Matrix FAQ

Entries separated by spaces or commas, rows separated by semicolons. 1 2 3; 4 5 6 is a matrix with 2 rows and 3 columns.