Enter Matrix Values to Get Started
Choose an operation tab, enter values in Matrix A (and B if needed), then click Calculate to see the result with step-by-step solutions.
How to Use the Matrix Calculator
Select an Operation Category
Click one of the four tabs at the top — Two Matrix (for A+B, A-B, A×B, c×A), Single Matrix (for transpose, determinant, inverse, power, trace), Analysis (for rank, RREF, eigenvalues, LU), or Solve Ax=b. The input panel will show only the controls you need.
Set Matrix Dimensions and Enter Values
Use the Rows and Cols dropdowns next to each matrix label to set dimensions (1×1 to 5×5). Click each cell and type a value — decimals and fractions like 1/3 or -2.5 are accepted. Use the Random button to auto-fill with test integers, or load a Quick Preset like Rotation 2×2 or Magic Square 3×3.
Choose the Specific Operation and Click Calculate
Click the operation button that appears below the matrix grids — for example, A + B, Determinant, or RREF. The result appears instantly on the right. The 'What does this mean?' panel below the result gives a plain-English explanation of the mathematical meaning of the output.
Review Steps, Export, or Chain Operations
If step-by-step row operations are available (RREF, linear system), click the Steps accordion to see each pivot and elimination move. Use 'Export CSV' to download the result matrix, 'Copy LaTeX' for academic documents, or 'Copy result → Matrix A' to feed the result into a new calculation.
Frequently Asked Questions
Why can't I multiply two matrices with mismatched dimensions?
Matrix multiplication A×B is defined only when the number of columns in A equals the number of rows in B. This is because the operation computes each result entry as a dot product of a row of A with a column of B — which requires the row and column to have the same length. If A is an m×p matrix and B is a p×n matrix, the result C is m×n. If aCols ≠ bRows, the dot product is undefined and the operation cannot proceed. This contrasts with addition, where both matrices must have identical dimensions (both m×n) so entries can be paired up element-by-element.
What does it mean when the determinant is 0?
A zero determinant means the matrix is singular — it does not have an inverse. Geometrically, the linear transformation squashes space: a 2D transformation with det=0 collapses the plane onto a line or a point, destroying information. Algebraically, if det(A)=0, the rows of A are linearly dependent (some row is a linear combination of the others), and the system Ax=b either has no solution or infinitely many solutions — never a unique one. The rank will be less than n. This is why the calculator shows an error ('singular matrix') when you try to invert a matrix with a zero determinant.
What is the difference between rank, RREF, and determinant?
These three outputs describe different aspects of the same matrix. The rank is a single integer — the number of linearly independent rows (or columns), found by counting the non-zero rows in RREF. RREF (Reduced Row Echelon Form) is the full reduced matrix itself, showing exactly which variables are basic (determined by pivots) and which are free (can be set arbitrarily). The determinant is a single scalar defined only for square matrices; it equals zero precisely when rank < n. Rank applies to any matrix shape; RREF applies to any matrix; determinant requires a square matrix. Together they characterize the solution space of Ax=0 and Ax=b completely.
How are eigenvalues computed for matrices larger than 2×2?
For 2×2 matrices, eigenvalues are computed in closed form using the quadratic formula on the characteristic polynomial λ² − tr(A)λ + det(A) = 0. For 3×3 to 5×5 matrices, this calculator uses the QR iteration algorithm, which is the standard numerical method used in professional linear algebra software. QR iteration repeatedly factors the matrix as Q×R (orthogonal times upper triangular) and replaces it with R×Q, converging toward an upper triangular form whose diagonal entries are the eigenvalues. The process runs up to 500 iterations with convergence tolerance 1e-8. Complex eigenvalues (from matrices with real entries that have complex conjugate eigenvalue pairs) appear for 2×2 matrices in the form a + bi and a − bi.
What is LU decomposition used for?
LU decomposition factors matrix A into the product of a lower-triangular matrix L (with 1s on the diagonal) and an upper-triangular matrix U. The main practical use is efficient repeated solving of Ax=b: once A = LU, solving for any right-hand side b requires two triangular substitution steps — forward substitution through Ly=b then backward substitution through Ux=y — each of which takes only O(n²) operations. This is far faster than recomputing the full decomposition each time. The determinant of A equals the product of the diagonal entries of U (times the sign from any row swaps during partial pivoting). LU decomposition is the algorithm underlying most scientific computing libraries for linear system solving.
What are the preset example matrices and why are they useful?
The calculator includes four presets for quick experimentation. The Rotation 2×2 matrix [[0,-1],[1,0]] rotates vectors 90 degrees counterclockwise — useful for learning how matrix multiplication implements rotations. The Magic Square 3×3 has rows, columns, and diagonals all summing to 15, and has a determinant of -360 and rank 3. The Identity 3×3 is the neutral element of matrix multiplication: A×I = I×A = A for any compatible A. The Fibonacci 2×2 matrix [[1,1],[1,0]] raised to the power n gives the nth Fibonacci number in position [0][0] — a beautiful demonstration of matrix powers. Load any preset, then modify values to explore how the results change.