Britannica Sources used in this answer

Why is matrix multiplication usually not commutative?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In modern algebra, matrix multiplication is generally not commutative because the operation is defined by the specific arrangement of elements in rows and columns, which does not satisfy the commutative law (AB=BA) that applies to ordinary numbers.12

The product of two matrices A and B is calculated by taking the dot product of the rows of the first matrix with the columns of the second. Because this process depends on the specific order of the matrices—where the number of columns in the first must match the number of rows in the second—reversing the order of multiplication changes the resulting elements or may even make the operation undefined. While matrix multiplication is associative and distributive, it lacks the commutativity found in standard arithmetic, except in specific cases such as diagonal matrices.1