Matrix Calculator
Calculate matrix operations: addition, subtraction, multiplication, determinant, inverse, and transpose. Supports 2×2 to 4×4 matrices.
About the Matrix Calculator
A matrix calculator performs operations on matrices — rectangular arrays of numbers that are fundamental to linear algebra, computer graphics, machine learning, quantum mechanics, and systems of equations. Our matrix calculator supports addition, subtraction, and multiplication of matrices of any compatible dimensions; transposition (flipping rows and columns); determinant calculation for square matrices; inverse matrix computation using the adjugate method or Gaussian elimination; and row reduction to row echelon form (REF) or reduced row echelon form (RREF) for solving linear systems. Matrix operations underlie an extraordinary range of modern applications: 3D graphics transforms, neural network weights, principal component analysis (PCA) in data science, Google's PageRank algorithm, structural analysis in civil engineering, Markov chain probability transitions, and the Schrödinger equation in quantum physics all rely fundamentally on matrix arithmetic.
Formula
(AB)[i][j] = sum(A[i][k] x B[k][j]) | det(2x2) = ad-bc | A^-1 = (1/det) x adj(A) | Invertible iff det ≠ 0
How It Works
Matrix addition (A + B): add corresponding elements. Requires same dimensions. Matrix multiplication (A x B): the element at row i, column j of the result equals the dot product of row i of A with column j of B. Requires A's columns = B's rows. For 2x2: [[a,b],[c,d]] x [[e,f],[g,h]] = [[ae+bg, af+bh],[ce+dg, cf+dh]]. Determinant (2x2): det = ad - bc. Determinant (3x3): use cofactor expansion or the rule of Sarrus. Inverse (2x2): A^-1 = (1/det) x [[d,-b],[-c,a]]. A matrix is invertible only when det(A) ≠ 0. Identity matrix I: A x I = I x A = A. The identity matrix is the matrix equivalent of the number 1.
Tips & Best Practices
- ✓Matrix multiplication is NOT commutative: A x B ≠ B x A in general. Order always matters in matrix products.
- ✓The identity matrix I (1s on diagonal, 0s elsewhere) acts like the number 1 in multiplication: any matrix multiplied by its appropriately sized identity matrix is unchanged.
- ✓Singular matrix (det = 0): has no inverse and represents a system of equations with either no solution or infinitely many solutions.
- ✓Gaussian elimination for solving Ax = b: augment the matrix with the b vector, then apply row operations to reach row echelon form, then back-substitute to find x.
- ✓Eigenvalues satisfy det(A - lambda x I) = 0. Eigenvalues describe how a matrix transformation scales space along its eigenvector directions — fundamental to understanding principal components and stability analysis.
- ✓Sparse matrices (mostly zeros): store only non-zero elements for computational efficiency. Most real-world matrices in machine learning and network analysis are sparse.
- ✓Matrix rank: the number of linearly independent rows (or columns). Full rank means the matrix is invertible. Rank deficiency means some dimensions are redundant.
- ✓Google PageRank: ranks web pages by computing the dominant eigenvector of the web's link matrix — a real-world matrix with billions of rows and columns solved using iterative methods.
Who Uses This Calculator
Linear algebra students solving systems of equations and verifying matrix operations. Computer graphics developers applying rotation, scaling, and translation transformations using homogeneous coordinate matrices. Data scientists performing dimensionality reduction via PCA. Machine learning engineers understanding weight matrices in neural networks. Engineers solving structural analysis problems with stiffness matrices. Economists modelling input-output economic systems.
Optimised for: USA · Canada · UK · Australia · Calculations run in your browser · No data stored
Frequently Asked Questions
How do you multiply matrices?
Matrix multiplication: row of first matrix × column of second. C[i][j] = sum of A[i][k] × B[k][j] for all k.