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.
Frequently asked questions
How do you calculate matrix multiplication?
In this example, multiplying the matrix with rows (1, 2) and (3, 4) by the matrix with rows (5, 6) and (7, 8) gives rows (19, 22) and (43, 50). Each entry is the sum of products from the corresponding row and column, and reversing the multiplication order generally changes the result.
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
Absolute Value and Piecewise Function Calculator
Solves absolute value equations and inequalities step by step, evaluates expressions, writes them piecewise and evaluates piecewise functions. -
Mathematics
Algebraic Expression Simplifier
Simplifies an algebraic expression step by step: expands brackets, combines like terms, cancels common factors in rational expressions and evaluates at given values. -
Mathematics
Arithmetic and Geometric Sequence Calculator
The nth term, the sum of the first n terms, the infinite sum, finding a sequence from two terms and the position of a term. Exact fractions, step by step. -
Mathematics
Combination, Permutation and Factorial Calculator
n!, P(n, r), C(n, r), permutations of repeated items, combinations with repetition and circular permutations. Exact to the last digit, with the expansion shown.
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.