Linear algebra calculator for matrices and vectors

Enter a matrix in the linear algebra solver below to find its determinant, inverse, reduced row echelon form, eigenvalues or the solution of a linear system, with the first steps shown right away. Or pick the calculator for your problem, including matrix products and dot and cross products of vectors. Every tool is free, works with 2 × 2, 3 × 3 and larger matrices up to 6 × 6, and keeps answers exact, so an inverse comes out as 32\frac{3}{2} rather than 1.5.

7 calculatorsBy Hira Noor, mathematicianLast reviewed

Linear algebra solver

Matrix A

Choose the size, then type or paste the entries. Whole numbers, decimals and fractions such as 3/4 all work.

Try:

Calculators in Linear Algebra

Matrix Calculator

Multiply, add and subtract matrices up to 6 × 6, plus determinant, inverse, transpose and powers, exactly.

Determinant Calculator

Exact determinants of 2x2 to 6x6 matrices by row reduction or cofactor expansion, with every step.

Inverse Matrix Calculator

Exact inverses of 2x2 to 6x6 matrices by Gauss–Jordan elimination, with every row operation and a check.

RREF Calculator

Reduced row echelon form or REF with each row operation, rank, nullity and linear system solutions.

Cross Product Calculator

a × b with i, j, k determinant steps, magnitude, unit normal, angle and area, plus triple products.

Vector Calculator

Dot product, angle between vectors, magnitude, unit vector and projections of 2D to 6D vectors.

Which linear algebra calculator do I need?

Find your task in the first column. Each Try link opens the calculator with that example already filled in, and the result column shows what it returns.

Linear algebra tasks, an example of each, its result and the calculator to use
TaskExampleResultCalculator
Multiply, add or subtract matrices; transpose, powers, trace[1234][5678]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} Try this product[19224350]\begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}Matrix calculator
Determinant of a square matrixdet⁡[123241312]\det \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 1 \\ 3 & 1 & 2 \end{bmatrix} Try this determinant−25Determinant calculator
Inverse of a square matrix[5342]−1\begin{bmatrix} 5 & 3 \\ 4 & 2 \end{bmatrix}^{-1} Try this inverse[−1322−52]\begin{bmatrix} -1 & \frac{3}{2} \\ 2 & -\frac{5}{2} \end{bmatrix}Inverse matrix calculator
Row reduce (RREF), rank, pivots, null spacerref[2371−11]\operatorname{rref} \begin{bmatrix} 2 & 3 & 7 \\ 1 & -1 & 1 \end{bmatrix} Try this reduction[102011]\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \end{bmatrix}, rank 2RREF calculator
Solve a system of linear equations (Ax = b)2x + 3y = 7, x − y = 1 Try this systemx = 2, y = 1System of equations calculator
Eigenvalues and eigenvectors[5222]\begin{bmatrix} 5 & 2 \\ 2 & 2 \end{bmatrix} Try these eigenvaluesλ = 6 and λ = 1Eigenvalue calculator
Dot product, angle, magnitude, unit vector, projection(1, 2, 2) · (2, −1, 2) Try this angle4, angle ≈ 63.61°Vector calculator
Cross product (i, j, k steps), triple products of 3 vectors(1, 2, 2) × (2, −1, 2) Try this cross product(6, 2, −5)Cross product calculator

The RREF calculator and the system of equations calculator both solve linear systems. Use the system calculator to type equations such as 2x + 3y = 7 directly, for 2 to 4 unknowns. Use the RREF calculator for an augmented matrix with up to 6 equations, or when you also need the rank and null space.

What is linear algebra?

Linear algebra is the branch of mathematics that studies vectors, matrices and systems of linear equations, along with the linear transformations that map one vector space to another. A matrix stores the coefficients of a system or a transformation in a grid, and a vector is an ordered list of numbers, such as a point or a direction in space.

The core questions are the same ones these calculators answer. Does a system have a solution, and is it unique? Row reduction and the rank tell you. Can a transformation be undone? The determinant and the inverse tell you. Which directions does a matrix only stretch? Eigenvalues and eigenvectors tell you.

Every 2 × 2 matrix moves the points of the plane, and the determinant measures how much it scales area. The matrix A=[3112]A = \begin{bmatrix} 3 & 1 \\ 1 & 2 \end{bmatrix} sends the unit square to a parallelogram whose sides are the columns of A, (3, 1) and (1, 2). Its area is |det⁡A|=3⋅2−1⋅1=5|\det A| = 3 \cdot 2 - 1 \cdot 1 = 5.

The unit square and its image under the matrix [[3, 1], [1, 2]]
012300.511.522.533.54xyUnit square (area 1)Image under A (area 5 = |det A|)
The matrix maps the corners (1, 0), (1, 1) and (0, 1) to (3, 1), (4, 3) and (1, 2), so the square of area 1 becomes a parallelogram of area 5.

Linear algebra vs algebra: school algebra solves for single unknowns such as x in 3x + 5 = 20. Linear algebra handles many unknowns at once by writing the equations as one matrix equation, Ax→=b→A\vec{x} = \vec{b}, and it studies the structure of those equations rather than one answer at a time.

What is linear algebra used for?

  • Computer graphics and games: rotating, scaling and projecting 3D scenes onto a screen are matrix multiplications.
  • Machine learning and data science: data sets are stored as matrices, and methods such as linear regression and principal component analysis are built from matrix operations and eigenvectors.
  • Engineering and physics: circuits, structures and vibrating systems lead to large systems of linear equations and eigenvalue problems.
  • Economics and statistics: input-output models, least-squares fitting and Markov chains are written in matrix form.

Worked examples with steps

These are the steps the calculators print for each example. Follow the link under each one to open the same problem, then change the entries to your own.

Determinant of a 3 × 3 matrix by row reduction

Find det⁡A\det A for A=[123241312]A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 1 \\ 3 & 1 & 2 \end{bmatrix}.

  1. Clear column 1

    R2 → R2 − 2R1 gives row 2 = (0, 0, −5), and R3 → R3 − 3R1 gives row 3 = (0, −5, −7). Adding a multiple of one row to another does not change the determinant.

  2. Swap rows 2 and 3

    Row 2 now has a zero where the next pivot should be, so swap R2 ↔ R3. A row swap flips the sign of the determinant.

  3. Multiply the diagonal

    The matrix is now upper triangular with diagonal 1, −5, −5. Their product is 25, and the one swap makes it −25.

Answerdet⁡A=−25\det A = -25. It is not zero, so A has an inverse. Open it in the determinant calculator.

Inverse of a 2 × 2 matrix

Find A−1A^{-1} for A=[5342]A = \begin{bmatrix} 5 & 3 \\ 4 & 2 \end{bmatrix}.

  1. Find the determinant

    ad−bc=5⋅2−3⋅4=−2ad - bc = 5 \cdot 2 - 3 \cdot 4 = -2. It is not zero, so the inverse exists.

  2. Swap and negate

    Swap a and d and change the signs of b and c: [2−3−45]\begin{bmatrix} 2 & -3 \\ -4 & 5 \end{bmatrix}.

  3. Divide by the determinant

    Dividing each entry by −2 gives [−1322−52]\begin{bmatrix} -1 & \frac{3}{2} \\ 2 & -\frac{5}{2} \end{bmatrix}. The calculator confirms this with Gauss–Jordan elimination and checks that AA−1=IAA^{-1} = I.

AnswerA−1=[−1322−52]A^{-1} = \begin{bmatrix} -1 & \frac{3}{2} \\ 2 & -\frac{5}{2} \end{bmatrix}. Open it in the inverse matrix calculator.

Solve a linear system by row reduction

Solve 2x + 3y = 7 and x − y = 1. The augmented matrix is [2371−11]\begin{bmatrix} 2 & 3 & 7 \\ 1 & -1 & 1 \end{bmatrix}, with the constants in the last column.

  1. Make the first pivot 1

    R1 → (1/2)R1 gives row 1 = (1, 3/2, 7/2).

  2. Clear below the pivot

    R2 → R2 − R1 gives row 2 = (0, −5/2, −5/2).

  3. Make the second pivot 1

    R2 → −(2/5)R2 gives row 2 = (0, 1, 1), so y = 1.

  4. Clear above the pivot

    R1 → R1 − (3/2)R2 gives row 1 = (1, 0, 2), so x = 2. The matrix is now in reduced row echelon form.

Answerx = 2 and y = 1, the only solution. Check: 2(2) + 3(1) = 7 and 2 − 1 = 1. Open it in the RREF calculator, or follow the guides to solve a system of two equations or three equations.

Eigenvalues and eigenvectors of a 2 × 2 matrix

Find the eigenvalues of A=[5222]A = \begin{bmatrix} 5 & 2 \\ 2 & 2 \end{bmatrix}.

  1. Write the characteristic polynomial

    det(A−λI)=(5−λ)(2−λ)−4=λ2−7λ+6\det(A - \lambda I) = (5 - \lambda)(2 - \lambda) - 4 = \lambda^2 - 7\lambda + 6.

  2. Find its roots

    It factors as (λ−1)(λ−6)(\lambda - 1)(\lambda - 6), so the eigenvalues are 6 and 1.

  3. Find an eigenvector for each

    For λ = 6, A−6IA - 6I has rows (−1, 2) and (2, −4), which (2, 1) solves. For λ = 1, A−IA - I has rows (4, 2) and (2, 1), which (−1, 2) solves.

  4. Check with the trace and determinant

    The eigenvalues add to 7, the trace 5 + 2, and multiply to 6, the determinant 10 − 4.

Answerλ = 6 with eigenvector (2, 1), and λ = 1 with eigenvector (−1, 2). Open it in the eigenvalue calculator.

Dot product, angle and cross product of two vectors

Take a = (1, 2, 2) and b = (2, −1, 2).

  1. Dot product

    Multiply matching components and add: 1⋅2+2⋅(−1)+2⋅2=41 \cdot 2 + 2 \cdot (-1) + 2 \cdot 2 = 4.

  2. Angle between the vectors

    Both have length 1+4+4=3\sqrt{1 + 4 + 4} = 3, so cos⁡θ=43⋅3=49\cos\theta = \frac{4}{3 \cdot 3} = \frac{4}{9} and θ ≈ 63.61°.

  3. Cross product

    a×b=(2⋅2−2⋅(−1),2⋅2−1⋅2,1⋅(−1)−2⋅2)=(6,2,−5)a \times b = (2 \cdot 2 - 2 \cdot (-1),\ 2 \cdot 2 - 1 \cdot 2,\ 1 \cdot (-1) - 2 \cdot 2) = (6, 2, -5).

  4. Check it is perpendicular

    (6, 2, −5) · a = 6 + 4 − 10 = 0 and (6, 2, −5) · b = 12 − 2 − 10 = 0, as a cross product must be.

Answera · b = 4, θ ≈ 63.61° and a × b = (6, 2, −5). Open the angle in the vector calculator or the cross product with its i, j, k steps.

Linear algebra formulas quick reference

Common linear algebra formulas with an example of each
FormulaRuleExample
2 × 2 determinantdet⁡[abcd]=ad−bc\det \begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc5⋅4−2⋅3=145 \cdot 4 - 2 \cdot 3 = 14
2 × 2 inverse1ad−bc[d−b−ca]\frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}, when ad−bc≠0ad - bc \ne 0See the worked example above
Matrix productEntry (i, j) of AB is row i of A times column j of B(1, 2) · (5, 7) = 19
Product rule for determinantsdet(AB)=det⁡A⋅det⁡B\det(AB) = \det A \cdot \det Bdet(A−1)=1/det⁡A\det(A^{-1}) = 1/\det A
Dot producta⋅b=a1b1+a2b2+⋯+anbna \cdot b = a_1 b_1 + a_2 b_2 + \cdots + a_n b_n(1, 2, 2) · (2, −1, 2) = 4
Angle between vectorscos⁡θ=a⋅b|a||b|\cos\theta = \frac{a \cdot b}{|a|\,|b|}cos⁡θ=4/9\cos\theta = 4/9, θ ≈ 63.61°
Characteristic polynomialdet(A−λI)=0\det(A - \lambda I) = 0; its roots are the eigenvaluesλ2−7λ+6=0\lambda^2 - 7\lambda + 6 = 0
Rank–nullity theoremrank + nullity = number of columnsRank 2 + nullity 1 = 3 columns

What these calculators do not cover yet

Matrix entries must be real numbers: whole numbers, decimals or fractions. There are no LU, QR or singular value decompositions, no Gram–Schmidt process and no dedicated Cramer’s rule tool yet. Eigenvalues are limited to 4 × 4 matrices, and the vector calculator accepts decimals but not fractions (the cross product calculator takes both). For how to type matrices and vectors, see how to enter a matrix in a calculator, and for how results are tested, see the methodology.

About these calculators

Every matrix entry you type, including decimals such as 0.25, is stored as an exact fraction. Results stay exact, with no rounding errors building up through row operations, and each one also shows its decimal value. Exact vs decimal answers explains why that matters.

You can paste a block of numbers copied from a spreadsheet straight into the grid. Rows and columns are detected from line breaks and tabs, and fractions such as 3/4 or mixed numbers such as 1 1/2 are accepted.

All of these linear algebra calculators are free, need no account and run in your browser, with every step shown and nothing locked. Results are checked against reference values by automated tests.

Frequently asked questions

Is this linear algebra calculator free, and does it show steps?

Yes. Every calculator here is free, needs no account and shows its working right away: each row operation for RREF and inverses, the expansion or elimination for determinants, the characteristic polynomial for eigenvalues and the component formula for vectors.

What size matrices are supported?

Up to 6 × 6 for products, determinants and inverses, and up to 6 × 7 for row reduction, so a system of 6 equations in 6 unknowns fits with its column of constants. Eigenvalues are supported up to 4 × 4, and vectors can have 2 to 6 components.

Can it solve a system of linear equations?

Yes. Type the equations into the system of equations calculator for 2 to 4 unknowns, or enter the augmented matrix into the RREF calculator for up to 6 equations. Both say whether there is one solution, none or infinitely many, and give the general solution when there are infinitely many.

Why are my answers fractions?

Decimals are converted to exact fractions before calculating, which stops rounding errors from building up over many row operations. Each result also shows a decimal version to 10 significant digits.

How do I enter a matrix?

Choose the number of rows and columns above the grid, then type one entry per cell and move with the arrow keys or Enter. Entries can be whole numbers, decimals or fractions such as -5/2, or you can paste a block from a spreadsheet. How to enter a matrix in a calculator has the full details, including TI-84 and Casio steps.

Can these calculators find complex eigenvalues?

Yes. A real matrix can have complex eigenvalues, and the eigenvalue calculator gives them exactly in the form a + bi, in conjugate pairs. The matrix entries themselves must be real.

Is linear algebra harder than calculus?

It depends on the student. Linear algebra involves less algebraic manipulation than calculus but more abstract ideas, such as vector spaces, span and linear independence, and many courses expect short proofs. Working small examples by hand and checking each step with a calculator is a good way to build intuition for both.