Matrix Calculator
Paste matrices as rows of numbers, one row per line. The calculator checks the dimensions agree before it computes, because a dimension mismatch is the mistake that produces most wrong matrix answers.
Matrices
One row per line, values separated by spaces or commas.
Dimensions decide what is possible
Addition and subtraction need identical dimensions — every entry pairs with exactly one other. Multiplication needs the inner dimensions to match: an m×n times an n×p gives an m×p. If the columns of A do not equal the rows of B, the product simply does not exist, and the calculator says so rather than returning something plausible-looking.
Matrix multiplication is not commutative
AB and BA are usually different matrices, and often only one of them is even defined. This is not a quirk — it is the whole point. Matrices represent transformations, and rotating then stretching is genuinely not the same as stretching then rotating. Treating matrix products like numbers is the most common source of wrong answers in linear algebra.
What the determinant tells you
The determinant is the factor by which the transformation scales area (in 2D) or volume (in 3D). A determinant of 2 doubles area; a determinant of −1 preserves area but flips orientation. A determinant of zero means the transformation collapses space into a lower dimension — information is destroyed, the mapping cannot be undone, and the matrix has no inverse. That single number answers the invertibility question outright.
Inverse, rank and singular matrices
The inverse undoes the transformation: AA⁻¹ = I. It exists only when the determinant is non-zero. The rank counts how many dimensions survive the transformation — a 3×3 matrix of rank 2 flattens 3D space onto a plane. Rank below the full size and determinant zero are the same condition stated two ways, and both mean the system of equations the matrix represents has either no solution or infinitely many.
This calculator uses Gaussian elimination with partial pivoting, which is numerically stable and is what production linear algebra libraries do. Near-singular matrices are flagged, because a determinant of 1×10⁻¹⁵ is zero for every practical purpose even though floating point reports it as non-zero.
Frequently Asked Questions
Why can I not multiply my two matrices?
What does a determinant of zero mean?
Is AB the same as BA?
How large a matrix can this handle?
Sources
Official publications only. Links open the original document in a new tab.
- National Institute of Standards and Technology Special Publication 811 — Guide for the use of the SI Significant figures and rounding conventions
- National Institute of Standards and Technology CODATA fundamental physical constants Values of the fundamental physical constants