Matrix Calculator

Add, subtract, multiply matrices and find the determinant, transpose, inverse, trace, and rank. Supports sizes from 1x1 to 4x4.

🔢 Matrix Operation
Results

Choose an operation and enter matrix values.

Matrix Calculator: Operations, Determinant, and Inverse

A matrix is a rectangular grid of numbers arranged in rows and columns, and matrices are the backbone of linear algebra. This calculator performs the core matrix operations on sizes from 1x1 to 4x4: addition, subtraction, and multiplication between two matrices, plus determinant, transpose, inverse, scalar multiplication, trace, and rank for a single matrix. Choose an operation, enter your values, and the exact result appears instantly.

Addition: C[i][j] = A[i][j] + B[i][j]
Multiplication: A(m×n) × B(n×p) = C(m×p)
Determinant 2×2: ad - bc
Transpose: rows become columns
Inverse: A⁻¹ = adjugate(A) / det(A), det ≠ 0
Trace: sum of the diagonal
Rank: number of independent rows

How the Operations Work

Addition and subtraction act element by element, so both matrices must be the same size. Multiplication is different: it combines rows of A with columns of B, which is why the columns of A must equal the rows of B. The determinant condenses a square matrix into one number, the transpose flips rows and columns, and the inverse is the matrix that multiplies with the original to give the identity. Trace adds the diagonal, and rank counts the independent rows.

Where Matrices Are Used

Matrices appear everywhere in science and technology. Engineers use them to solve systems of equations and model structures. Computer graphics relies on matrices to rotate, scale, and project 3D scenes onto a screen. Statisticians use them for regression and data transformation, and machine learning is built on matrix operations at massive scale. Understanding these basics is the foundation for all of those fields.

Determinant and Invertibility

The determinant is the key to whether a matrix can be inverted. A nonzero determinant means the matrix is invertible and represents a transformation that can be reversed. A determinant of zero means the matrix is singular: it collapses space onto a lower dimension and cannot be undone. This calculator computes the determinant with exact cofactor expansion and reports clearly when an inverse does not exist.

Tips & Recommendations

Multiplication Rule

Columns of A must equal rows of B. An m by n times n by p gives an m by p result. Check dimensions before multiplying.

Inverse Needs det ≠ 0

Only square matrices with a nonzero determinant have an inverse. If the determinant is zero, the matrix is singular.

Determinant Meaning

The determinant tells you if a matrix is invertible and how it scales area or volume. Zero means it flattens space.

Square for Trace

Trace and determinant only apply to square matrices. The trace is simply the sum of the main diagonal entries.

Frequently Asked Questions

What matrix sizes does this calculator support?

It supports matrices from 1x1 up to 4x4, which covers the vast majority of classroom, engineering, and graphics work. You set the number of rows and columns for each matrix independently, and the input grid updates automatically so you only fill the cells you need.

Why does matrix multiplication not always work?

Multiplication requires the inner dimensions to match: the number of columns in matrix A must equal the number of rows in matrix B. An m by n matrix can only multiply an n by p matrix, producing an m by p result. If the dimensions do not line up, the product is undefined and the calculator shows an explanation instead of a result.

When does a matrix have no inverse?

A square matrix has an inverse only when its determinant is not zero. If the determinant equals zero, the matrix is called singular and no inverse exists. This happens when the rows or columns are linearly dependent, for example when one row is a multiple of another. The calculator checks the determinant first and tells you when the inverse is undefined.

What is a determinant?

The determinant is a single number computed from a square matrix that captures key properties of the linear transformation it represents. A determinant of zero means the matrix is singular and not invertible. The sign and magnitude also describe how the transformation scales area or volume. For a 2x2 matrix [[a,b],[c,d]], the determinant is ad minus bc.

What operations can this calculator perform?

It handles addition, subtraction, and multiplication between two matrices, plus single-matrix operations: determinant, transpose, inverse, scalar multiplication, trace (the sum of the diagonal), and rank. Choose an operation and the calculator shows exactly the inputs it needs, then returns either a result matrix or a single value.

What is the transpose of a matrix?

The transpose flips a matrix over its main diagonal, turning rows into columns and columns into rows. An m by n matrix becomes n by m. The element in row i, column j moves to row j, column i. Transposing is used throughout linear algebra, statistics, and computer graphics, and transposing twice returns the original matrix.

Recent Calculations

No calculations yet

Last updated: June 17, 2026