A product of matrices calculator multiplies two or more matrices when their dimensions are compatible. Enter each matrix’s entries and the calculator returns the product matrix; this page also shows the multiplication rule and a worked example.
Formula
This calculator multiplies two 1 × 2 row matrices, or equivalently a 1 × 2 matrix by a 2 × 1 matrix, to produce one number. The rule is [a b][c; d] = ac + bd. Here, a and b are the entries in the first row matrix, and c and d are the entries in the second, column-shaped matrix. All four inputs are dimensionless numbers; if they represent measured quantities, the result has the product of their units.
This small calculator demonstrates the product rule rather than accepting arbitrary matrix sizes. For general matrices, if matrix A has r rows and s columns and matrix B has s rows and t columns, their product AB exists and has r rows and t columns. Each output entry is a dot product of one row of A with one column of B:
(AB)ij = Σk=1s AikBkj.
The shared dimension s must match. In the example here, the first matrix has 1 column and the second has 1 row, so the two inner dimensions match. The product is a 1 × 1 matrix, which is usually written as a single scalar.
Worked Example
Using the calculator’s default inputs, A = [1 2] and B = [3; 4]. Multiply corresponding entries across the row and down the column, then add:
AB = (1 × 3) + (2 × 4)
AB = 3 + 8 = 11
The result is 11, matching the calculator output. If the inputs carry units, multiply each pair of units before adding; the terms must have compatible units for their sum to be meaningful.
Assumptions
- The first input matrix is a 1 × 2 row matrix, and the second is a 2 × 1 column matrix.
- Entries are ordinary real numbers, and arithmetic is exact apart from any rounding applied when displaying results.
- The two products being added represent compatible quantities and therefore have matching units, if units apply.
How Matrix Multiplication Works
Matrix multiplication is not entry-by-entry multiplication. To find each entry in a product, take a row from the left-hand matrix and a column from the right-hand matrix, multiply their corresponding entries, and add those products. The calculator uses the simplest nontrivial version of that operation: one row paired with one column.
For a larger example, let A be a 2 × 2 matrix and B another 2 × 2 matrix:
A = [1 2; 3 4], B = [5 6; 7 8].
The upper-left result is (1 × 5) + (2 × 7) = 19. The upper-right is (1 × 6) + (2 × 8) = 22. Repeating the row-by-column calculation gives:
AB = [19 22; 43 50].
Notice that the output dimensions come from the outside dimensions: a 2 × 2 matrix multiplied by a 2 × 2 matrix produces a 2 × 2 matrix. A 3 × 2 matrix multiplied by a 2 × 4 matrix produces a 3 × 4 matrix.
When a Product Exists
Check dimensions before entering or calculating a matrix product. The number of columns in the left matrix must equal the number of rows in the right matrix. The remaining dimensions determine the output’s shape:
- 2 × 3 multiplied by 3 × 1 is defined and produces a 2 × 1 matrix.
- 3 × 2 multiplied by 3 × 1 is not defined: the inner dimensions, 2 and 3, differ.
- 2 × 3 multiplied by 3 × 4 is defined and produces a 2 × 4 matrix.
Order matters. Even when both AB and BA can be calculated, they generally have different entries and may even have different dimensions. For example, a 2 × 3 matrix times a 3 × 2 matrix gives a 2 × 2 result, while reversing the order gives a 3 × 3 result. Matrix multiplication is therefore not generally commutative: AB ≠ BA.
Common Mistakes and Checks
- Multiplying matching positions: That is the element-wise product, a different operation. Standard matrix multiplication uses rows from the left matrix and columns from the right.
- Reversing the order: AB and BA are not interchangeable. Keep the order specified by the problem or model.
- Ignoring dimensions: Matching inner dimensions are essential. If they differ, the product is undefined; rearranging entries does not fix the mismatch.
- Adding incompatible units: Every term contributing to a single result entry must have compatible units. Check units as well as numerical values.
- Rounding too early: Keep full precision during intermediate calculations, then round the final entries to the precision your task requires.
A useful check is to compute one output entry independently using its row and column. For bigger products, verify the output’s expected number of rows and columns and inspect whether a simple test case behaves as expected. A numerical product may be correct even when it is not the product intended by a model, so confirm the row/column convention and order used in the source material.
What Matrix Products Are Used For
Matrix multiplication combines linear transformations. A matrix can represent a transformation such as a rotation, scaling, or projection; multiplying transformation matrices combines those operations. The order reflects the order of application, which is one reason reversing factors can change the result.
Products also appear in systems of linear equations, coordinate changes, statistics, computer graphics, and numerical methods. In a model written as y = Ax, each output in y is a weighted sum of input values. The row-by-column rule calculates those sums. A product’s meaning depends on how the matrices are defined, not just on the arithmetic.
Frequently Asked Questions
How do you multiply two matrices?
For each output position, multiply entries from the corresponding row of the left matrix by entries from the corresponding column of the right matrix, then add the products.
When can you multiply matrices?
The left matrix’s number of columns must equal the right matrix’s number of rows. If those inner dimensions match, the product has the left matrix’s row count and the right matrix’s column count.
Is matrix multiplication commutative?
No, not in general. AB may differ from BA, and one product may be defined while the other is not.
Is matrix multiplication the same as multiplying entries?
No. Entry-by-entry multiplication pairs entries in the same positions. Standard matrix multiplication uses row-by-column dot products; the two operations have different definitions and uses.
Can I use this calculator for large matrices?
This page’s calculator is limited to a 1 × 2 by 2 × 1 product. For larger matrices, use a tool that accepts the required dimensions and check that its output shape and multiplication order match your problem.
Related
Formula used
in a | Entry a | - | 1 | - in b | Entry b | - | 2 | - in c | Entry c | - | 3 | - in d | Entry d | - | 4 | - out p | Product of matrices (a b)(c d) | - | a * c + b * d | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- Calculator in Hindi: Meaning, Usage and Examples0.2000 mol/L
- Volume Strength Formula in Terms of Molarity11.20 volumes
- H2O2 Volume Strength to Molarity Calculator0.893 mol/L
- Volume Strength to Molarity: Formula and Calculator0.0409 mol/L
- Molar Volume: Definition, Formula, and Calculator22.414 L/mol
- Molar Volume of a Gas Calculator and Formula22.4140 L/mol