Math & Education
Matrix Calculator
Multiply, add and subtract matrices, and find the determinant, inverse, transpose and rank — or solve a system of linear equations Ax = b.
How to use
- 1Enter matrix A one row per line (numbers separated by spaces or commas).
- 2Choose the operation; for A×B or A+B also enter B, and for a system enter the right-hand side b.
How it's calculated
Determinant and inverse by Gauss-Jordan elimination with partial pivoting. A system Ax = b is solved as x = A⁻¹b when det(A) ≠ 0.
Frequently asked questions
When does a matrix have no inverse?
When its determinant is 0 (it's singular) — its rows are linearly dependent.
When can I multiply A by B?
When A has as many columns as B has rows. The result has A's rows and B's columns.
How do I solve 2x + 3y = 8, x − y = 1?
Enter A as '2 3' and '1 -1', choose 'Solve Ax = b' and enter b as '8, 1'. The answer is x = 2.2, y = 1.2.
Worked example: solving a system of equations as a matrix inverse
The system 2x + 3y = 8, x − y = 1 can be written as a 2×2 matrix A = [[2,3],[1,-1]] times a vector [x,y] equal to b = [8,1]. The calculator solves this as x = A⁻¹b rather than substitution: det(A) = 2×(-1) − 3×1 = -5, and working through the inverse and multiplication gives x = 2.2, y = 1.2 — checkable by substitution: 2(2.2) + 3(1.2) = 4.4 + 3.6 = 8, and 2.2 − 1.2 = 1. Both equations check out.
What a zero determinant actually means
A matrix only has an inverse when its determinant isn't zero — a zero determinant means the matrix's rows (or columns) are linearly dependent, which for a system of equations means the equations don't pin down a single unique solution (either no solution, or infinitely many). The rank calculation catches the same issue from a different angle: a matrix like [[1,2],[2,4]] has rank 1, not 2, because its second row is just the first row doubled — it carries no new information, which is exactly why its determinant is also zero.
Why matrix multiplication isn't just multiplying matching cells
A × B only works when A's column count matches B's row count, because each entry in the result is a dot product — row i of A matched against column j of B, multiplied pairwise and summed. For A = [[1,2],[3,4]] and B = [[5,6],[7,8]], the top-left entry of the result is (1×5 + 2×7) = 19, not 1×5 = 5, which is the mistake people make expecting element-by-element multiplication instead of the row-times-column rule that matrix multiplication actually follows.
Why rows get swapped during elimination even when nothing looks wrong
The determinant, inverse and rank calculations all use partial pivoting — at each step, they scan the remaining rows and swap in whichever has the largest absolute value in the current column before dividing by it, rather than always using whatever row happens to be in that position already. This isn't just a tie-breaker: dividing by a very small pivot value amplifies any floating-point rounding error already present in the matrix, so always promoting the largest available value keeps the arithmetic numerically stable. Each swap flips the sign of the running determinant, which is exactly accounted for in the calculation — one more reason the final determinant can require tracking more than just 'multiply the diagonal.'
Related tools
- Equation Solver (Linear & Quadratic)
Solve linear and quadratic equations in x — typed naturally like 3x + 5 = 2x - 7 or x^2 - 5x + 6 = 0 — with the discriminant, vertex and real or complex roots.
- Linear Inequality Solver
Solve linear inequalities in x like 3x − 5 < 7 or 2(x + 1) ≥ x − 4, flipping the sign correctly, with the answer in inequality and interval notation.
- Triangle Calculator
Solve any triangle from three known values (SSS, SAS or ASA): all sides, angles, area, perimeter and heights, using the law of sines and cosines.
- Ratio & Proportion Calculator
Simplify ratios like 12:18 to 2:3, scale a ratio to a total, and solve proportions (a:b = c:x) for the missing value.
- Velocity & Acceleration Calculator (SUVAT)
Solve constant-acceleration motion problems: enter any three of initial velocity, final velocity, acceleration, time and displacement to get the other two.
- Sudoku Solver
Solve any Sudoku instantly — paste or type the grid (dots or zeros for blanks) and get the completed solution, or learn that it has none or many.