Matrix Calculator — Add, Multiply, Transpose, Inverse & Determinant
Perform matrix operations online: addition, subtraction, multiplication, transpose, inverse, and determinant for 2×2, 3×3, and larger matrices.
Matrix math is one of those things where the concept isn't hard — it's the arithmetic that trips people up. Keeping track of which row multiplies which column, carrying a sign error through an inverse calculation, accidentally transposing a dimension. The CalcHub Matrix Calculator takes care of the arithmetic so you can focus on what the numbers actually mean.
Supported Operations
| Operation | What It Does |
|---|---|
| Addition / Subtraction | Element-wise, requires matching dimensions |
| Scalar Multiplication | Multiply every element by a number |
| Matrix Multiplication | Row × column dot products |
| Transpose | Flip rows and columns |
| Determinant | Single scalar value, square matrices only |
| Inverse | A⁻¹ such that A × A⁻¹ = I |
| Power | A², A³, etc. for square matrices |
How to Use It
- Select the matrix size (2×2, 3×3, or enter custom dimensions).
- Fill in the elements row by row.
- For two-matrix operations, fill in the second matrix too.
- Choose the operation and click Calculate.
Quick Reference: Matrix Multiplication Rules
This is where most errors happen. Two matrices A (m×n) and B (n×p) can be multiplied only when the inner dimensions match — the column count of A must equal the row count of B. The result is an m×p matrix.
A (2×3) × B (3×2) → Result is (2×2). Valid.
A (2×3) × B (2×3) → Invalid — inner dimensions don't match.
Each element (i,j) of the result is the dot product of row i from A and column j from B.
Determinant: 2×2 and 3×3
2×2:det | a b | = ad − bc
3×3 (cofactor expansion):| c d |
det = a(ei − fh) − b(di − fg) + c(dh − eg)
where the letters refer to positions in the 3×3 grid. The determinant tells you whether a matrix is invertible (nonzero) or singular (zero = not invertible).
Inverse of a 2×2 Matrix
A = | a b | A⁻¹ = (1/det) × | d −b |
| c d | | −c a |
For a = 4, b = 7, c = 2, d = 6:
- det = (4×6) − (7×2) = 24 − 14 = 10
- A⁻¹ = (1/10) × | 6 −7 | = | 0.6 −0.7 |
Practical Applications
- Solving linear systems: A system of equations can be written as Ax = b; the solution is x = A⁻¹b (when A is invertible).
- Graphics/transformations: Rotation and scaling matrices are the backbone of 2D/3D transformations in computer graphics.
- Statistics: Covariance matrices, regression calculations — all matrix operations under the hood.
- Network analysis: Adjacency matrices represent graph connections; matrix powers reveal path counts between nodes.
Tips
- If the determinant is zero, the matrix is singular — no inverse exists. The calculator will flag this rather than giving you nonsense.
- For large matrices, use the step display to catch where an error might have crept in during manual checks.
- Multiplication is not commutative for matrices: A×B ≠ B×A in general. The order matters.
Why can't I multiply a 3×2 matrix by a 3×2 matrix?
Matrix multiplication requires the number of columns in the first matrix to equal the number of rows in the second. A 3×2 matrix has 2 columns, but your second matrix has 3 rows — those don't match. You'd need to transpose one of them first.
My matrix has a determinant close to zero but not exactly zero — is the inverse reliable?
A near-zero determinant (like 0.000001) means the matrix is nearly singular. The computed inverse will exist but will have very large values, amplifying any numerical errors. This is called being "ill-conditioned." For practical purposes, treat near-zero determinants as singular.
What's the identity matrix and why does it matter?
The identity matrix I is a square matrix with 1s on the diagonal and 0s everywhere else. Multiplying any matrix by I returns that same matrix — it's the matrix equivalent of multiplying by 1. It's the target result when you multiply a matrix by its inverse: A × A⁻¹ = I.
Related calculators: Quadratic Equation Solver · Graphing Calculator · Scientific Calculator