Matrix Calculator - RREF, Powers, Inverse, Determinant & More
Math Calculators
Perform matrix arithmetic, determinants, inverses, rank, trace, RREF, and integer powers from −20 to 20 on matrices up to 10×10.
A (3×3)
B (3×3)
Result
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 | 0 |
How to use this tool
- Set matrix dimensions. Choose the number of rows and columns for Matrix A (and Matrix B for binary operations). Dimensions can be 1–10; RREF accepts rectangular A, while determinant, inverse, trace, and powers require square A.
- Enter matrix values. Click into each cell and type a complete finite numeric value. Blank or malformed cells are validation errors; enter 0 explicitly when zero is intended. Use Tab to move between cells.
- Select an operation. Choose an operation from the panel, including arithmetic, determinant, inverse, rank, trace, RREF(A), or Aⁿ. For a power, enter an integer exponent from −20 to 20; negative powers require an invertible matrix.
- Review the result. The result matrix or scalar value updates below. Expand the steps for determinant, inverse, or the numbered RREF row operations. Copy results as plain text or LaTeX, or send a matrix result back to Matrix A with Result → A.
Matrix operations reference
Matrices are rectangular arrays of numbers that represent linear transformations. The calculator supports addition and subtraction (element-wise, with matching dimensions), matrix multiplication (inner dimensions must match), transpose (flip rows and columns), scalar multiplication, and the matrix properties determinant, inverse, rank, and trace. It also computes reduced row-echelon form (RREF) for rectangular matrices and integer powers for square matrices. All calculations run in your browser, and input grids are limited to 1–10 rows and columns.
Reduced row-echelon form (RREF)
RREF applies elementary row operations until every pivot is 1 and is the only nonzero value in
its column; each lower pivot also appears to the right of the pivot above it. This form makes
relationships among columns and rows easier to inspect, including in rectangular matrices. For
example, reducing [[1, 2], [2, 4]] gives [[1, 2], [0, 0]], which
shows that the second row was twice the first and does not add another independent row. The
calculator selects pivots relative to their row scales and reports numbered swaps, scaling,
and elimination steps. Like other floating-point tools, results near the tolerance boundary
can depend on rounding when the input is ill-conditioned.
Integer matrix powers
Choose Aⁿ to multiply a square matrix by itself using an integer exponent from −20 to 20. The zeroth power is the identity matrix, so A⁰ = I. Positive powers repeat multiplication; for example, if A = [[1, 1], [0, 1]], then A² = [[1, 2], [0, 1]]. A negative power uses the inverse first, so A⁻¹ is available only when A is nonsingular. Fractional exponents are not supported, and the calculator reports an error if a result overflows to a non-finite number. The exponent cap keeps calculations predictable while covering common classroom examples.
Determinant and cofactor expansion
The determinant of a square matrix is a scalar value that encodes how the linear transformation scales areas (2D) or volumes (3D). For matrices up to 4×4, this calculator uses cofactor expansion (Laplace expansion) along the first row and shows each step. For larger matrices, it uses LU decomposition with partial pivoting.
Matrix inverse via Gauss-Jordan elimination
A square matrix A is invertible if and only if det(A) ≠ 0. The inverse A⁻¹ satisfies A × A⁻¹ =
I. This calculator finds A⁻¹ using Gauss-Jordan elimination: it augments A with the identity
matrix and applies row operations until the left side becomes the identity, at which point the
right side is the inverse. Every row operation is shown as a step. To make the numerical test
scale-aware, it selects pivots relative to row size and compares a candidate pivot against a
tolerance based on the matrix infinity norm and floating-point precision. Thus scaling every
entry of a well-conditioned invertible matrix up or down does not, by itself, make it
singular. Blank or malformed cells are errors rather than implicit zeroes; enter 0 explicitly when that is the intended value.
Matrix multiplication: worked example
For a 2×2 example, A × B where each output cell is the dot product of a row of A with a column of B:
A = [1 2] B = [5 6]
[3 4] [7 8]
A × B:
[0,0] = 1×5 + 2×7 = 5 + 14 = 19
[0,1] = 1×6 + 2×8 = 6 + 16 = 22
[1,0] = 3×5 + 4×7 = 15 + 28 = 43
[1,1] = 3×6 + 4×8 = 18 + 32 = 50
Result = [19 22]
[43 50] Dimension rules
| Operation | Requirement | Result shape |
|---|---|---|
| Addition / subtraction | Same dimensions (m×n + m×n) | m×n |
| Multiplication (A×B) | A is m×k; B is k×n (inner dims match) | m×n |
| Scalar multiplication | Any matrix m×n and finite scalar k | m×n |
| Transpose | Any matrix m×n | n×m |
| RREF | Any matrix m×n | m×n |
| Rank | Any matrix m×n | scalar |
| Determinant | Square matrix n×n | scalar |
| Inverse | Square, non-singular (det ≠ 0) | n×n |
| Power Aⁿ | Square matrix; integer n from −20 to 20 (negative n requires an inverse) | n×n |
| Trace | Square matrix n×n | scalar |
Real-world applications
- 3D graphics: every rotation, scaling, and projection in a 3D engine is a matrix multiplication applied to vertex coordinates.
- Machine learning: neural network layers are represented as weight matrices; forward propagation is a sequence of matrix multiplications.
- Solving linear systems: the equation Ax = b, where A is a coefficient matrix and b is a constant vector, is solved using Gaussian elimination or matrix inversion.
- Eigenvalues and eigenvectors: the equation Av = λv defines eigenvectors v and eigenvalues λ - foundational to PCA (dimensionality reduction), Google's PageRank algorithm, and structural vibration analysis.
Frequently asked questions
What operations does this matrix calculator support?
This calculator supports addition, subtraction, scalar and matrix multiplication, transpose, determinant, inverse, rank, trace, reduced row-echelon form (RREF), and integer matrix powers Aⁿ. Matrices can be up to 10×10. RREF works with rectangular matrices; matrix powers require a square matrix and accept exponents from −20 to 20.
What is reduced row-echelon form (RREF)?
RREF is a matrix form produced by elementary row operations: each pivot is 1, each pivot is the only nonzero entry in its column, and pivots move to the right as rows go down. This calculator supports rectangular matrices, uses scaled pivot selection with a tolerance based on matrix size and magnitude, and lists numbered swaps, scaling, and elimination steps. Floating-point rounding means very ill-conditioned inputs may be sensitive to the numerical tolerance.
Can I raise a matrix to a power?
Yes. Choose Aⁿ and enter an integer exponent from −20 through 20. Matrix A must be square. A⁰ returns the identity matrix; positive powers use repeated matrix multiplication; negative powers first require an inverse, so singular matrices return an error. Non-integer exponents and results that overflow to non-finite values are rejected.
How is the determinant calculated?
For matrices up to 4×4, the calculator uses cofactor expansion (also called Laplace expansion) along the first row and shows each step. For larger matrices, it uses LU decomposition with partial pivoting for numerical stability.
How is the matrix inverse calculated?
The inverse is computed using Gauss-Jordan elimination: the original matrix is augmented with the identity matrix [A | I], then row operations reduce the left side to the identity, leaving the inverse on the right [I | A⁻¹]. Pivot selection is scaled by row size, and the near-zero test is relative to the matrix norm and machine precision, so a uniformly scaled invertible matrix is not rejected merely because its entries are small. Each row operation is shown as a step.
When does a matrix not have an inverse?
A matrix is invertible only if it is square and its determinant is non-zero. A zero or numerically unresolved pivot indicates a singular or ill-conditioned matrix, so no reliable inverse is returned. The calculator compares pivots with a tolerance relative to the matrix scale, rather than using one fixed absolute cutoff.
Related tools
- Linear System SolverUse matrices to solve a concrete two- or three-variable equation system.
- Vector CalculatorContinue with vector dot products, cross products, projections, and angles.
- Linear RegressionFit a line to data, a common application of matrix least-squares methods.
- Complex Number CalculatorCalculate with complex entries separately when the matrix values are not real.