Skip to content
Toolcroft

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.

Matrix A
Rows
Cols

A (3×3)

Matrix B
Rows
Cols

B (3×3)

Result

000
000
000

How to use this tool

  1. 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.
  2. 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.
  3. 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.
  4. 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

OperationRequirementResult shape
Addition / subtractionSame dimensions (m×n + m×n)m×n
Multiplication (A×B)A is m×k; B is k×n (inner dims match)m×n
Scalar multiplicationAny matrix m×n and finite scalar km×n
TransposeAny matrix m×nn×m
RREFAny matrix m×nm×n
RankAny matrix m×nscalar
DeterminantSquare matrix n×nscalar
InverseSquare, non-singular (det ≠ 0)n×n
Power AⁿSquare matrix; integer n from −20 to 20 (negative n requires an inverse)n×n
TraceSquare matrix n×nscalar

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.

Browse all math calculators