Matrix Calculator

Add, subtract, multiply, find determinant, inverse, transpose, REF/RREF, eigenvalues & more

Size:

Quick Examples

2×2 Determinant

A = [[4, 7], [2, 6]]
det(A) = ad − bc = 24 − 14 = 10

Click to load →

Matrix Multiplication

A = [[1,2],[3,4]]
B = [[5,6],[7,8]]
C = A × B

Click to load →

3×3 Matrix Inverse

A = [[2,1,3],[0,4,1],[5,2,8]]
Find A⁻¹ via adjugate

Click to load →

Identity Matrix det

I₃ — 3×3 identity
det(I) = 1

Click to load →

Rotation Transpose

A = [[0,−1],[1,0]]
90° rotation matrix Aᵀ

Click to load →

Singular 3×3 Matrix

A = [[1,2,3],[4,5,6],[7,8,9]]
det = 0 (singular)

Click to load →

What Is a Matrix Calculator?

A matrix calculator is a tool that performs arithmetic and algebraic operations on rectangular arrays of numbers called matrices. Matrices are fundamental objects in linear algebra and appear throughout mathematics, physics, computer graphics, machine learning, and engineering. This free online matrix calculator handles all core operations — addition, subtraction, multiplication, determinant, inverse, transpose, REF, RREF, eigenvalues, rank, trace, and matrix powers — for 2×2, 3×3, and 4×4 square matrices, with full step-by-step working shown for every computation.

Operations Explained

Matrix Addition and Subtraction

Two matrices can be added or subtracted only when they have the same dimensions. The result is a matrix of the same size where each entry is the sum (or difference) of the corresponding entries in the two input matrices. For example, adding [[1,2],[3,4]] and [[5,6],[7,8]] gives [[6,8],[10,12]]. This calculator shows the individual entry computations as step-by-step working.

Matrix Multiplication

Matrix multiplication (A × B) is defined when the number of columns in A equals the number of rows in B. For square n×n matrices, this is always satisfied. Entry C[i][j] is the dot product of row i of A and column j of B — that is, the sum of products of corresponding elements. Unlike scalar multiplication, matrix multiplication is generally not commutative: A × B ≠ B × A in most cases.

Determinant

The determinant is a single number computed from a square matrix that encodes important geometric and algebraic information. For a 2×2 matrix [[a,b],[c,d]], the determinant is ad − bc. For 3×3 and 4×4 matrices, this calculator uses cofactor expansion along the first row. Key facts: a matrix is invertible if and only if its determinant is non-zero; the determinant gives the signed volume scaling factor of the associated linear transformation; and det(AB) = det(A) × det(B).

Matrix Inverse

The inverse A⁻¹ of a square matrix A satisfies A × A⁻¹ = A⁻¹ × A = I (the identity matrix). An inverse exists if and only if det(A) ≠ 0. For 2×2 matrices the formula is A⁻¹ = (1/det) × [[d,−b],[−c,a]]. For larger matrices this calculator computes the adjugate (transpose of the cofactor matrix) and divides by the determinant. The step-by-step breakdown shows each intermediate matrix.

Transpose

The transpose Aᵀ is formed by swapping rows and columns: Aᵀ[i][j] = A[j][i]. An n×m matrix becomes m×n after transposing. For square matrices, the transpose reflects entries across the main diagonal. Symmetric matrices satisfy A = Aᵀ. Orthogonal matrices (rotation matrices, for example) have the special property Aᵀ = A⁻¹.

Row Echelon Form (REF) and RREF

Gaussian elimination transforms a matrix into Row Echelon Form (REF) by using row operations (swapping rows, scaling rows, adding multiples of one row to another). REF requires that pivot entries are to the right of the pivot above, and all entries below each pivot are zero. Gauss-Jordan elimination continues to Reduced Row Echelon Form (RREF), where every pivot is 1 and all entries above and below each pivot are zero. RREF is unique for any given matrix and is used to solve systems of linear equations, find rank, and compute inverses.

Eigenvalues (2×2)

Eigenvalues λ of a matrix A are solutions to det(A − λI) = 0, the characteristic equation. For 2×2 matrices this becomes the quadratic λ² − tr(A)λ + det(A) = 0, solved by the quadratic formula. The discriminant Δ = tr(A)² − 4det(A) determines whether eigenvalues are real (Δ ≥ 0) or complex conjugate pairs (Δ < 0). Eigenvalues reveal a matrix's stability, diagonalizability, and the long-run behaviour of linear dynamical systems.

Rank and Trace

The rank of a matrix is the number of linearly independent rows (equivalently, columns), computed here by counting non-zero rows in RREF. A full-rank n×n matrix has rank n and is invertible. The trace is simply the sum of the main diagonal entries and equals the sum of all eigenvalues. Both rank and trace are computed in the Advanced tab with step-by-step explanations.

Worked Examples

Example 1 — 2×2 Determinant

Given A = [[4, 7], [2, 6]]:

  1. Apply the 2×2 formula: det(A) = ad − bc
  2. det(A) = (4)(6) − (7)(2) = 24 − 14 = 10
  3. Since det ≠ 0, the matrix is invertible.

Example 2 — 2×2 Matrix Multiplication

Given A = [[1,2],[3,4]] and B = [[5,6],[7,8]]:

  1. C[1][1] = 1×5 + 2×7 = 5 + 14 = 19
  2. C[1][2] = 1×6 + 2×8 = 6 + 16 = 22
  3. C[2][1] = 3×5 + 4×7 = 15 + 28 = 43
  4. C[2][2] = 3×6 + 4×8 = 18 + 32 = 50
  5. Result: C = [[19, 22], [43, 50]]

Example 3 — 2×2 Matrix Inverse

Given A = [[4, 7], [2, 6]]:

  1. Compute det(A) = 24 − 14 = 10
  2. Apply 2×2 inverse formula: A⁻¹ = (1/10) × [[6, −7], [−2, 4]]
  3. A⁻¹ = [[0.6, −0.7], [−0.2, 0.4]]
  4. Verify: A × A⁻¹ = [[1,0],[0,1]] ✓

Frequently Asked Questions

How do you multiply two matrices?
To multiply matrices A (m×n) and B (n×p), each entry C[i][j] is the dot product of row i of A and column j of B: C[i][j] = A[i][1]×B[1][j] + A[i][2]×B[2][j] + … + A[i][n]×B[n][j]. The number of columns in A must equal the number of rows in B, otherwise multiplication is undefined. The result is an m×p matrix. Use the Multiply operation in the Basic tab above and click "Calculate" to see every entry computed step by step.
What is the determinant of a matrix?
The determinant is a scalar value computed from a square matrix. For a 2×2 matrix [[a,b],[c,d]], det = ad − bc. For larger matrices, it is computed recursively by cofactor expansion. The determinant is zero if and only if the matrix is singular (not invertible). It also represents the signed scaling factor of the linear transformation described by the matrix — geometrically, it is the signed area (2D) or volume (3D) of the parallelepiped formed by the column vectors.
How do you find the inverse of a matrix?
A square matrix A has an inverse A⁻¹ if and only if its determinant is non-zero. For a 2×2 matrix [[a,b],[c,d]], the formula is A⁻¹ = (1/det) × [[d, −b], [−c, a]]. For 3×3 and 4×4 matrices, the inverse equals (1/det) × adj(A), where adj(A) is the adjugate (transpose of the cofactor matrix). The calculator shows the cofactor matrix, adjugate, and final inverse with full working. Verify by checking that A × A⁻¹ equals the identity matrix.
What is the difference between REF and RREF?
Row Echelon Form (REF) requires that all zero rows are at the bottom, the leading entry (pivot) of each non-zero row is to the right of the pivot in the row above, and all entries below each pivot are zero. Reduced Row Echelon Form (RREF) adds two further conditions: each pivot must equal 1, and all entries above each pivot must also be zero. REF can have infinitely many forms for a given matrix, but RREF is unique. Both are computed using Gaussian elimination and Gauss-Jordan elimination respectively.
What are eigenvalues of a matrix?
Eigenvalues are scalars λ such that Av = λv for some non-zero vector v (the corresponding eigenvector). For a 2×2 matrix, they satisfy the characteristic equation λ² − tr(A)λ + det(A) = 0. The discriminant Δ = tr(A)² − 4det(A) determines whether the eigenvalues are real (Δ ≥ 0) or complex conjugate pairs (Δ < 0). Eigenvalues reveal critical properties: stability of dynamical systems, whether a matrix is diagonalisable, and the principal directions of transformations like rotations and stretches.
What is the rank of a matrix?
The rank of a matrix is the number of linearly independent rows (or equivalently, columns). It equals the number of non-zero rows in the matrix's RREF. Rank indicates the dimension of the column space — effectively how many directions of output the matrix can produce. A square n×n matrix is invertible if and only if its rank equals n (full rank). Rank below n means the matrix is singular and has a non-trivial null space.
What is the transpose of a matrix?
The transpose Aᵀ is obtained by reflecting entries across the main diagonal: Aᵀ[i][j] = A[j][i]. An m×n matrix becomes an n×m matrix after transposing. For square matrices, this swaps off-diagonal entries in place. Symmetric matrices satisfy A = Aᵀ. Orthogonal matrices (such as rotation matrices) have the elegant property that Aᵀ = A⁻¹, making transposition a computationally cheap way to find the inverse. The transpose is also central to operations like computing the adjugate and calculating dot products.

Related Calculators