Uni-Sine
MathematicsAlgebra

Matrix calculator with steps: multiply, invert, determinant and more

This matrix calculator adds, subtracts, multiplies, transposes and raises matrices to powers, and finds determinants, inverses, reduced row echelon form (RREF) and eigenvalues, for matrices up to 5 by 5. Answers are exact, with fractions instead of rounded decimals, and every step of the working is shown. Pick an operation, type matrix A (and B if it needs one) and read the answer.

It opens on the eigenvalues of a 2 by 2 matrix. Open the full matrix calculator over this page to try your own.

Try it

Matrix Calculator

Multiply, invert and find determinants and eigenvalues

Go to its page

What the matrix calculator does

OperationNeedsWhat you get
A + B, A − BTwo matrices the same sizeThe sum or difference, entry by entry
A × BColumns of A = rows of BThe product, with each entry worked out
PowerA square matrix and a whole number nAⁿ, including negative powers through the inverse
TransposeAny matrixAᵀ, rows turned into columns
DeterminantA square matrixdet A, by formula, cofactors or row reduction
InverseA square matrix with det A ≠ 0A⁻¹, by formula for 2 by 2 or Gauss-Jordan elimination
Row reduceAny matrixRREF, with the rank, nullity and pivot columns
EigenvaluesA square matrixThe characteristic polynomial, eigenvalues and eigenvectors
2×2 transformationA 2 by 2 matrixWhat it does to the plane, drawn on a grid

How to use the matrix calculator

  1. Choose an operation from the chips at the top of the Matrices section.
  2. Set the size of A with the rows and columns buttons, from 1 to 5. For square-only operations there is a single size button.
  3. Type each entry. Whole numbers, decimals and fractions all work: type a slash to make a fraction such as 2/3. New cells start at 0.
  4. If the operation uses B, set its size and fill it in too. For Power, type n in Power, n.
  5. Read the answer, then the working underneath. If something can't be done, such as multiplying a 2 by 3 by a 2 by 3, the calculator says why.
  6. For a quick start, the Examples section loads a ready-made multiplication, inverse, 4 by 4 determinant, row reduction, eigenvalue problem, rotation or shear.

Entries must be numbers or fractions: no letters or square roots. Practice questions on determinants and products, with worked solutions, are under Random problem in the Practice section.

Worked examples you can check in the calculator

Example 1: matrix addition

Add matrices of the same size by adding the entries in matching positions. Writing each matrix row by row, with a semicolon between rows:

\left[3,\ -1;\ 2,\ 4\right] + \left[1,\ 5;\ -2,\ 0\right] = \left[4,\ 4;\ 0,\ 4\right]

The top left entry is 3 + 1 = 4, and so on. Subtraction works the same way. Matrices of different sizes can't be added.

Example 2: multiplying a 2 by 3 and a 3 by 2

To multiply, the number of columns in A must equal the number of rows in B. A 2 by 3 times a 3 by 2 works, and the answer is 2 by 2. Each entry is a row of A times a column of B: multiply matching entries and add.

Take A = [2, 0, 1; 1, 3, −1], a 2 by 3, and B = [1, 2; 0, 1; 4, −1], a 3 by 2:

Entry of ABRow of A × column of BValue
Row 1, column 12 × 1 + 0 × 0 + 1 × 46
Row 1, column 22 × 2 + 0 × 1 + 1 × (−1)3
Row 2, column 11 × 1 + 3 × 0 + (−1) × 4−3
Row 2, column 21 × 2 + 3 × 1 + (−1) × (−1)6

So AB = [6, 3; −3, 6]. The calculator shows a line like these for each entry. The matrix multiplication calculator guide goes through the method in more detail.

Example 3: determinant of a 3 by 3 matrix

Choose Determinant and set A to 3 by 3. The calculator expands along the top row, with signs plus, minus, plus. Each entry multiplies the 2 by 2 determinant left when you cover its row and column.

213
0−14
120
\det A = 2(0 - 8) - 1(0 - 4) + 3(0 + 1) = -16 + 4 + 3 = -9

The determinant is −9. A 2 by 2 determinant is ad − bc. For 4 by 4 and 5 by 5, the calculator row reduces to a triangle and multiplies the diagonal, which is much quicker than cofactors.

Example 4: inverse of a 2 by 2 matrix

For a 2 by 2 matrix, swap the two entries on the main diagonal, change the signs of the other two, and divide by the determinant. For A = [4, 7; 2, 6], det A = 4 × 6 − 7 × 2 = 10, so:

A^{-1} = \frac{1}{10}\left[6,\ -7;\ -2,\ 4\right]
3/5−7/10
−1/52/5

The calculator gives the fractions exactly. For 3 by 3 and bigger it uses Gauss-Jordan elimination, which the inverse matrix calculator guide works through. If the determinant is 0, there is no inverse.

Example 5: solving simultaneous equations with RREF

To solve x + 2y = 5 and 3x − y = 1, write the augmented matrix, with the numbers on the right as a last column, and choose Row reduce:

StepRow 1Row 2
Start1, 2, 53, −1, 1
R2 − 3R11, 2, 50, −7, −14
R2 ÷ (−7)1, 2, 50, 1, 2
R1 − 2R21, 0, 10, 1, 2

The calculator shows each row operation like this. Reading the reduced rows, x = 1 and y = 2. The rank is 2. A rank lower than the number of unknowns means there is no unique solution. For equations typed as equations, the simultaneous equations calculator is quicker.

Example 6: eigenvalues and eigenvectors

The calculator opens on A = [2, 1; 1, 2]. An eigenvector keeps its direction when A acts on it, and the eigenvalue is how much it is stretched. For a 2 by 2 matrix the characteristic polynomial is λ² − (trace)λ + det A. The trace is 2 + 2 = 4 and det A = 3:

\lambda^2 - 4\lambda + 3 = (\lambda - 1)(\lambda - 3) = 0

The eigenvalues are 1 and 3, with eigenvectors (1, −1) and (1, 1). Check: A times (1, 1) is (3, 3), which is 3 times (1, 1). When the polynomial has no simple roots the calculator gives decimals, and it says when eigenvalues are complex.

Example 7: a 2 by 2 transformation

Choose 2×2 transformation and type A = [0, −1; 1, 0]. The calculator draws the grid before and after and names it: a rotation by 90 degrees anticlockwise. It also gives the area scale factor, which is the size of the determinant. The point (3, 1) goes to (−1, 3). It recognises rotations, reflections, enlargements, stretches and shears.

Try one

practice
Pick an answer, then check it.
A is 3 by 2 and B is 2 by 4. Which of these can you work out?

Reading the answers

  • Determinant 0 means the matrix squashes space flat: it has no inverse, and its rows are not independent.
  • The sign of the determinant says whether a transformation flips the plane over (negative) or not (positive).
  • Rank is the number of independent rows. For an n by n matrix, rank n means it has an inverse.
  • Order matters in multiplication. AB and BA are usually different, and one of them may not exist at all.
  • The identity matrix I, 1s down the diagonal and 0s elsewhere, acts like the number 1: AI = IA = A.

Common mistakes

  • Multiplying entry by entry. Matrix multiplication is rows times columns, not matching positions.
  • Checking the wrong sizes. For A × B, the inside numbers must match: (2 by 3)(3 by 2) works, (2 by 3)(2 by 3) doesn't.
  • Swapping the order of a product. A × B and B × A are different calculations.
  • Missing the minus sign in the middle term of a 3 by 3 determinant: the signs go plus, minus, plus.
  • Dividing by a zero determinant. If det A = 0, there is no inverse, so stop.
  • Rounding fractions to decimals part way through row reduction. Keep them as fractions, as the calculator does.

Common questions

What size matrices can the calculator handle?
Up to 5 by 5, any shape within that for operations like multiplying, transposing and row reducing. Determinants, inverses, powers and eigenvalues need a square matrix.
Can I enter fractions and decimals?
Yes. Type a slash to make a fraction, or type a decimal. The answers stay exact, so decimals you type come back as fractions where needed.
Why does the calculator say my matrices can't be multiplied?
The number of columns in the first matrix must equal the number of rows in the second. Check the sizes, or swap the order if the question allows it.
How do I solve a system of equations with this calculator?
Write the coefficients and the right-hand sides as an augmented matrix and choose Row reduce. Each row of the result with a single 1 gives one unknown. You can also multiply the inverse of the coefficient matrix by the column of right-hand sides.
What does RREF mean?
Reduced row echelon form: each row starts with a 1 (its pivot), each pivot is to the right of the one above, and every other entry in a pivot's column is 0. Every matrix has exactly one RREF.
Can it find eigenvectors as well as eigenvalues?
Yes. For each real eigenvalue it solves (A − λI)v = 0 and gives an eigenvector. Complex eigenvalues are shown without real eigenvectors.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Matrix Calculator

    Multiply, invert and find determinants and eigenvalues

    Open the tool
  • Test it

    College Linear Algebra

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · AlgebraInverse matrix calculator: 2x2, 3x3 and up with stepsFind the inverse of a matrix up to 5 by 5 with exact fractions: the 2 by 2 formula, Gauss-Jordan steps for 3 by 3 and bigger, and examples to check.