Matrix multiplication made simple: choose dimensions, generate input fields, enter values, and calculate A × B instantly.
Allowed size: 1 to 8 rows/columns per matrix.
Matrix A
Matrix B
What this multiply matrix calculator does
This tool computes the product of two matrices using standard linear algebra rules. If Matrix A has size m × n and Matrix B has size n × p, the result is a new matrix with size m × p. The calculator handles that dimension logic for you and gives a clean result matrix immediately.
Because matrix multiplication can be tedious by hand, this calculator is useful for students, engineers, data analysts, and anyone working with systems of equations, transformations, or machine learning pipelines.
How matrix multiplication works
The core rule
You can multiply matrices only when the number of columns in the first matrix equals the number of rows in the second matrix. In symbols:
(m × n) · (n × p) = (m × p)
Dot product at each cell
Each result cell is a dot product between one row from Matrix A and one column from Matrix B. For element C(i,j):
C(i,j) = A(i,1)·B(1,j) + A(i,2)·B(2,j) + ... + A(i,n)·B(n,j)
Quick example
If:
- A = [[1, 2, 3], [4, 5, 6]] (2 × 3)
- B = [[7, 8], [9, 10], [11, 12]] (3 × 2)
Then A × B gives a 2 × 2 matrix:
- First row: [58, 64]
- Second row: [139, 154]
Use the Load Example button to see this exact case in the calculator.
How to use this calculator
- Set rows and columns for Matrix A.
- Set columns for Matrix B (rows of B auto-match columns of A).
- Click Generate Matrices.
- Enter all matrix values (integers or decimals).
- Click Multiply A × B to get the result.
Common mistakes to avoid
- Dimension mismatch: multiplication is not defined if inner dimensions do not match.
- Order confusion: A × B is generally not the same as B × A.
- Input blanks: every cell needs a numeric value.
- Arithmetic slipups: each result cell needs a full row-column dot product.
Why matrix multiplication matters
Matrix multiplication is fundamental in many real-world fields:
- Computer graphics: rotating, scaling, and translating objects.
- Machine learning: neural network forward passes and model training.
- Economics and operations research: input-output models and optimization.
- Physics and engineering: state-space models and linear transformations.
FAQ
Can I multiply non-square matrices?
Yes. Matrices do not need to be square. The only requirement is that columns of A equal rows of B.
Does this support decimals and negative values?
Yes. You can enter positive, negative, and decimal numbers in any matrix cell.
What is the largest matrix size here?
This page supports up to 8 × 8 inputs for each matrix to keep the interface readable and fast.