Matrix Multiplication Calculator

Multiply rectangular matrices in either order using exact fractions and a calculation of every result element.

Matrix product
—
Result dimensions
—
Calculation of every element
—

Each input may have 1–6 rows and columns. The first matrix’s column count must equal the second matrix’s row count. Separate rows with newlines or semicolons and entries with spaces or commas. Use decimal points or fractions such as 1/3. Changing A×B to B×A may change the dimensions or make multiplication impossible. Decimal results round to 8 places.

Method and limits

Multiply rectangular matrices in either order using exact fractions and a calculation of every result element.

Each input may have 1–6 rows and columns. The first matrix’s column count must equal the second matrix’s row count. Separate rows with newlines or semicolons and entries with spaces or commas. Use decimal points or fractions such as 1/3. Changing A×B to B×A may change the dimensions or make multiplication impossible. Decimal results round to 8 places.

Frequently asked questions

What inputs and limits apply?

Each input may have 1–6 rows and columns. The first matrix’s column count must equal the second matrix’s row count. Separate rows with newlines or semicolons and entries with spaces or commas. Use decimal points or fractions such as 1/3. Changing A×B to B×A may change the dimensions or make multiplication impossible. Decimal results round to 8 places.

How we verified this calculator

The calculator is checked against 6 reference cases computed independently of its code. Last passed: .

# Inputs Expected result
1
Operation = A × B
Display = Exact fractions
A = 1 2 3
B = 4 5 6
Matrix product: 32
Result dimensions: 1 × 1
2
Operation = B × A
Display = Exact fractions
A = 1 2 3
B = 4 5 6
Matrix product: 4 8 12 5 10 15 6 12 18
Result dimensions: 3 × 3
3
Operation = A × B
Display = Exact fractions
A = 1/3 1/2
B = 3/2 2/3
Matrix product: 5/6
Result dimensions: 1 × 1
4
Operation = B × A
Display = Exact fractions
A = 1/3 1/2
B = 3/2 2/3
Matrix product: 1/2 3/4 2/9 1/3
Result dimensions: 2 × 2
5
Operation = A × B
Display = Exact fractions
A = 1 2 3 4
B = 0 1 1 0
Matrix product: 2 1 4 3
Result dimensions: 2 × 2
6
Operation = B × A
Display = Exact fractions
A = 1 2 3 4
B = 0 1 1 0
Matrix product: 3 4 1 2
Result dimensions: 2 × 2

How we test our calculators →

Also try:

Back to category →