Get in touch

Contact Form Demo

Matrix Multiplication Calculator

Multiply Matrix A by Matrix B with Step-by-Step Dot Products

$$ A \times B = C $$
Matrix A
×
Matrix B
Standard
1
2
3
/
4
5
6
7
8
9
.
0
CLR
Next
Result Matrix (C)
Visual Representation
Dot Product Steps
👨‍🏫
By Prof. David Anderson
Professor of Linear Algebra | 20+ Years Teaching Experience
“Most students treat Matrix Multiplication like a chore of arithmetic. But I see it as a powerful machine. When you multiply Matrix A by Matrix B, you aren’t just crunching numbers—you are applying a linear transformation (rotation, scaling, or skewing) to a set of vectors. I designed this Matrix Multiplication Calculator to help you see the ‘Row-by-Column’ pattern clearly, ensuring you never mix up your indices again.”

The Professor’s Master Class on Matrix Multiplication: The Row-by-Column Method

A Complete Handbook on Dot Products, Dimensions, and Non-Commutativity
Key Takeaways for Students
  • Golden Rule of Dimensions: You can only multiply if the inner dimensions match ($m \times \mathbf{n}$ and $\mathbf{n} \times p$). The result is $m \times p$.
  • The Method: Calculate the Dot Product of Row $i$ from Matrix A and Column $j$ from Matrix B.
  • Order Matters: Matrix multiplication is Non-Commutative ($AB \neq BA$).
  • Identity Matrix: Multiplying any matrix by the Identity Matrix ($I$) leaves it unchanged ($AI = A$).

Welcome to the definitive guide on Multiplying Matrices. In scalar math, $3 \times 4$ is the same as $4 \times 3$. In the world of Linear Algebra, this rule breaks. Order is everything. Whether you are transforming 3D graphics or solving systems of equations, mastering the Matrix Product is essential.

Our Matrix Multiplication Calculator above is designed to handle the tedious arithmetic for 2×2 and 3×3 matrices, showing you exactly which row paired with which column to produce the final result.

1. The Dimension Compatibility Check (Can I Multiply?)

Before you start calculating, you must check if the Matrix Product is even defined. This is the most common mistake on exams.

The Rule: If Matrix A is size $m \times \mathbf{n}$ and Matrix B is size $\mathbf{n} \times p$, then the result C will be size $m \times p$. The inner numbers ($\mathbf{n}$) MUST match.
Matrix A Matrix B Compatible? Result Size
$2 \times 3$ $3 \times 2$ ✅ Yes (3=3) $2 \times 2$
$2 \times 2$ $2 \times 2$ ✅ Yes (2=2) $2 \times 2$
$2 \times 3$ $2 \times 3$ ❌ No (3 $\neq$ 2) Undefined

2. The “Row-by-Column” Dot Product Method

To find the element in the $i$-th row and $j$-th column of the result ($c_{ij}$), you take the Dot Product of the $i$-th row of A and the $j$-th column of B.

The Algorithm

Let $A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$ and $B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}$.

To find the top-left element ($c_{11}$): Multiply Row 1 of A by Col 1 of B.

$$ c_{11} = (1 \cdot 5) + (2 \cdot 7) = 5 + 14 = 19 $$

To find the bottom-right element ($c_{22}$): Multiply Row 2 of A by Col 2 of B.

$$ c_{22} = (3 \cdot 6) + (4 \cdot 8) = 18 + 32 = 50 $$

3. Properties of Matrix Multiplication

Unlike regular numbers, matrices behave differently. Understanding these properties helps you avoid traps.

  • Non-Commutative: $AB \neq BA$. Changing the order changes the result.
  • Associative: $(AB)C = A(BC)$. You can group multiplication however you like.
  • Distributive: $A(B + C) = AB + AC$. You can distribute matrices across addition.
  • Identity Element: $AI = IA = A$. The Identity Matrix works like the number “1”.
  • Zero Property: $A \cdot 0 = 0$. Multiplying by a Zero Matrix results in a Zero Matrix.

4. Why Order Matters (Non-Commutative Property)

Why is $AB \neq BA$? Think of matrices as transformations.

Visual Analogy

Imagine putting on your shoes and socks.

  • Operation A: Put on socks.
  • Operation B: Put on shoes.

If you do $A$ then $B$ ($BA$), you are ready to go. If you do $B$ then $A$ ($AB$), you are wearing socks over your shoes! The result is fundamentally different.

5. Real-World Application: AI & Neural Networks

Matrix multiplication is the engine behind Artificial Intelligence.

In a Neural Network, the input data (like an image) is a vector $x$. The “brain” consists of layers of neurons, represented by a Weight Matrix $W$. To process the data, the network calculates the Matrix Product:

$$ y = W \cdot x + b $$

A single query to ChatGPT involves billions of matrix multiplications! Efficient matrix calculation (on GPUs) is why modern AI exists.

6. Frequently Asked Questions (FAQ)

Can I divide matrices?
No, matrix division is not defined. Instead, we multiply by the Inverse Matrix ($A^{-1}$). So instead of $B / A$, we compute $B \cdot A^{-1}$ (or $A^{-1} \cdot B$, depending on the side). Check out our Inverse Matrix Calculator for that!
What is the Identity Matrix?
The Identity Matrix ($I$) acts like the number “1”. It has 1s on the diagonal and 0s everywhere else. It is the neutral element for multiplication.
Why does the calculator use fractions?
Precision is key in Linear Algebra. Decimals like 0.333 are approximations. Our calculator uses a computer algebra system (Math.js) to keep results as Exact Fractions ($1/3$) whenever possible.

References & Further Reading

  • Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. (Chapter 2: Matrix Algebra).
  • Lay, D. C. (2015). Linear Algebra and Its Applications (5th ed.). Pearson. (Section 2.1: Matrix Operations).
  • Khan Academy. “Multiplying matrices.” Watch Video

Start Multiplying Matrices Like a Pro

Stop doing dot products by hand and risking arithmetic errors. Use our free Matrix Multiplication Calculator to instantly visualize the operation, check your homework, and understand the logic.

Calculate Product Now