guide

How to Multiply Matrices (2026)

By Rui Barreira · Last updated: 18 June 2026

Matrix multiplication is a core operation in linear algebra, used in graphics transformations, machine learning, physics simulations, and solving systems of equations. You can multiply matrices instantly using the brevio Matrix Calculator — free, no signup, runs entirely in your browser. Enter your matrices and get the result with step-by-step working in one click.

Unlike scalar multiplication, matrix multiplication is not simply element-by-element. It follows a strict row-by-column rule, and the order of the operands matters: A × B is generally not the same as B × A.

When Can You Multiply Two Matrices?

To multiply matrix A (size m × n) by matrix B (size n × p), the number of columns in A must equal the number of rows in B. The result is a new matrix of size m × p — it takes the outer dimensions. The inner dimensions must match.

Matrix A sizeMatrix B sizeResult sizeValid?
2 × 33 × 42 × 4Yes
3 × 23 × 2No (2 ≠ 3)
1 × 44 × 11 × 1 (scalar)Yes
4 × 44 × 44 × 4Yes

The Row-by-Column Rule — Worked Example

Each entry C[i][j] in the result is the dot product of row i from A and column j from B: multiply each pair of corresponding elements, then sum them all. For a 2 × 2 example with A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]:

  • C[1][1] = (1×5) + (2×7) = 5 + 14 = 19
  • C[1][2] = (1×6) + (2×8) = 6 + 16 = 22
  • C[2][1] = (3×5) + (4×7) = 15 + 28 = 43
  • C[2][2] = (3×6) + (4×8) = 18 + 32 = 50

The result is [[19, 22], [43, 50]]. This process scales to any compatible dimensions, but grows expensive quickly — multiplying two 100 × 100 matrices requires one million multiplications and nearly as many additions.

Key Properties

Not commutative. AB ≠ BA in general. Even when both products are defined (square matrices of the same size), the results differ. This is the most common source of errors when working with matrices by hand.

Associative. (AB)C = A(BC). You can regroup multiplications without changing the final result — useful when one grouping is cheaper to compute than another.

Identity matrix acts like 1. For any square matrix A, multiplying by the identity matrix I (1s on the diagonal, 0s elsewhere) gives AI = IA = A.

How to Use the Tool

  1. Open the brevio Matrix Calculator. No account required.
  2. Select the Multiply operation and set the dimensions of each matrix.
  3. Enter the values for matrix A and matrix B.
  4. Click Calculate. The result appears immediately with step-by-step working so you can follow each dot product.

The calculator also supports addition, subtraction, transposition, and determinant — useful when working through larger problems that require multiple operations.

Frequently Asked Questions

Is this tool free?
Yes — completely free, no signup required. All processing happens in your browser.
Does the tool work offline?
Once loaded, most features work without an internet connection since everything runs client-side.
More free toolsSee all 469
Merge PDFsCompress ImageJSON FormatterPassword GeneratorVAT CalculatorQR Code Generator
How to Multiply Matrices (2026) | brevio