Matrix multiplication calculator

Type matrix A and matrix B one row per line to get A × B. The number of columns in A must equal the number of rows in B.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter matrix a and matrix b.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

If A is m × n and B is n × p, then C = A × B is m × p, with each entry cij = Σ aik × bkj for k = 1 to n.

Example

Result: Product A × B: 58 64 139 154; Result size: 2 × 2.

1 2 3
4 5 6
 58   64
139  154

Limits and caveats

  • The limit is 10 rows and 10 columns per matrix.
  • Results are rounded to 12 significant digits to hide floating point noise.

Questions about this tool

When can two matrices be multiplied?

When the number of columns in the first equals the rows in the second. A 2 × 3 times a 3 × 2 gives a 2 × 2.

Is A × B equal to B × A?

Usually not. Matrix multiplication is not commutative, and the reverse product may not even exist.

How is each entry computed?

Multiply row i of A by column j of B entry by entry and add, for example 1×5 + 2×7 = 19.