Matrix Calculator

Calculate determinants, inverses (Gauss–Jordan), ranks, powers and scalar multiples, or add, subtract, multiply and transpose matrices, with exact fractions.

Result matrix[19, 22] [43, 50]

Put commas between the numbers in a row, and a semicolon or new line between rows. For example 1, 2; 3, 4 is a 2 × 2 matrix. Fractions such as 3/4 are kept exact.

To add or take away, B must be the same size as A. For A × B, B needs as many rows as A has columns.

Result matrix

[19, 22] [43, 50]

  • Dimensions2 rows × 2 columns
Result matrix
Column 1Column 2
1922
4350

Real-valued matrices up to 6 × 6. Matrix multiplication is ordered: A × B generally differs from B × A.

How this was calculated

  1. Each result entry is the dot product of a row of A and a column of B: multiply the matching numbers, then add them up. A has 2 columns and B has 2 rows, so they fit together.(AB)ᵢⱼ = row i of A · column j of BPut in your numbers: A is 2 × 2, B is 2 × 2Answer: the answer is 2 × 2
  2. Row 1 of A times column 1 of B.entry (1, 1)Put in your numbers: 1 × 5 + 2 × 7Answer: 19
  3. Row 1 of A times column 2 of B.entry (1, 2)Put in your numbers: 1 × 6 + 2 × 8Answer: 22
  4. Row 2 of A times column 1 of B.entry (2, 1)Put in your numbers: 3 × 5 + 4 × 7Answer: 43
  5. Row 2 of A times column 2 of B.entry (2, 2)Put in your numbers: 3 × 6 + 4 × 8Answer: 50

Matrices in simple words

A matrix is a grid of numbers in rows (across) and columns (down). A 2 × 2 matrix has 2 rows and 2 columns, such as [1, 2; 3, 4].

To add two matrices of the same size, add the numbers in the same spot: [1, 2; 3, 4] + [5, 6; 7, 8] = [6, 8; 10, 12].

To multiply A × B, take a row of A and a column of B, multiply the matching numbers and add them up. For the top-left entry of [1, 2; 3, 4] × [5, 6; 7, 8]: 1 × 5 + 2 × 7 = 19.

The determinant is one number worked out from a square matrix. For [a, b; c, d] it is a × d − b × c, so for [1, 2; 3, 4] it is 4 − 6 = −2. If it is 0, the matrix has no inverse.

Formula and method

For A × B, each output entry is a row-column dot product. A’s column count must match B’s row count; addition requires identical dimensions.

Worked example

Multiplying [[1, 2], [3, 4]] by [[5, 6], [7, 8]] gives [[19, 22], [43, 50]].

Determinant, inverse, rank and powers

A 2 × 2 determinant is ad − bc: det [[1, 2], [3, 4]] = 1 × 4 − 2 × 3 = −2. A 3 × 3 expands along the first row, a(ei − fh) − b(di − fg) + c(dh − eg), and larger matrices are row-reduced: the determinant is the product of the pivots, with the sign flipped once for each row swap.

A matrix has an inverse only when its determinant is not zero. For 2 × 2, A⁻¹ = (1/det) × [[d, −b], [−c, a]], so [[4, 7], [2, 6]] has det 10 and inverse 1/10 × [[6, −7], [−2, 4]] = [[3/5, −7/10], [−1/5, 2/5]]. Larger matrices use Gauss–Jordan elimination on [A | I], shown column by column, and the result is checked by A × A⁻¹ = I.

Rank counts the pivots left after row reduction: [[1, 2], [2, 4]] has rank 1 because the second row is twice the first. Aⁿ multiplies A by itself n times (A⁰ is the identity), which is not the same as raising each entry to the power n. All of these use exact fractions, so 1/3 stays 1/3 instead of 0.333333.

Frequently asked questions

Does matrix multiplication depend on order?

Yes. A × B generally differs from B × A, and one order may be undefined even if the other is valid.

References

Last updated . Results are estimates for informational purposes only.