The shared dimension is the multiplication checkpoint
Describe matrix A as m × n: m rows and n columns. Describe matrix B as n × p: n rows and p columns. The two occurrences of n are the inner dimensions. They must match because a row of A and a column of B need the same number of entries before their dot product can be formed. A 2 × 3 matrix can multiply a 3 × 2 matrix, but it cannot multiply a 4 × 2 matrix on its right.
This calculator asks for rows in A, the shared number of columns in A and rows in B, and columns in B. That shared field makes compatibility explicit instead of asking for four unrelated dimensions and rejecting a mismatch later. Once the dimensions are 2, 3, and 2, matrix A needs exactly six values, matrix B needs exactly six values, and the product will have two rows and two columns.
The multiplication editor draws one input for every matrix position and labels it by row and column. For a 2 × 3 matrix, A(1,1), A(1,2), and A(1,3) form the first row; A(2,1), A(2,2), and A(2,3) form the second. Enter one finite number in each visible cell. For the additional operations, choose each matrix's rows and columns explicitly, then paste the same values with line breaks or semicolons between rows and spaces or commas between entries. The importer checks that the pasted shape matches the selected dimensions before calculating.
An original 2 × 3 by 3 × 2 example, worked cell by cell
Take A = [[2, −1, 4], [0, 3, 5]] and B = [[1, 6], [2, −2], [3, 1]]. The values include negative entries and a zero so each sign can be followed without changing the multiplication rule.
- Confirm the shape
A has shape 2 × 3 and B has shape 3 × 2. The inner 3s match, so AB exists. Keep the outer dimensions: the result C has shape 2 × 2 and therefore needs four dot products.
- Fill the first result row
Pair row 1 of A with each column of B. C(1,1) = 2×1 + (−1)×2 + 4×3 = 12. C(1,2) = 2×6 + (−1)×(−2) + 4×1 = 18.
- Fill the second result row
Pair row 2 of A with the same two columns. C(2,1) = 0×1 + 3×2 + 5×3 = 21. C(2,2) = 0×6 + 3×(−2) + 5×1 = −1. Thus AB = [[12, 18], [21, −1]].
The outer dimensions label every destination cell
The product keeps the number of rows from A because each row of A creates one row of answers. It keeps the number of columns from B because each column of B creates one column of answers. The shared dimension disappears from the result shape, but it controls the length of every dot product. In the example, each of four result cells adds three scalar products, so the calculator reports 2 × 3 × 2 = 12 scalar multiplications.
Cell notation makes a long calculation auditable. C(i,j) always uses row i of A and column j of B. It never uses row j of B, and it never moves an answer into a position chosen by its numerical size. The result table and row-by-column work table preserve this indexing so a suspicious value can be traced back to one input row and one input column.
When checking one destination cell by hand, write the scalar products first and use the statistics calculator to audit their signed list total and item count. That check verifies one dot product only; it does not replace confirming all matrix positions and dimensions.
AB and BA are different ordered questions
Ordinary numbers commute under multiplication, but matrices generally do not. Reversing the factors changes which rows meet which columns and may also change whether a product is defined.
The dimensions may block the reverse order
If A is 2 × 3 and B is 3 × 4, AB is valid and has shape 2 × 4. BA would require the 4 columns of B to equal the 2 rows of A, so BA is not defined. A successful AB calculation says nothing about the existence of BA.
Both orders can exist and still disagree
For the 2 × 3 and 3 × 2 matrices in the worked example, AB is 2 × 2 while BA would be 3 × 3. The two products cannot be equal because they do not even have the same shape. With square matrices the shapes may match, yet the entries can still differ.
Order carries meaning
When matrices represent transformations, transitions, or grouped totals, the right-hand factor acts first in the usual column-vector convention. Swapping the factors changes the sequence of operations, not merely the typography of the expression.
Identity and transpose provide structural checks
Identity matrices preserve a compatible factor
The n × n identity matrix Iₙ has ones on its main diagonal and zeros elsewhere. If A is m × n, then AIₙ = A; the matching left identity is IₘA = A. You can verify this by entering an identity matrix as one factor, but this focused page does not provide a separate identity preset or identity operation.
A transpose swaps rows with columns
Transposing an m × n matrix produces an n × m matrix. For a compatible product, (AB)ᵀ = BᵀAᵀ: the transposed factors appear in reverse order. The additional operation workspace can generate Aᵀ directly, while the detailed multiplication workspace remains the place to inspect every cell of AB.
Match every additional operation to its dimension gate
A valid matrix entry is not enough by itself. Select the intended operation, set the rows and columns for every matrix, and confirm the shape requirement before interpreting the arithmetic.
Addition and subtraction pair corresponding entries
A+B and A−B require identical row and column counts because A(i,j) is combined only with B(i,j). A 2 × 3 matrix and a 3 × 2 matrix both contain six entries, but their positions do not match, so entrywise addition and subtraction are undefined.
Scaling and transpose accept rectangular matrices
Scalar multiplication applies kA(i,j)=k×A(i,j) without changing the shape. Transpose instead moves A(i,j) to Aᵀ(j,i), so a 2 × 3 input becomes a 3 × 2 result. Both modes show concrete entry movements or products rather than only naming the rule.
Square, determinant, inverse, and trace require square A
A² means A×A, determinant reduces a square matrix to one signed scalar, trace adds the main diagonal, and inversion row-reduces [A|I]. Equal row and column counts establish shape eligibility, but an inverse also requires a nonsingular matrix; a zero or numerically negligible pivot can block A⁻¹.
RREF preserves shape while exposing pivots
Reduced row echelon form accepts rectangular A and uses row swaps, row scaling, and row replacement. The output keeps the original row and column counts while its pivot columns and zero rows reveal relationships that the unreduced entries may hide.
Audit a two-by-two inverse through its row operations
For A=[[2,1],[5,3]], the determinant is 2×3−1×5=1, so the square matrix is nonsingular and an inverse exists in this numeric model.
- Form the augmented matrix
Write [A|I] as [[2,1|1,0],[5,3|0,1]]. The identity columns record the same elementary row operations applied while the left side is reduced.
- Create and clear the pivots
Scale the first row to make its leading entry 1, eliminate the first entry of row 2, scale the second pivot to 1, and eliminate the remaining value above it. The visible row-operation list keeps each coefficient and intermediate action available for checking.
- Read and verify the inverse
When the left side becomes I, the right side is A⁻¹=[[3,−1],[−5,2]]. Multiplying A by that result returns I. If a required pivot cannot be formed, the calculator reports that the matrix is singular instead of presenting an inverse.
Keep the combined matrix calculator within its declared boundary
Ten common operations now share one canonical page, but the workbenches remain narrower than a general symbolic or numerical linear-algebra system. Match the operation and result to the question instead of reading an unavailable conclusion into the displayed arithmetic.
- Dimensions are limited to 1 through 10. Every multiplication-grid cell must contain one valid entry, and every batch-entered matrix must match its selected row and column count. Empty, non-finite, malformed, or out-of-range values return an error rather than being ignored.
- The calculator accepts finite real-number entries. It does not evaluate variables, symbolic expressions, or fraction strings, and decimal entries follow finite-precision numeric arithmetic with display-only rounding.
- The page supports A+B, A−B, A×B, kA, transpose, A², determinant, inverse, RREF, and trace. It reports the applicable entry calculations, row-by-column products, diagonal sum, pivots, or row operations; it does not silently treat one operation's result as evidence for another.
- A product matrix does not solve unknown variables by itself. When the actual task is to solve simultaneous equations from entered coefficients and constants, use the system of equations calculator rather than treating multiplication as an equation solver.
- Eigenvalues, eigenvectors, characteristic polynomials, decompositions, sparse storage, conditioning analysis, and arbitrary-size computation remain outside scope. Use the algebra calculator to route a different algebra task, but do not infer those omitted properties from AB, det(A), A⁻¹, or RREF alone.