Free Matrix Calculator – Add, Multiply, Invert & Solve Matrices
A complete matrix calculator for students and professionals: addition, subtraction, multiplication, transpose, determinant, inverse, adjoint, rank, trace, RREF, matrix powers, scalar multiplication, and solving linear systems AX = B. Enter your own values — everything calculates instantly in your browser.
What Is a Matrix Calculator?
A matrix calculator performs linear algebra operations on user-entered matrices instantly — without needing a graphing calculator, MATLAB license, or manual computation. This tool supports two matrices, A and B, and covers the full range of operations typically taught in a linear algebra or precalculus course: arithmetic between matrices, single-matrix transformations, and the structural properties used to analyze a matrix or solve a system of linear equations.
Everything runs directly in your browser using standard linear algebra algorithms — cofactor expansion for determinants and adjoints, and Gauss-Jordan elimination for row reduction — so results appear instantly as you type, with no server round-trip and no data stored.
Supported Operations — Quick Reference
The table below summarizes every operation this calculator supports, the dimensional requirements, and what each one returns:
| Operation | Requirement | Returns |
|---|---|---|
| A + B / A − B | Same dimensions | Matrix (same size) |
| A × B | Columns of A = Rows of B | Matrix (rows A × cols B) |
| Scalar k·A | Any matrix | Matrix (same size) |
| Transpose Aᵀ | Any matrix | Matrix (rows ↔ cols swapped) |
| Determinant det(A) | Square matrix only | Single number |
| Inverse A⁻¹ | Square, det ≠ 0 | Matrix (same size) |
| Adjoint adj(A) | Square matrix only | Matrix (same size) |
| Rank | Any matrix | Single number |
| Trace | Square matrix only | Single number (sum of diagonal) |
| RREF | Any matrix | Matrix (reduced row echelon form) |
| Power Aⁿ | Square matrix only | Matrix (same size) |
| Solve AX = B | A square & invertible | Matrix X = A⁻¹B |
How to Use This Matrix Calculator
- Step 1: Set rows and columns for Matrix A (and B if needed) using the + / − controls. Matrices can be up to 6×6.
- Step 2: Type values directly into each cell. Decimals and negative numbers are fully supported.
- Step 3: Select an operation from the chip rows. Results update instantly as you type or change the operation.
- Step 4: Click the result to copy it — it copies in tab-separated format ready to paste into Excel or Google Sheets.
Key Formulas Behind Each Operation
Determinant (Cofactor Expansion)
For a 2×2 matrix [[a, b], [c, d]], the determinant is ad − bc. For larger matrices, this calculator uses recursive cofactor expansion along the first row. The determinant tells you whether a matrix is invertible (non-zero det) or singular (det = 0), and its absolute value represents the scaling factor the matrix applies to area or volume.
Inverse (via Adjugate)
A⁻¹ = (1 / det(A)) × adj(A)
The inverse exists only when the determinant is non-zero. This calculator computes the cofactor matrix, transposes it to get the adjugate, then scales by 1/det. The inverse is essential for solving systems: if AX = B, then X = A⁻¹B.
RREF (Gauss-Jordan Elimination)
Reduced Row Echelon Form is the simplest equivalent form of a matrix, produced by applying elementary row operations until every leading entry is 1 and is the only non-zero entry in its column. RREF reveals rank, solution existence, and free variables in underdetermined systems.
Worked Examples
Example 1: 2×2 Matrix Multiplication
A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]
- Row 1, Col 1: (1×5) + (2×7) = 19
- Row 1, Col 2: (1×6) + (2×8) = 22
- Row 2, Col 1: (3×5) + (4×7) = 43
- Row 2, Col 2: (3×6) + (4×8) = 50
Result: [[19, 22], [43, 50]]
Example 2: Determinant and Inverse
A = [[4, 7], [2, 6]]
- det(A) = (4×6) − (7×2) = 10
- A⁻¹ = (1/10) × [[6, −7], [−2, 4]] = [[0.6, −0.7], [−0.2, 0.4]]
Example 3: Solving a Linear System
Solve: 2x + y = 5 and 4x + 3y = 11
- A = [[2, 1], [4, 3]], B = [[5], [11]]
- det(A) = 2 (non-zero, solvable)
- X = A⁻¹B → x = 2, y = 1
When and Why You Would Use Each Operation
- Determinant — Check if a system has a unique solution, or calculate area/volume scaling in geometry and physics.
- Inverse — Solve linear systems, decode Hill cipher cryptography, or find transformation reversals in computer graphics.
- RREF — Solve any system of equations including underdetermined and overdetermined ones, find basis vectors, and determine linear independence.
- Rank — Determine column space dimension, check system solvability, and identify redundant equations.
- Transpose — Rotate data for statistical operations, compute symmetric matrices (AᵀA), and prepare least-squares regression.
- Matrix Power — Model discrete time-step systems like Markov chains, population models, and recurrence relations.
If you need to work with the individual numbers in your results — computing percentages, averages, or statistical measures — our percentage calculator and mean, median, mode calculator handle those computations.
Why Some Operations Show an Error
- Addition / Subtraction: Both matrices must have exactly the same dimensions.
- Multiplication: Columns of A must equal rows of B.
- Determinant, Inverse, Adjoint, Trace, Power: All require a square matrix.
- Inverse: Also requires non-zero determinant. When det = 0, the matrix is singular.
- Solve AX = B: Requires A to be both square and invertible, and B to have the same number of rows as A.
Common Mistakes in Matrix Operations
- Assuming multiplication is commutative. A × B is almost never the same as B × A. Order matters.
- Confusing adjoint with adjugate. In some textbooks, "adjoint" means conjugate transpose (for complex matrices). Here and in most linear algebra courses, it means the transpose of the cofactor matrix.
- Forgetting det = 0 means no inverse. If you try to solve AX = B and A has a zero determinant, use RREF instead to analyze the solution space.
- Mixing up rows and columns in multiplication. An m×n matrix times an n×p matrix gives m×p. If it says "columns of A must match rows of B," check that colsA = rowsB.
- Entering values in the wrong matrix for Solve AX = B. A is the coefficient matrix and B is the constant vector (column matrix). Swapping them gives wrong results.
Where Matrices Are Used in the Real World
- Computer graphics and gaming — Every 3D rotation, scaling, and translation on screen is a matrix multiplication.
- Machine learning — Neural networks are built entirely on matrix multiplication and element-wise operations.
- Economics and finance — Input-output models, portfolio optimization, and Markov chains for market modeling. For applied financial math, our EMI calculator and loan calculator handle practical loan computations.
- Engineering — Structural analysis, circuit analysis, and control systems rely on solving matrix equations.
- Statistics — Regression analysis, covariance matrices, and PCA are matrix operations. Our statistics calculator covers descriptive statistics.
- Cryptography — The Hill cipher uses matrix multiplication and modular inverses to encrypt and decrypt messages.
Frequently Asked Questions
Is this matrix calculator free to use?
What is the largest matrix size supported?
Why does my matrix have no inverse?
What does it mean if 'Solve AX = B' shows an error?
What is the difference between rank and RREF?
Is matrix multiplication commutative?
Can I use decimals or negative numbers?
Can I copy results to a spreadsheet?
Does this tool store the matrices I enter?
Final Thoughts
Matrices are the language of linear algebra, and linear algebra is the mathematical backbone of everything from search algorithms to 3D video games to medical imaging. This calculator gives you instant access to every standard matrix operation — enter your values, pick an operation, and see the result in real time. For related math tools, try our percentage calculator for ratio-based computations, our mean, median, mode calculator for descriptive statistics, or our GPA calculator for weighted academic averages.
