Skip to content
The Calculatorz
Algebra

Matrix Multiplication Calculator

Multiply two matrices of any compatible size up to 10×10, with the product, the working for the first entry and a check of whether the order matters.

Results are rounded for display. Check important answers, especially in assessed or technical work.

Matrices A and B

Values

What is matrix multiplication?

Matrix multiplication combines two matrices by taking the dot product of each row of the first with each column of the second. It represents doing one linear transformation after another, which is why the inner sizes must match and the order matters.

How to use this calculator

Type each matrix row by row, separating entries with spaces or commas and rows with a semicolon or a new line. The number of columns in A must equal the number of rows in B. The calculator shows A × B, how the first entry was worked out, and for square matrices compares B × A.

Formula

If A is m×n and B is n×p, then A × B is m×p with entries (AB)ᵢⱼ = Σₖ Aᵢₖ × Bₖⱼ: multiply row i of A by column j of B, element by element, and add.

Terms in the formula

m×n
A matrix with m rows and n columns.
(AB)ᵢⱼ
Entry in row i, column j of the product.
Σₖ
Sum over the shared dimension k.

Understanding your result

Each entry of the product is a row-by-column sum, shown for the first entry so you can check the method. The product's size comes from the outer dimensions: rows of A by columns of B. For square matrices, comparing AB with BA shows whether the matrices commute, which is uncommon.

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewIfrahMSc Mathematics

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

How do you multiply two matrices?

Multiply each row of the first matrix by each column of the second: multiply matching entries and add them. The result goes in that row and column of the product.

When can two matrices be multiplied?

Only when the number of columns in the first equals the number of rows in the second. A 2×3 matrix can multiply a 3×4 matrix, giving a 2×4 result.

Is matrix multiplication commutative?

No. In general AB ≠ BA, and BA may not even be defined. The calculator compares both orders for square matrices.

What is the identity matrix?

A square matrix with 1s on the main diagonal and 0s elsewhere. Multiplying by it leaves a matrix unchanged: AI = IA = A.

Can I multiply a matrix by a vector?

Yes. Enter the vector as a matrix with one column, such as 1; 2; 3. The result is a column vector.

Where is matrix multiplication used?

In computer graphics transformations, systems of equations, Markov chains, neural networks and combining linear maps.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. Weisstein, E. W. (n.d.). Matrix multiplication. MathWorld—A Wolfram Web Resource. View source
  2. Strang, G. (2010). 18.06 Linear algebra (Spring 2010) [Course materials]. Massachusetts Institute of Technology: MIT OpenCourseWare. View source
  3. Strang, G. (2023). Introduction to linear algebra (6th ed.). Wellesley-Cambridge Press. View source
  4. Hefferon, J. (2020). Linear algebra (4th ed.). Orthogonal Publishing. View source