Matrix Calculator
Matrix addition, multiplication, transpose, determinant, inverse, rank and Gaussian elimination. Exact fraction results with every row operation shown.
What does the matrix calculator do?
You enter matrices A and B and the tool performs the operation you choose: addition, subtraction, multiplication, scalar multiplication, transpose, determinant, inverse, rank, Gaussian elimination (reduced row echelon form) and whole number powers. Sizes range from 1 to 5. Cells accept whole numbers, decimals or fractions such as 3/4.
Why are the results fractions?
The work is done with fractions and no rounding. In an inverse you therefore see 1/3 instead of 0.3333, and a matrix whose determinant is zero never appears invertible because of rounding. You can switch the result to decimals if you prefer.
Formulas
- Product: for C = A × B the number of columns of A must equal the number of rows of B. The entry cᵢⱼ is the sum of products of row i of A and column j of B. Order matters: A × B and B × A are usually different.
- 2×2 determinant: det = a₁₁·a₂₂ − a₁₂·a₂₁.
- Larger determinants: the matrix is reduced to upper triangular form with row operations and the determinant is the product of the diagonal. Each row swap flips the sign.
- Inverse: the augmented matrix [A | I] is reduced to [I | A⁻¹]. If the determinant is zero there is no inverse.
- Rank: the number of non-zero rows in the echelon form.
Example
For A = [1 2, 3 4] the determinant is 1·4 − 2·3 = −2. The inverse is 1/(−2) times [4 −2, −3 1], which gives [−2 1, 3/2 −1/2]. Multiplying A by its inverse returns the identity matrix.
Limits
The largest size is 5×5. Cells take numbers only, so symbolic matrices and complex numbers are not supported. Eigenvalues, eigenvectors and matrix decompositions (LU, QR) are outside the scope of this tool. Decimal inputs are converted to exact fractions as typed: 0.1 is treated as exactly 1/10.
Related calculators
-
Mathematics
Equation Solver
Type an equation and see the roots step by step: linear, quadratic and cubic, discriminant, complex roots, numeric roots and systems in 2, 3 or 4 unknowns. -
Mathematics
Scientific Calculator
Type an expression and see the result at once: trigonometry, logarithms, powers, roots, factorials. Degree and radian modes, memory and history, all in your browser. -
Mathematics
Derivative Calculator
Type a function and see its derivative step by step: sum, product, quotient and chain rules, a simplified result, the value at a point and a graph. -
Mathematics
Function Graph Plotter
Type f(x) and see its graph: several functions at once, zoom and pan, roots and intersection points. Download the graph as SVG or PNG.
Found a mistake or something missing?
If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.