Enter matrices
Education- A + B
- A − B
- A × B
- B × A
- k·M (scalar multiple)
- Mⁿ (a power)
- Mᵀ (transpose)
- Expansion along a row
- Expansion along a column
- Gauss elimination
- Sarrus rule (3×3) and the triangle rule (2×2)
- Gauss–Jordan [A | E]
- Via the adjugate (up to 4×4)
- Matrix A
- Matrix B
Matrix A
2×2- 1
- 2
- 3
- 4
- 5
- 6
- 1
- 2
- 3
- 4
- 5
- 6
Matrix B
2×2- 1
- 2
- 3
- 4
- 5
- 6
- 1
- 2
- 3
- 4
- 5
- 6
Settings
- Fractions
- Decimals
- 4
- 2
- 6
- 8
- 10
Result
CalcCoreWhat the matrix calculator does
The calculator performs all the main operations with matrices up to 6×6: addition, subtraction, multiplication, scalar multiplication, powers (also negative) and transposition. It finds the determinant in three ways, the inverse matrix, the rank, the trace, and solves the matrix equation AX = B. Elements may be integers, decimals or fractions, and answers are exact, for example −7/120. Every operation comes with a step-by-step solution.
Adding and multiplying matrices
Only matrices of the same size can be added or subtracted: cᵢⱼ = aᵢⱼ ± bᵢⱼ. The product A × B exists when A has as many columns as B has rows: cᵢⱼ = aᵢ₁b₁ⱼ + aᵢ₂b₂ⱼ + … Matrix multiplication is not commutative: A × B is generally not equal to B × A. For A = [[1,2],[3,4]] and B = [[0,1],[1,0]] we get A × B = [[2,1],[4,3]]. The power Aⁿ is an n-fold product: for [[1,1],[1,0]]¹⁰ the result is [[89,55],[55,34]] (Fibonacci numbers).
The determinant
Only square matrices have a determinant. For 2×2: det = ad − bc, for example for [[1,2],[3,4]] it is 1·4 − 2·3 = −2. For 3×3 there is the Sarrus rule (three products with a plus and three with a minus) and expansion along a row: det = Σ aᵢⱼ·(−1)^(i+j)·Mᵢⱼ. For larger matrices Gauss elimination is handy: reduce to triangular form, and det equals the product of the diagonal (with a sign from row swaps). For [[2,1,3],[0,−1,4],[1,2,1]] the determinant is −11.
The inverse matrix
The inverse A⁻¹ satisfies A·A⁻¹ = E and exists only when det A ≠ 0. The calculator finds it by Gauss–Jordan elimination: it writes [A | E] and reduces the left part to the identity, and the right part becomes the inverse. The second way is the formula A⁻¹ = adj A / det A via cofactors. For [[1,2],[3,4]] the inverse is [[−2, 1], [3/2, −1/2]]. If det = 0 the matrix is singular, and the calculator shows in which column there is no pivot.
The rank
The rank is the maximum number of linearly independent rows (or columns); it is found by reducing to echelon form and counting the non-zero rows. For [[1,2,3],[4,5,6],[7,8,9]] the rank is 2, because the third row equals 2·(second) − (first), and the determinant is zero. The rank of an n×n matrix equals n if and only if it is non-singular.
Solving AX = B
For a non-singular square A the solution is unique: X = A⁻¹B. The calculator performs [A | B] → [E | X] by Gauss–Jordan elimination and checks A·X = B. For [[2,1],[1,3]]·X = [[5],[10]] we get x = 1, y = 3. If A is singular or non-square, the Rouché–Capelli theorem is used: there are no solutions when rank A < rank [A | B]; there are infinitely many when the ranks are equal but less than the number of unknowns, and then the general solution with free variables is shown.
Where matrices are used
Matrices describe systems of linear equations, transformations in computer graphics (rotation, scaling, translation), Markov chains, input–output models in economics, neural networks, images and data tables. The determinant and the inverse matrix are at the core of linear algebra.
All elements are handled as exact rational numbers: 1/3 stays a fraction, not 0.333. For large matrices the key states are shown rather than every single operation.
FAQ
How do I multiply two matrices?
Each element of the product cᵢⱼ is the sum of the products of the elements of row i of the first matrix and column j of the second. The number of columns of the first must equal the number of rows of the second.
Why is A × B not equal to B × A?
Matrix multiplication is not commutative: the order of the factors changes the result, and sometimes one of the products does not exist because of the sizes.
How do I find the determinant of a 3×3 matrix?
With the Sarrus rule, expansion along a row or Gauss elimination. For [[2,1,3],[0,−1,4],[1,2,1]] the determinant is −11.
How do I find the inverse matrix?
By Gauss–Jordan elimination: [A | E] → [E | A⁻¹], or by the formula A⁻¹ = adj A / det A. For [[1,2],[3,4]] it is [[−2, 1], [3/2, −1/2]].
When does the inverse not exist?
When the determinant is zero (the matrix is singular) or the matrix is not square. Then the rank is less than the size.
What is the rank of a matrix?
The maximum number of linearly independent rows (columns). It is found by reducing to echelon form: it is the number of non-zero rows.
How do I solve the matrix equation AX = B?
If A is non-singular, X = A⁻¹B; the calculator performs [A | B] → [E | X]. For singular A the consistency is analysed by Rouché–Capelli.
What is the transpose of a matrix?
The matrix Aᵀ in which rows and columns are swapped: the element (i, j) becomes the element (j, i).
Can I enter fractions and decimals?
Yes: 2, -1.5, 3/4. The numbers are handled exactly, so 1/3 stays a fraction, not 0.333.
How do I raise a matrix to a power?
Multiply the matrix by itself n times. For a negative n the inverse is taken first. For [[1,1],[1,0]]¹⁰ the result is [[89,55],[55,34]].
What is the trace of a matrix?
The sum of the main diagonal elements of a square matrix. It is shown in the «Rank» tab.
Is 6×6 enough?
For study problems, yes. For large matrices the intermediate steps are shortened: one state per pivot column.