Math calculators

Matrix Multiplication Calculator

Updated Jun 27, 2026 By Jehan Wadia
Formulas
Matrix A (N × M)
Matrix B (N × M)
Cells accept integers, decimals, fractions (1/2) and complex numbers (3+2i). Use arrow keys or Tab to move between cells; press Enter to calculate.

Introduction

This matrix multiplication calculator lets you multiply two matrices together, raise a matrix to a power, or multiply a matrix by a scalar. Enter your values, press calculate, and get your answer instantly with step-by-step work shown for every entry. The calculator handles matrices up to 10×10 and supports integers, decimals, fractions, and even complex numbers.

Matrix multiplication is a key operation in linear algebra. To multiply two matrices, you take the dot product of each row in the first matrix with each column in the second. The number of columns in the first matrix must equal the number of rows in the second. This tool checks that rule for you, does all the math, and breaks each step down so you can follow along and learn. You can also verify your own answers using the built-in checker.

How to Use Our Matrix Multiplication Calculator

Enter your matrices and choose an operation. The calculator will show the product, step-by-step work, and a heatmap of the result.

Pick an operation mode. Choose "Matrix × Matrix" to multiply two matrices together. Choose "Matrix Power" to raise a square matrix to an exponent. Choose "Scalar × Matrix" to multiply every element in a matrix by a single number.

Try a quick example. Click any example button to load sample values and see results right away. This is a good way to learn how the tool works.

Set your matrix size. Enter the number of rows and columns for each matrix. For Matrix × Matrix mode, the number of columns in Matrix A must equal the number of rows in Matrix B. The compatibility badge tells you if your sizes work.

Click "Set Matrices" to build the input grids. You can also just start typing — the grids update when you change the size.

Fill in your matrix values. Type a number into each cell. You can use whole numbers, decimals, fractions like 1/2, or complex numbers like 3+2i. Use arrow keys or Tab to move between cells.

For Matrix Power mode, enter an exponent. Type a whole number from 0 to 10. Power 0 gives the identity matrix. Power 1 returns the original matrix. If you need help with exponent rules outside of matrices, try our exponent calculator.

For Scalar mode, enter a scalar value. Type any number, fraction, or complex number. Every cell in the matrix will be multiplied by this value.

Click "Calculate" to get your answer. You can also press Enter from any cell or input field.

Switch between Decimal and Fraction format to view the result in the form you need. Our decimal to fraction calculator can help if you need to convert individual values. Click "Copy Result" to copy the answer to your clipboard.

Use the answer checker to test your own work. Click "Show Checker," type your answers into the grid, and click "Verify" to see which entries are correct.

Chain your results. In Matrix × Matrix mode, click "Use Result as Matrix A" or "Use Result as Matrix B" to carry your answer into a new calculation.

What Is Matrix Multiplication?

A matrix is a grid of numbers arranged in rows and columns. You can think of it like a table or a spreadsheet. Matrix multiplication is a way to combine two matrices into a new one by following a specific set of rules. For other matrix operations like addition, subtraction, and finding inverses, see our general matrix calculator.

To multiply two matrices, you take each row from the first matrix and each column from the second matrix. You multiply the matching numbers together, then add up all the results. That sum becomes one number in the answer matrix. You repeat this for every row-and-column pair until the entire result is filled in. This process of multiplying paired elements and summing them is known as the dot product.

When Can You Multiply Two Matrices?

You can only multiply two matrices when the number of columns in the first matrix equals the number of rows in the second matrix. For example, a 2×3 matrix (2 rows, 3 columns) can be multiplied by a 3×2 matrix (3 rows, 2 columns) because the 3s match. The result will be a 2×2 matrix. If those inner numbers do not match, the multiplication cannot be done.

Other Operations This Calculator Supports

Scalar multiplication is simpler. A scalar is just a single number. To multiply a scalar by a matrix, you multiply that number by every element inside the matrix. The result is a matrix of the same size.

Matrix exponentiation means multiplying a square matrix by itself a certain number of times. For example, A³ means A × A × A. The matrix must be square, meaning it has the same number of rows and columns. Any square matrix raised to the power of 0 gives the identity matrix, which acts like the number 1 in regular math. A related property of square matrices is the determinant, a single number that tells you whether a matrix is invertible.

Where Is Matrix Multiplication Used?

Matrix multiplication is used in many fields. Computer graphics use it to rotate, scale, and move images on screen. Scientists use it to solve systems of equations. It also shows up in physics, engineering, data science, and machine learning. Learning how to multiply matrices is a key skill in linear algebra, a branch of math that deals with vectors and matrices.


Formulas used

Matrix Multiplication Entry
C_{ij} = \sum_{k=1}^{p} A_{ik} \cdot B_{kj}
Scalar–Matrix Multiplication
R_{ij} = s \cdot A_{ij}
Matrix Power
A^n = \underbrace{A \times A \times \cdots \times A}_{n \text{ times}}, \quad A^0 = I
Complex Number Multiplication
(a+bi)(c+di) = (ac - bd) + (ad + bc)i
Complex Number Addition
(a+bi) + (c+di) = (a+c) + (b+d)i
Complex Magnitude (Visualization)
|z| = \sqrt{\operatorname{Re}(z)^2 + \operatorname{Im}(z)^2}

Frequently asked questions

What size matrices can I multiply with this calculator?

You can multiply matrices up to 10×10 in size. Set the number of rows and columns using the dimension inputs. The calculator works with any size from 1×1 up to 10×10.

Why does the calculator say my matrices are incompatible?

In Matrix × Matrix mode, the number of columns in Matrix A must equal the number of rows in Matrix B. For example, a 2×3 matrix can multiply a 3×4 matrix because both share the number 3. If those numbers don't match, the multiplication is not possible. Change your dimensions so the inner numbers are equal.

How do I enter fractions into the matrix cells?

Type fractions using a slash. For example, type 1/2 for one half or 3/4 for three fourths. The calculator will read the fraction and use its decimal value in the math.

How do I enter complex numbers?

Type complex numbers using the letter i for the imaginary part. For example, type 3+2i or -1-4i. The calculator handles complex arithmetic in all three operation modes.

What does raising a matrix to the power of 0 mean?

Any square matrix raised to the power of 0 equals the identity matrix. The identity matrix has 1s along the diagonal and 0s everywhere else. It works like the number 1 in regular multiplication — any matrix multiplied by it stays the same.

Why does Matrix Power mode require a square matrix?

Matrix exponentiation means multiplying a matrix by itself. You can only multiply a matrix by itself if the number of columns equals the number of rows. That is only true for square matrices, where the row count and column count are the same.

How do I copy the result to use somewhere else?

Click the "Copy Result" button below the final answer. The matrix values are copied to your clipboard in a tab-separated format. You can paste them directly into a spreadsheet or text document.

What does the heatmap show?

The heatmap is a visual display of the result matrix. Darker colors mean larger values, and lighter colors mean smaller values. If the result has complex numbers, the heatmap shows the magnitude (absolute value) of each entry instead.

How does the answer checker work?

Click "Show Checker" to open a blank grid the same size as the result. Type your own answers into the cells, then click "Verify." Each cell turns green if correct or red if wrong, so you can see exactly where your work differs.

Can I chain multiple multiplications together?

Yes. After you get a result in Matrix × Matrix mode, click "Use Result as Matrix A" or "Use Result as Matrix B." The result fills into that matrix so you can set up a new multiplication without retyping values.

What is the difference between Decimal and Fraction display?

Click Decimal to see results as numbers like 0.3333. Click Fraction to see them as fractions like 1/3. Both show the same values — just in different formats. Pick whichever is easier for your work.

What happens if I leave a cell blank?

Blank cells are treated as 0. If you want a cell to be zero, you can leave it empty or type 0.

Is there a keyboard shortcut to calculate?

Yes. Press Enter from any matrix cell or input field to run the calculation right away. You can also use arrow keys and Tab to move between cells quickly.

What is the size of the result matrix?

When you multiply an m×n matrix by an n×p matrix, the result is an m×p matrix. It has the same number of rows as the first matrix and the same number of columns as the second matrix.

Does matrix multiplication order matter?

Yes. Matrix multiplication is not commutative. That means A × B usually gives a different result than B × A. In some cases, B × A may not even be possible if the dimensions don't match the other way around.