GintiCalcEvery calculation

MatrixMul

Matrix Multiplication Calculator

Enter two 2×2 matrices — see the product with dot-product steps for each element.

Multiplying 2x2 matrices

Each entry of the product is a row of the first matrix dotted with a column of the second.

Matrix AMatrix BA x B
[[1,2],[3,4]][[5,6],[7,8]][[19,22],[43,50]]
[[2,0],[0,2]][[1,1],[1,1]][[2,2],[2,2]]
[[1,0],[0,1]][[3,4],[5,6]][[3,4],[5,6]]

The top-left entry of the first product is 1 times 5 plus 2 times 7, which is 19 - not 1 times 5, which is what entry-wise multiplication would give. That distinction is the whole point: matrix multiplication composes transformations rather than combining numbers. Row three multiplies by the identity and returns the original unchanged. Multiplication is associative but not commutative, and the inner dimensions must agree: an m by n times an n by p gives an m by p.

How matrix multiplication works

Each element C[i][j] is the dot product of row i of A and column j of B: C[i][j] = Σ A[i][k] × B[k][j]. For 2×2 matrices, each element involves 2 multiplications and 1 addition. Crucially, AB ≠ BA in general — matrix multiplication is not commutative.

Applications of matrix multiplication

Matrix multiplication encodes linear transformations. In graphics, multiplying transformation matrices chains rotations, scales, and translations. In machine learning, neural network layers are matrix multiplications. In economics, input-output models use matrix products to track inter-industry flows.

Frequently asked questions

I need to rotate a point 30°, then scale by 2× — how do I combine these transformations?

Create the rotation matrix R and scaling matrix S separately, then multiply S × R (applied right to left). The resulting single 2×2 matrix does both in one step. This is exactly how game engines and graphics pipelines chain transformations — one matrix multiply replaces two separate operations.

Why does the order of matrix multiplication matter?

Because AB ≠ BA in general. Rotating then scaling gives a different result than scaling then rotating (try it with a rectangle). The last transformation applied is the leftmost matrix. This non-commutativity is one of the key differences between matrix and ordinary number multiplication.

How is matrix multiplication different from element-wise multiplication?

Standard multiplication uses dot products of rows and columns — C[i][j] = sum of A's row i × B's column j. Element-wise (Hadamard) multiplication just multiplies matching positions: C[i][j] = A[i][j] × B[i][j]. Standard multiplication composes transformations; Hadamard multiplication is used for masking and filtering. The matrix addition calculator does the element-wise approach for addition.

Last updated: September 6, 2026