Matrix Solver
Got a photo of your Math homework?
Upload it and let AI solve it instantly.
Solution
Select Operation
Matrix Size:
Quick Examples
Matrix Solver: Calculate Any Matrix Operation Step by Step
Your complete guide to matrices — from basic addition and multiplication to determinants, eigenvalues, LU decomposition, and beyond.
What Is a Matrix?
What is a matrix in math?
A matrix is a rectangular grid of numbers arranged in rows and columns. You write the size as m×n where m is the number of rows and n is the number of columns. A 3×2 matrix has 3 rows and 2 columns.
What are the different types of matrices?
A square matrix has equal rows and columns (like 3×3). An identity matrix has 1s on the diagonal and 0s elsewhere. A zero matrix has all entries as 0. A diagonal matrix has nonzero entries only on the main diagonal. A symmetric matrix equals its own transpose.
Why are matrices important in math?
Matrices appear in almost every area of higher math and engineering. They represent systems of equations, perform geometric transformations, encode graphs and networks, and power everything from computer graphics to machine learning algorithms.
How to Use This Matrix Solver
Click one of the operation buttons at the top of the calculator: Determinant, Inverse, Multiply, RREF, Eigenvalues, LU Decomposition, and more.
The input area will update automatically to show one or two matrix grids depending on what you selected.
Choose 2×2, 3×3, or 4×4 from the size buttons. Then type numbers into the grid cells. You can use integers, decimals, or negative numbers.
For Scalar Multiply or Matrix Power, an extra field appears for the scalar or exponent value.
Click Calculate or press Enter. The solution panel at the top of the card shows the step-by-step working instantly.
Use the Quick Examples buttons to load a pre-filled problem and see how a solved example looks before entering your own.
How to use this tool for real-world problems
If you have a system of 3 equations and 3 unknowns, write the coefficient matrix and use the Inverse or RREF operation to solve it in seconds. For a circuit analysis problem, enter the node matrix and compute the determinant to check solvability. For a statistics assignment, use matrix multiplication to apply a transformation to your data set.
How to Calculate the Determinant
What is a determinant?
The determinant is a single number that summarizes key properties of a square matrix. It tells you whether the matrix is invertible, how much the matrix scales area or volume, and whether a system of equations has a unique solution.
How do you solve for the determinant of a 2×2 matrix?
det([[a,b],[c,d]]) = ad − bc
For the matrix [[3,8],[4,6]], the determinant is (3×6) − (8×4) = 18 − 32 = −14. Use this solver to verify your working instantly.
How do you calculate the determinant of a 3×3 matrix?
Expand along the first row using cofactors. For each element a₁ⱼ in the first row, multiply it by the determinant of the 2×2 submatrix you get by removing row 1 and column j, and alternate the sign (+, −, +). This solver shows every cofactor step for 3×3 and 4×4 matrices.
What does a zero determinant mean?
A zero determinant means the matrix is singular — it has no inverse, and the rows (or columns) are linearly dependent. For a system of equations, a zero determinant means either no solution or infinitely many solutions exist.
How to Find the Inverse of a Matrix
What is the inverse of a matrix?
The inverse of matrix A, written A⁻¹, is the matrix that satisfies A × A⁻¹ = I, where I is the identity matrix. Only square matrices with a nonzero determinant have an inverse.
How do you find the inverse of a 2×2 matrix?
A⁻¹ = (1/det(A)) × [[d, -b], [-c, a]]
Swap the diagonal entries, negate the off-diagonal entries, and divide every element by the determinant. Enter this solver's 2×2 inverse to see this formula applied with full step-by-step working.
How do you find the inverse of a 3×3 or 4×4 matrix?
This calculator uses Gauss-Jordan elimination: it forms the augmented matrix [A | I] and applies row operations until the left side becomes I. Whatever remains on the right side is A⁻¹. This method works for any size square matrix and is shown step by step in the solution panel.
What is the adjoint matrix method for inverse?
The adjoint (or classical adjoint) of A is the transpose of the cofactor matrix. You can compute the inverse as A⁻¹ = adj(A) / det(A). This solver offers both the Adjoint and Inverse operations separately so you can see each component of this formula.
Matrix Multiplication Step by Step
How do you multiply two matrices?
To multiply A (m×n) by B (n×p), the number of columns in A must equal the number of rows in B. The result C is m×p. Each entry C[i][j] equals the sum of A[i][k] × B[k][j] for k from 1 to n — the dot product of row i of A with column j of B.
Is matrix multiplication commutative?
No. In general, A × B ≠ B × A. Matrix multiplication is non-commutative, which is one of its most important properties. This solver shows both matrix setups so you can see how swapping the order changes the result.
What is the Hadamard product?
The Hadamard product (element-wise multiplication) multiplies matrices of the same size by multiplying corresponding entries. C[i][j] = A[i][j] × B[i][j]. Unlike standard matrix multiplication, the Hadamard product IS commutative. It appears frequently in neural network computations and signal processing.
What is a matrix power?
The power Aⁿ means multiplying matrix A by itself n times. A² = A × A, A³ = A × A × A, and so on. A⁰ = I (identity matrix) by definition. This solver computes Aⁿ for any integer n ≥ 0 using repeated multiplication.
RREF, Row Echelon Form, and Matrix Rank
What is Row Echelon Form (REF)?
In Row Echelon Form, each pivot (leading nonzero entry) is to the right of the pivot in the row above, and all entries below a pivot are zero. This is the result of Gaussian elimination and is useful for back-substitution.
What is Reduced Row Echelon Form (RREF)?
RREF goes one step further: each pivot is exactly 1 and is the only nonzero entry in its column. RREF is produced by Gauss-Jordan elimination. It gives the unique simplest form of a matrix and directly reveals the solution to a system of equations.
How do you find the rank of a matrix?
Reduce the matrix to RREF and count the number of nonzero rows (pivot rows). That number is the rank. The rank tells you how many independent constraints a system has. If rank equals the number of variables, the system has a unique solution.
What is the null space and how does it relate to rank?
The null space (kernel) of an m×n matrix contains all vectors x where Ax = 0. By the rank-nullity theorem: rank + nullity = n (number of columns). So if rank = 2 and n = 3, then the null space has dimension 1 — meaning one free variable in the solution.
Eigenvalues and Eigenvectors
What are eigenvalues and eigenvectors?
An eigenvector v of matrix A is a nonzero vector that only gets scaled (not rotated) when multiplied by A. The scale factor λ is the eigenvalue. The equation is Av = λv, which rearranges to (A − λI)v = 0.
How do you find eigenvalues step by step?
Set up the characteristic equation det(A − λI) = 0. For a 2×2 matrix this gives a quadratic in λ — solve it with the quadratic formula to find the eigenvalues. For each λ, substitute back into (A − λI)v = 0 and solve for the eigenvector v.
What is the characteristic polynomial?
The characteristic polynomial is p(λ) = det(A − λI). For a 2×2 matrix, it is a degree-2 polynomial: λ² − trace(A)λ + det(A) = 0. The roots of this polynomial are the eigenvalues. This solver computes and factors the characteristic polynomial for you.
What is the trace of a matrix and how does it relate to eigenvalues?
The trace is the sum of the diagonal entries. For a 2×2 matrix [[a,b],[c,d]], trace = a + d. The trace equals the sum of all eigenvalues, and the determinant equals the product of all eigenvalues. These two facts give you a quick sanity check on eigenvalue calculations.
LU Decomposition and Cofactor Matrix
What is LU decomposition?
LU decomposition writes matrix A as the product of a lower triangular matrix L and an upper triangular matrix U: A = LU. It is essentially Gaussian elimination stored in matrix form. L holds the elimination multipliers on its lower triangle, and U is the row-reduced result.
Why use LU decomposition?
Once you have L and U, you can solve Ax = b very efficiently by solving Ly = b first (forward substitution) and then Ux = y (back substitution). This is much faster than re-running Gaussian elimination each time you change b. It also makes computing the determinant straightforward: det(A) = product of diagonal entries of U.
What is the cofactor matrix?
The cofactor C[i][j] of matrix A is (−1)^(i+j) times the determinant of the submatrix you get by removing row i and column j. The cofactor matrix collects all cofactors. Its transpose is the adjoint matrix, which is used to compute the inverse: A⁻¹ = adj(A) / det(A).
What is the adjoint matrix?
The adjoint (also called adjugate) of A is the transpose of the cofactor matrix. It satisfies A × adj(A) = det(A) × I. When det(A) ≠ 0, dividing the adjoint by the determinant gives the inverse. This calculator shows the adjoint matrix as a separate step so you can use it in manual calculations.
Matrix Norm and Other Operations
What is the Frobenius norm of a matrix?
The Frobenius norm is the square root of the sum of the squares of all entries: ||A||_F = √(Σ a²ᵢⱼ). It measures the overall "size" of a matrix, similar to how the Euclidean norm measures the length of a vector. This solver computes the Frobenius norm.
What is scalar multiplication of a matrix?
Scalar multiplication multiplies every entry of the matrix by a constant k. If A has entry a[i][j], then kA has entry k × a[i][j]. The determinant scales by kⁿ where n is the matrix size. The inverse of kA is (1/k) × A⁻¹.
How do you add or subtract matrices?
Add or subtract entry by entry. A + B gives C where C[i][j] = A[i][j] + B[i][j]. Both matrices must have the same dimensions. Matrix addition is commutative (A + B = B + A) and associative.
Matrix Solver by Student Level
Topics here: What a matrix is, reading row and column notation, basic addition and subtraction of 2×2 matrices, and scalar multiplication.
How to use this tool: Start with the Add (A+B) and Scalar Multiply operations on 2×2 matrices. Practice computing by hand, then verify with this solver.
Tip: Write your answer in the same grid format you see in the result to build good matrix notation habits.
Topics here: Matrix multiplication, 2×2 and 3×3 determinants, inverse matrices, solving systems using matrices, and eigenvalues for AP/IB.
How to use this tool: Verify determinant and inverse calculations before submitting. Use the step-by-step display to check where your working diverges from the correct answer.
Tip: For IB Math HL and AP Linear Algebra, eigenvalue questions often appear — use the Eigenvalues tab to practice the characteristic polynomial method.
Topics here: RREF, rank, null space, LU decomposition, cofactor matrix, adjoint, characteristic polynomial, and Frobenius norm — all common in Linear Algebra, Engineering Math, and Numerical Methods.
How to use this tool: Use LU Decomposition and RREF to verify row operations in problem sets. Cross-check eigenvalue calculations before using them in diagonalization or differential equations.
Tip: Always check that rank equals the expected number of pivots. If rank is lower than expected, you likely have a linearly dependent row in your setup.
Using This Matrix Calculator for Assignments
Homework Problems
Work each matrix operation by hand first, then enter your matrix to verify. If results differ, look at the step-by-step output to find exactly where the error occurred — most mistakes happen during cofactor expansion or sign changes in row operations.
Case Studies and Projects
For engineering and applied math projects that require solving Ax = b or analyzing transformation matrices, use this solver to compute inverses, determinants, and LU decompositions. The step-by-step output can be referenced directly in your written report.
Quiz and Exam Preparation
Click Random to load a random matrix problem, solve it on paper, then check. Focus on operations that appear on your upcoming exam — determinants and RREF appear most often on linear algebra tests at every level.
Problem Sets
For long problem sets, verify each matrix result before using it in the next calculation. A wrong inverse in step 1 cascades through every follow-on step. Catching it early saves a lot of time — especially in multi-step LU or eigenvalue problems.
Frequently Asked Questions
- 1. What is a matrix and how is it used in math?
- A matrix is a rectangular array of numbers in rows and columns. It is used to represent systems of linear equations, perform geometric transformations, model networks, and encode data in statistics and machine learning. This matrix solver handles 2×2, 3×3, and 4×4 matrices across 18 different operations.
- 2. How do you calculate the determinant of a 3×3 matrix?
- Expand along the first row. For each element a₁ⱼ, multiply by (−1)^(1+j) and the determinant of the 2×2 submatrix formed by removing row 1 and column j. Sum the three results. This solver shows every cofactor and submatrix determinant step so you can follow along and verify each stage.
- 3. How do you find the inverse of a 3×3 matrix step by step?
- Form the augmented matrix [A | I₃] and apply Gauss-Jordan elimination (row operations) until the left side becomes I₃. The right side is then A⁻¹. If the left side cannot be reduced to I₃ (because det(A) = 0), then A has no inverse. This solver performs all row operations and shows each step.
- 4. How do you multiply matrices correctly?
- To multiply A (m×n) by B (n×p), each entry of the result C[i][j] is the dot product of row i of A and column j of B. The inner dimensions must match: the number of columns in A must equal the number of rows in B. Remember that A×B ≠ B×A in general — matrix multiplication is not commutative.
- 5. What is RREF and how do you use it to solve equations?
- RREF (Reduced Row Echelon Form) is found by Gauss-Jordan elimination. Each pivot is 1 and is the only nonzero entry in its column. To solve Ax = b, form the augmented matrix [A | b], reduce it to RREF, and read off the solution directly. This calculator applies RREF to your matrix and shows every row operation used.
- 6. How do you find eigenvalues and eigenvectors of a 2×2 matrix?
- Set up the characteristic equation det(A − λI) = 0. For a 2×2 matrix [[a,b],[c,d]], this gives λ² − (a+d)λ + (ad−bc) = 0. Solve for λ using the quadratic formula to get the eigenvalues. For each eigenvalue, substitute into (A − λI)v = 0 and solve for the eigenvector v. This solver shows all steps including eigenvector calculation.
- 7. What is LU decomposition and when do you use it?
- LU decomposition factors A into a lower triangular matrix L and upper triangular matrix U so that A = LU. It is used to efficiently solve systems Ax = b (especially when b changes but A stays fixed), compute determinants (det(A) = product of U's diagonal), and in numerical methods for larger systems. This tool shows both L and U matrices with the elimination steps.
- 8. What is the difference between the cofactor matrix and the adjoint?
- The cofactor C[i][j] is (−1)^(i+j) × the minor determinant (the determinant of the submatrix with row i and column j removed). The cofactor matrix collects all these cofactors. The adjoint (adjugate) is the transpose of the cofactor matrix. The relationship A⁻¹ = adj(A) / det(A) connects both to the inverse.
- 9. Can I use this matrix calculator for AP, IB, or college linear algebra?
- Yes. The operations covered here — determinant, inverse, multiplication, RREF, rank, eigenvalues, LU decomposition, cofactor, adjoint, and characteristic polynomial — appear across AP Precalculus, AP Calculus (parametric and transformation problems), IB Mathematics HL, and college-level Linear Algebra, Numerical Methods, and Engineering Mathematics courses.
- 10. What is the matrix norm and what does it measure?
- This solver computes the Frobenius norm: ||A||_F = √(sum of all squared entries). It measures the overall magnitude of a matrix, analogous to the length of a vector. It is used in optimization, numerical analysis, and machine learning (for example, in regularization to control the size of weight matrices in neural networks).