Matrix Multiplication Notes

Published on: September 29, 2026

This Matrix Multiplication Calculator multiplies two matrices and shows the working line by line. The columns of the first must match the rows of the second, and the answer takes its shape from the outer two sizes. Each entry comes from one row and one column, multiplied term by term and added. Order matters, as \(AB\) and \(BA\) are often different. Following the same pattern every time makes matrix multiplication easy to check and repeat.

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of the first matrix with each column of the second.
  4. Add the products in each position to get the answer.

Formula:

\((AB)_{ij} = \sum_{k} a_{ik} \, b_{kj}\)
See Example 1 Hide Example 1

Problem

\(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \times \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of the first matrix with each column of the second.
  4. Add the products in each position to get the answer.

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 2\) and Matrix B is \(2 \times 2\). The inner sizes match, so the answer will be \(2 \times 2\).

\(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \times \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of the answer comes from one row of the first matrix and one column of the second, multiplied term by term and added up.

\((AB)_{ij} = \sum_{k} a_{ik} \, b_{kj}\)

Step 3

Step 3 - Pair each row of the first matrix with each column of the second.

In this problem: Pairing each row with each column gives \(1 \cdot 5 + 2 \cdot 7\), \(1 \cdot 6 + 2 \cdot 8\), \(3 \cdot 5 + 4 \cdot 7\), \(3 \cdot 6 + 4 \cdot 8\).

\(\begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \cdot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix}\)

Step 4

Step 4 - Add the products in each position to get the answer.

In this problem: Adding the products in each position: \(5 + 14 = 19\), \(6 + 16 = 22\), \(15 + 28 = 43\), \(18 + 32 = 50\).

\(\begin{pmatrix} 5 + 14 & 6 + 16 \\ 15 + 28 & 18 + 32 \end{pmatrix} = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}\)

Final Answer

\(AB = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}\)
See Example 2 Hide Example 2

Problem

\(\begin{pmatrix} 2 & 0 & -1 \\ 3 & 1 & 4 \end{pmatrix} \times \begin{pmatrix} 1 & 2 \\ 0 & 5 \\ -2 & 3 \end{pmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of the first matrix with each column of the second.
  4. Add the products in each position to get the answer.

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 3\) and Matrix B is \(3 \times 2\). The inner sizes match, so the answer will be \(2 \times 2\).

\(\begin{pmatrix} 2 & 0 & -1 \\ 3 & 1 & 4 \end{pmatrix} \times \begin{pmatrix} 1 & 2 \\ 0 & 5 \\ -2 & 3 \end{pmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of the answer comes from one row of the first matrix and one column of the second, multiplied term by term and added up.

\((AB)_{ij} = \sum_{k} a_{ik} \, b_{kj}\)

Step 3

Step 3 - Pair each row of the first matrix with each column of the second.

In this problem: Pairing each row with each column gives \(2 \cdot 1 + 0 \cdot 0 + (-1) \cdot (-2)\), \(2 \cdot 2 + 0 \cdot 5 + (-1) \cdot 3\), \(3 \cdot 1 + 1 \cdot 0 + 4 \cdot (-2)\), \(3 \cdot 2 + 1 \cdot 5 + 4 \cdot 3\).

\(\begin{pmatrix} 2 \cdot 1 + 0 \cdot 0 + (-1) \cdot (-2) & 2 \cdot 2 + 0 \cdot 5 + (-1) \cdot 3 \\ 3 \cdot 1 + 1 \cdot 0 + 4 \cdot (-2) & 3 \cdot 2 + 1 \cdot 5 + 4 \cdot 3 \end{pmatrix}\)

Step 4

Step 4 - Add the products in each position to get the answer.

In this problem: Adding the products in each position: \(2 + 0 + 2 = 4\), \(4 + 0 + -3 = 1\), \(3 + 0 + -8 = -5\), \(6 + 5 + 12 = 23\).

\(\begin{pmatrix} 2 + 0 + 2 & 4 + 0 + -3 \\ 3 + 0 + -8 & 6 + 5 + 12 \end{pmatrix} = \begin{pmatrix} 4 & 1 \\ -5 & 23 \end{pmatrix}\)

Final Answer

\(AB = \begin{pmatrix} 4 & 1 \\ -5 & 23 \end{pmatrix}\)
See Example 3 Hide Example 3

Problem

\(\begin{pmatrix} 2 & 3 \\ 1 & 4 \end{pmatrix} \times \begin{pmatrix} 1 & 0 \\ 5 & 2 \end{pmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of the first matrix with each column of the second.
  4. Add the products in each position to get the answer.

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 2\) and Matrix B is \(2 \times 2\). The inner sizes match, so the answer will be \(2 \times 2\).

\(\begin{pmatrix} 2 & 3 \\ 1 & 4 \end{pmatrix} \times \begin{pmatrix} 1 & 0 \\ 5 & 2 \end{pmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of the answer comes from one row of the first matrix and one column of the second, multiplied term by term and added up.

\((AB)_{ij} = \sum_{k} a_{ik} \, b_{kj}\)

Step 3

Step 3 - Pair each row of the first matrix with each column of the second.

In this problem: Pairing each row with each column gives \(2 \cdot 1 + 3 \cdot 5\), \(2 \cdot 0 + 3 \cdot 2\), \(1 \cdot 1 + 4 \cdot 5\), \(1 \cdot 0 + 4 \cdot 2\).

\(\begin{pmatrix} 2 \cdot 1 + 3 \cdot 5 & 2 \cdot 0 + 3 \cdot 2 \\ 1 \cdot 1 + 4 \cdot 5 & 1 \cdot 0 + 4 \cdot 2 \end{pmatrix}\)

Step 4

Step 4 - Add the products in each position to get the answer.

In this problem: Adding the products in each position: \(2 + 15 = 17\), \(0 + 6 = 6\), \(1 + 20 = 21\), \(0 + 8 = 8\).

\(\begin{pmatrix} 2 + 15 & 0 + 6 \\ 1 + 20 & 0 + 8 \end{pmatrix} = \begin{pmatrix} 17 & 6 \\ 21 & 8 \end{pmatrix}\)

Final Answer

\(AB = \begin{pmatrix} 17 & 6 \\ 21 & 8 \end{pmatrix}\)
See Example 4 Hide Example 4

Problem

\(\begin{pmatrix} 1 & 2 & 0 \\ -1 & 3 & 2 \end{pmatrix} \times \begin{pmatrix} 3 & 1 \\ 2 & 0 \\ 1 & 4 \end{pmatrix}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Pair each row of the first matrix with each column of the second.
  4. Add the products in each position to get the answer.

Step 1

Step 1 - Set up the problem.

In this problem: Matrix A is \(2 \times 3\) and Matrix B is \(3 \times 2\). The inner sizes match, so the answer will be \(2 \times 2\).

\(\begin{pmatrix} 1 & 2 & 0 \\ -1 & 3 & 2 \end{pmatrix} \times \begin{pmatrix} 3 & 1 \\ 2 & 0 \\ 1 & 4 \end{pmatrix}\)

Step 2

Step 2 - Write the formula.

In this problem: Each entry of the answer comes from one row of the first matrix and one column of the second, multiplied term by term and added up.

\((AB)_{ij} = \sum_{k} a_{ik} \, b_{kj}\)

Step 3

Step 3 - Pair each row of the first matrix with each column of the second.

In this problem: Pairing each row with each column gives \(1 \cdot 3 + 2 \cdot 2 + 0 \cdot 1\), \(1 \cdot 1 + 2 \cdot 0 + 0 \cdot 4\), \((-1) \cdot 3 + 3 \cdot 2 + 2 \cdot 1\), \((-1) \cdot 1 + 3 \cdot 0 + 2 \cdot 4\).

\(\begin{pmatrix} 1 \cdot 3 + 2 \cdot 2 + 0 \cdot 1 & 1 \cdot 1 + 2 \cdot 0 + 0 \cdot 4 \\ (-1) \cdot 3 + 3 \cdot 2 + 2 \cdot 1 & (-1) \cdot 1 + 3 \cdot 0 + 2 \cdot 4 \end{pmatrix}\)

Step 4

Step 4 - Add the products in each position to get the answer.

In this problem: Adding the products in each position: \(3 + 4 + 0 = 7\), \(1 + 0 + 0 = 1\), \(-3 + 6 + 2 = 5\), \(-1 + 0 + 8 = 7\).

\(\begin{pmatrix} 3 + 4 + 0 & 1 + 0 + 0 \\ -3 + 6 + 2 & -1 + 0 + 8 \end{pmatrix} = \begin{pmatrix} 7 & 1 \\ 5 & 7 \end{pmatrix}\)

Final Answer

\(AB = \begin{pmatrix} 7 & 1 \\ 5 & 7 \end{pmatrix}\)