Matrix Calculator
Multiply, add, invert and transpose matrices.
Inputs
| Col 1 | Col 2 |
|---|---|
| 19 | 22 |
| 43 | 50 |
- Size
- 2 × 2
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
| Operation | Sizes allowed | Size of the result | Does order matter? |
|---|---|---|---|
| A + B, A − B | The same size, m × n | m × n | Not for A + B; A − B = −(B − A) |
| A × B | A is m × n and B is n × p | m × p | Yes: A × B is generally not B × A |
| Transpose of A | Any m × n | n × m | — |
| Determinant of A | Square, n × n | A single number | — |
| Inverse of A | Square, with a determinant other than 0 | n × n | A × A⁻¹ = A⁻¹ × A = I |
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.
- The number of columns in A has to equal the number of rows in B. A 2 × 3 can multiply a 3 × 2 (giving a 2 × 2), but a 2 × 2 cannot multiply a 3 × 3. The error message shows both sizes.
- Each entry of the answer is a row of the first matrix times a column of the second, added up. [1 2; 3 4] × [5 6; 7 8]: the top-left entry is 1 × 5 + 2 × 7 = 19.
- Choose the inverse operation. The page uses OpenStax's method of augmenting with the identity matrix and row-reducing; a matrix with a determinant of 0 has no inverse.
- Swap the two entries on the main diagonal, change the signs of the other two, and divide everything by the determinant ad − bc. For [[4, 7], [2, 6]] the determinant is 10, so the inverse is [[6, −7], [−2, 4]] ÷ 10. If ad − bc = 0 there is no inverse.
- The matrix flipped over its main diagonal, so rows become columns. The transpose of the 2 × 3 matrix 1 2 3; 4 5 6 is the 3 × 2 matrix [[1, 4], [2, 5], [3, 6]].
Related calculators
- Matrix Determinant Calculator (2×2, 3×3, 4×4 and up, with Steps)
- Quadratic Formula Calculator: Roots, Discriminant, Vertex (With Steps)
- Simplify Fractions Calculator: Lowest Terms, Mixed Number, Decimal
- Exponent Calculator (Powers, Negative and Fractional Exponents, Solve for x)
- Pearson Correlation Coefficient Calculator (r, R² and the Regression Line)