A matrix is a rectangular arrangement of numbers, and it earns its place in mathematics because it turns messy systems of equations into objects that can be added, multiplied, and manipulated with a small set of rules. Computer graphics, engineering, statistics, and machine learning all run on matrices, but you do not need any of those applications to benefit from understanding them. The basic operations are accessible to anyone comfortable with ordinary arithmetic, provided they are introduced in the right order and with attention to the two things that confuse beginners: the sizes have to fit, and multiplication does not behave the way multiplication of ordinary numbers does.
The Matrix Calculator performs these operations for you, which is useful for checking homework and for handling large matrices that would be tedious by hand. But a calculator is most useful when you understand what it is doing, because then you can spot a wrong input, recognise an impossible operation, and interpret the result. This guide builds that understanding, operation by operation.
Addition, subtraction, and scalar multiplication
Addition is the friendliest matrix operation. Two matrices can be added only if they have exactly the same size, meaning the same number of rows and the same number of columns, and the result is found by adding corresponding entries. A 2 by 3 matrix plus another 2 by 3 matrix gives a 2 by 3 matrix, entry by entry. Subtraction works the same way. Scalar multiplication, multiplying a matrix by a single number, multiplies every entry by that number and works for any size. These operations behave much like ordinary arithmetic: addition is commutative, meaning the order does not matter, and the rules feel natural. The only trap is trying to add matrices of different sizes, which is not defined, and any tool that appears to do it is either padding the smaller matrix silently or is not a matrix tool at all. If your matrices do not match in size, stop and check your inputs before proceeding.
Multiplication: where the rules change
Matrix multiplication is the operation that surprises everyone, because it is not entry-by-entry, and it is not commutative. To multiply two matrices, the number of columns in the first must equal the number of rows in the second. A 2 by 3 matrix can multiply a 3 by 4 matrix, giving a 2 by 4 result, but a 3 by 4 matrix cannot multiply a 2 by 3 matrix, because the inner dimensions do not match. The result's size comes from the outer dimensions: rows of the first, columns of the second. Checking dimensions before multiplying is a habit that prevents most errors, and it takes seconds.
Each entry of the result is computed by taking a row from the first matrix and a column from the second, multiplying corresponding entries, and adding the products. This row-by-column rule is why multiplication is not commutative: multiplying A by B uses rows of A and columns of B, while multiplying B by A uses rows of B and columns of A, and those are different calculations that may not even both be possible. In general, AB does not equal BA, and assuming otherwise is the single most common conceptual error in matrix work. There is also an identity matrix, usually written I, which acts like the number 1: multiplying any matrix by the identity matrix of the right size leaves it unchanged. The identity matrix has ones on its main diagonal and zeros elsewhere, and it is worth recognising on sight.
A worked example
Consider two 2 by 2 matrices. Let A have rows (1, 2) and (3, 4), and let B have rows (5, 6) and (7, 8). To compute AB, take the first row of A, (1, 2), and the first column of B, (5, 7): multiply 1 by 5 and 2 by 7, giving 5 and 14, which add to 19. That is the top-left entry of the result. The top-right entry uses the first row of A and the second column of B, (6, 8): 1 times 6 plus 2 times 8 equals 6 plus 16, which is 22. The bottom-left entry uses the second row of A, (3, 4), and the first column of B: 3 times 5 plus 4 times 7 equals 15 plus 28, which is 43. The bottom-right entry uses the second row of A and the second column of B: 3 times 6 plus 4 times 8 equals 18 plus 32, which is 50. So AB is the matrix with rows (19, 22) and (43, 50).
Now compute BA for comparison. The top-left entry uses the first row of B, (5, 6), and the first column of A, (1, 3): 5 times 1 plus 6 times 3 equals 5 plus 18, which is 23, already different from AB's 19. The full result is rows (23, 34) and (31, 46). The two products differ in every entry, which demonstrates the point concretely: order matters in matrix multiplication, and any calculation that assumes otherwise is wrong.
The same matrices illustrate the determinant and the inverse. The determinant of a 2 by 2 matrix with rows (a, b) and (c, d) is ad minus bc. For A, that is 1 times 4 minus 2 times 3, which is 4 minus 6, giving negative 2. A non-zero determinant means the matrix has an inverse, a matrix that multiplies with the original to give the identity. For a 2 by 2 matrix, the inverse is found by swapping a and d, negating b and c, and dividing every entry by the determinant. For A, swapping gives rows (4, negative 2) and (negative 3, 1), and dividing by negative 2 gives rows (negative 2, 1) and (1.5, negative 0.5). Multiplying A by this inverse returns the identity matrix, which is the check that the inverse is correct. If the determinant is zero, the matrix is called singular and has no inverse, which in the context of equations means the system either has no unique solution or has infinitely many.
Determinants, inverses, and solving equations
The determinant generalises beyond 2 by 2 matrices, though the calculation grows more involved, and its meaning stays intuitive: it measures, loosely, how much the matrix stretches or squashes space, and whether that transformation can be undone. A zero determinant means the transformation squashes space flat, losing information, and therefore cannot be reversed. That is why singular matrices have no inverse.
Matrices solve systems of linear equations elegantly. A system such as "x plus 2y equals 5" and "3x plus 4y equals 11" can be written as a matrix equation, and the solution is found by multiplying by the inverse of the coefficient matrix. Using the matrix A from the example, whose inverse we computed, the solution to A times the vector (x, y) equals (5, 11) is found by multiplying the inverse by (5, 11): x equals negative 2 times 5 plus 1 times 11, which is 1, and y equals 1.5 times 5 plus negative 0.5 times 11, which is 2. Checking: 1 plus 2 times 2 equals 5, and 3 times 1 plus 4 times 2 equals 11. The method scales to larger systems where substitution becomes unwieldy, which is why matrices are the standard tool for systems of equations in engineering and data analysis.
Common mistakes
The first mistake is multiplying matrices whose dimensions do not fit, usually because the order was reversed. Always check inner dimensions first. The second mistake is assuming AB equals BA. It generally does not. The third mistake is dividing by a matrix, which is not an operation; instead, multiply by the inverse, and only when the inverse exists. The fourth mistake is arithmetic slips in the row-by-column products, which are easy to make and hard to spot. Work systematically, one entry at a time, and verify by checking that the result multiplied back gives a sensible answer, or by recomputing one entry by a different route. The fifth mistake is forgetting that a zero determinant means no inverse, and pressing on with a calculation that cannot succeed.
Closing
Check dimensions before every operation, remember that multiplication is row-by-column and order-dependent, and use the determinant to tell you whether an inverse exists before you try to find one. To handle the arithmetic of larger calculations, use the Scientific Calculator, and to organise data before it becomes a matrix, try the Percentage Calculator for proportions. For building data skills more broadly, read Spreadsheet Column Profiler Guide.