Math Last updated: July 2026

Matrix Multiplication Calculator

The Matrix Multiplication Calculator computes the product of two matrices using the standard row-by-column dot product method. Enter your matrices, and the calculator validates dimension compatibility, performs the multiplication, and shows each step of the calculation.

How to Use the Matrix Multiplication Calculator

Interactive calculator available after JavaScript loads.

Loading calculator...

Written by Calculator Archive Team

Math & Finance Experts — Verified Formulas, Peer-Reviewed Sources, Expert Analysis

Looking for a deeper explanation?

Read our comprehensive, peer-reviewed educational article in our Blog to learn the underlying math, formulas, and step-by-step examples.

Read Blog Guide ›

Mathematical Formula & Logic

(AB)ᵢⱼ = Σₖ₌₁ᵖ Aᵢₖ × Bₖⱼ, where the dot product of row i from A and column j from B gives element (i,j) of the result.
Variable Glossary
A First matrix of size m × p
B Second matrix of size p × n
AB Result matrix of size m × n
i Row index of the result matrix
j Column index of the result matrix
k Summation index running from 1 to p

Step-by-Step Worked Calculation

Scenario: Example: 2×2 Matrix Multiplication

Multiply A = [[1, 2], [3, 4]] by B = [[5, 6], [7, 8]].

1

Step 1: Verify dimensions: A is 2×2, B is 2×2. Result will be 2×2.

2

Step 2: Compute (1,1): 1×5 + 2×7 = 5 + 14 = 19.

3

Step 3: Compute (1,2): 1×6 + 2×8 = 6 + 16 = 22.

4

Step 4: Compute (2,1): 3×5 + 4×7 = 15 + 28 = 43.

5

Step 5: Compute (2,2): 3×6 + 4×8 = 18 + 32 = 50.

6

Step 6: Result = [[19, 22], [43, 50]].

How to Use the Matrix Multiplication Calculator

  1. 1. Enter the dimensions for Matrix A (m × p).
  2. 2. Enter the dimensions for Matrix B (p × n). The number of columns in A must equal the rows in B.
  3. 3. Enter all elements for both matrices.
  4. 4. Click "Calculate" to compute the matrix product.
  5. 5. Review the result matrix and step-by-step dot product calculations.

What Is a Matrix Multiplication Calculator?

Matrix Multiplication Calculator is a mathematical computation tool that helps you multiply two matrices instantly with detailed step-by-step results. Validates dimensions and shows row-by-column dot product calculations. It applies established mathematical principles to deliver accurate results, often showing the underlying formula and step-by-step working so you can understand the computation process.

Why This Calculation Matters

Mathematical calculations form the foundation of science, engineering, finance, and everyday problem-solving. Matrix Multiplication Calculator helps you work through calculations accurately and efficiently, reducing the risk of manual arithmetic errors. Whether you are a student learning concepts, a professional verifying work, or anyone needing quick and reliable math results, this tool ensures precision and saves time.

Historical Background

Mathematics has evolved over thousands of years, from ancient Babylonian clay tablets and Egyptian papyri to Greek formal proofs by Euclid and Archimedes. The development of algebra by Persian mathematician al-Khwarizmi in the 9th century and the invention of calculus by Newton and Leibniz in the 17th century laid the groundwork for modern computation. Matrix Multiplication Calculator continues this tradition by making mathematical operations accessible through digital technology.

Frequently Asked Questions

Complete indexable directory of answers (23 questions)

What is matrix multiplication?

Matrix multiplication is an operation that produces a new matrix from two input matrices. Each element of the result is the dot product of a row from the first matrix and a column from the second matrix. It is fundamentally different from element-wise multiplication.

What are the rules for matrix multiplication dimensions?

For the product AB to be defined, the number of columns in A must equal the number of rows in B. If A is m × p and B is p × n, the result AB is an m × n matrix. If the dimensions do not match, multiplication is undefined.

Is matrix multiplication commutative?

No, matrix multiplication is generally NOT commutative: AB ≠ BA in most cases. The order of multiplication matters. In some special cases (like when both matrices are diagonal), commutativity may hold.

Is matrix multiplication associative?

Yes, matrix multiplication is associative: (AB)C = A(BC) for any compatible matrices A, B, and C. This means you can group multiplications in any order without changing the result.

Is matrix multiplication distributive?

Yes, matrix multiplication distributes over addition: A(B + C) = AB + AC and (A + B)C = AC + BC. However, the order of multiplication must be preserved due to non-commutativity.

What is the identity matrix in multiplication?

The identity matrix I acts as the multiplicative identity: AI = IA = A for any compatible matrix A. The identity matrix has 1s on the diagonal and 0s elsewhere.

What is the dot product in matrix multiplication?

The dot product is the sum of element-wise products of two vectors. In matrix multiplication, element (i,j) of the result is the dot product of row i from the first matrix and column j from the second matrix.

How do I multiply a 2×2 matrix by a 2×2 matrix?

For A = [[a,b],[c,d]] and B = [[e,f],[g,h]], the product is AB = [[ae+bg, af+bh], [ce+dg, cf+dh]]. Each element is the dot product of the corresponding row and column.

What happens if the dimensions are incompatible?

If the number of columns in A does not equal the number of rows in B, matrix multiplication is undefined. The calculator will display an error message indicating dimension mismatch.

Can I multiply a matrix by a vector?

Yes, a vector can be treated as a matrix with one column (or one row). Multiplying an m × n matrix by an n × 1 column vector produces an m × 1 column vector.

What is the computational complexity of matrix multiplication?

The standard algorithm has O(m × n × p) complexity for multiplying an m × p matrix by a p × n matrix. Optimized algorithms like Strassen's reduce this to approximately O(n^2.807) for square matrices.

What is the Hadamard product vs matrix multiplication?

The Hadamard (element-wise) product multiplies corresponding elements and requires identical dimensions. Standard matrix multiplication uses row-column dot products and requires compatible (but not necessarily identical) dimensions.

How does matrix multiplication relate to linear transformations?

Matrix multiplication corresponds to composition of linear transformations. If A transforms space and then B transforms it, the combined transformation is BA (applied right to left).

Can I multiply more than two matrices?

Yes, you can multiply any number of matrices sequentially, as long as adjacent matrices have compatible dimensions. Due to associativity, the grouping does not matter, but the order does.

What is the transpose of a product?

The transpose of a product equals the product of the transposes in reverse order: (AB)ᵀ = BᵀAᵀ. This is a key property used in many matrix algebra proofs.

What is the inverse of a product?

The inverse of a product equals the product of the inverses in reverse order: (AB)⁻¹ = B⁻¹A⁻¹, provided both A and B are invertible.

How is matrix multiplication used in computer graphics?

Matrix multiplication combines transformations like rotation, scaling, and translation. A single matrix can encode multiple transformations, and multiplying them applies all transformations efficiently.

What is the difference between matrix and scalar multiplication?

Scalar multiplication multiplies every element by a single number. Matrix multiplication combines rows and columns using dot products, producing a result that depends on the structure of both matrices.

Can I use matrix multiplication in programming?

Yes, matrix multiplication is available in most linear algebra libraries. In NumPy: A @ B or np.dot(A, B). In JavaScript, you need nested loops or a library like math.js.

What is matrix power?

Matrix power Aⁿ means multiplying A by itself n times: A³ = A × A × A. For n = 0, A⁰ = I (identity matrix). For n = —1, A⁻¹ is the inverse matrix.

What mathematical formula does the Matrix Multiplication Calculator use?

The Matrix Multiplication Calculator uses standard mathematical formulas validated against authoritative references. The specific formula is displayed in the calculator interface with a detailed explanation of each variable.

How can I verify the Matrix Multiplication Calculator results manually?

Each calculator includes a step-by-step worked example showing exactly how the formula is applied. You can follow these steps with pen and paper to verify any result.

What types of inputs does the Matrix Multiplication Calculator accept?

The Matrix Multiplication Calculator accepts numeric inputs including integers and decimals. Invalid inputs (letters, special characters) are rejected with clear error messages.