✕ Matrix Multiplication Calculator

Matrix Multiplication Calculator

Matrix multiplication combines two matrices by computing the dot product of each row of the first with each column of the second, and this calculator shows every element computation. Auto-checks dimension compatibility.

✕

Matrix Multiplication A × B

Enter matrices A and B with compatible dimensions

✓ Step-by-Step✓ Any Dims✓ Free⚡ Loading precision engine…
ℹ For A (m×n) × B (n×p): the number of columns in A must equal the number of rows in B.
Matrix A
×
Matrix B
Quick Examples

Matrix Multiplication Rules

The product of A (m×n) and B (n×p) is matrix C (m×p) where:

$$C_{ij} = \sum_{k=1}^{n} A_{ik} \cdot B_{kj}$$

Each element of C is the dot product of row i of A with column j of B.

Key Properties

  • Not commutative: AB ≠ BA in general
  • Associative: (AB)C = A(BC)
  • Distributive: A(B+C) = AB + AC
  • Dimension rule: A(m×n) × B(n×p) = C(m×p)
  • det(AB) = det(A) × det(B) for square matrices

Worked Example

For A = [[1,2],[3,4]] and B = [[5,6],[7,8]]: the top-left entry of A×B is (1×5)+(2×7) = 19. Working through all four positions gives A×B = [[19,22],[43,50]].

Dimension Rule

To multiply A×B, the number of columns in A must equal the number of rows in B. If A is 2×3 and B is 3×4, the result will be 2×4 — the outer dimensions.

Applications

  • Combining multiple transformations in computer graphics (rotating, then scaling an image)
  • Neural networks, where multiplying inputs by weight matrices is the core operation
  • Economics, for modeling how multiple inputs combine to produce outputs

Frequently Asked Questions

Usually not — matrix multiplication is generally not commutative, meaning order matters. A × B and B × A can give completely different results, or one may not even be possible.
Each entry in the result comes from pairing up a row of A with a column of B. This only works if the row length in A matches the column length in B.
Yes — multiply two at a time and use the result to multiply by the next one. As long as each pair has compatible dimensions, you can chain as many as you like.

Related Calculators