Matrix Multiplication Calculator

Multiply two matrices with detailed dot product calculations for each element.

Enter Matrices

Matrix A (2x2)
×
Matrix B (2x2)

Result

A × B =
Result Dimensions 2 x 2
Dot Products Computed 4

Step-by-Step Dot Products

C[i][j] = sum(A[i][k] × B[k][j]) for k=1..n

What is Matrix Multiplication?

Matrix multiplication is a binary operation that produces a new matrix from two input matrices. For the product AB to be defined, the number of columns in A must equal the number of rows in B. If A is an m×n matrix and B is an n×p matrix, the resulting matrix C = AB is an m×p matrix.

Each element C[i][j] is computed as the dot product of the i-th row of A and the j-th column of B.

How Matrix Multiplication Works

The Dot Product Method

  1. Take row i of matrix A.
  2. Take column j of matrix B.
  3. Multiply corresponding elements and sum the products.
  4. The result is element C[i][j].
  5. Repeat for every combination of rows from A and columns from B.

Key Properties

Not Commutative

In general, AB does not equal BA. Order matters.

AB ≠ BA (in general)

Associative

Grouping does not affect the result.

(AB)C = A(BC)

Distributive

Multiplication distributes over addition.

A(B + C) = AB + AC

Identity

The identity matrix leaves any matrix unchanged.

AI = IA = A

Applications

Matrix multiplication is essential in computer graphics (transformations, rotations, projections), machine learning (neural network forward passes), physics (quantum mechanics, relativity), economics (input-output models), and engineering (systems of differential equations). It is one of the most important operations in computational mathematics.

Common Pitfalls

  • Always verify that the inner dimensions match: columns of A must equal rows of B.
  • Remember that matrix multiplication is not commutative.
  • The result dimensions are: rows of A by columns of B.
  • Each element requires n multiplications and (n-1) additions, where n is the shared dimension.