Utilia

Matrix Calculator

Free matrix calculator up to 6×6 with exact fractions. Find the determinant, inverse, rank, RREF, powers, eigenvalues and products, with every step shown.

Matrix A

Type or paste as text

One row per line, entries separated by spaces, tabs or commas. Copying cells from a spreadsheet works, and so does [[1, 2], [3, 4]].

Matrix B

Type or paste as text

One row per line, entries separated by spaces, tabs or commas. Copying cells from a spreadsheet works, and so does [[1, 2], [3, 4]].

Up to 6 × 6. Entries can be whole numbers, decimals (2.5) or fractions (-3/4); an empty cell counts as 0. Results are exact fractions.

–

    How to use the matrix calculator

    1. Pick an Operation: A + B (addition), A − B (subtraction), A × B (multiplication), k × A (scalar multiple), Transpose of A, Determinant of A, Inverse of A, Rank of A, Reduced row echelon form (RREF) of A, Power Aⁿ, Eigenvalues of A, or the dot and cross products of two vectors.
    2. Set the size of Matrix A with Rows and Columns (from 1 to 6), then type the entries in the grid. Whole numbers, decimals such as 2.5 and fractions such as -3/4 are accepted, and an empty cell counts as 0. Matrix B appears only for operations that need it.
    3. To avoid typing cell by cell, open Type or paste as text, paste the rows (from a spreadsheet, a document or a [[1, 2], [3, 4]] list) and press Fill the grid.
    4. The result updates as you type; Calculate does the same. Swap A and B exchanges the two matrices, Example loads a 3 × 3 example and Clear empties both grids.
    5. Read the result, then open the Step by step list below it to follow the working. Show decimals switches the display from fractions to decimals, Use the result as A lets you chain operations (for example, invert and then multiply), and Copy copies the result as tab-separated rows you can paste into a spreadsheet.

    All arithmetic is done with exact fractions, never with rounded floating-point numbers. The inverse of [[4, 7], [2, 6]] is shown as [[3/5, −7/10], [−1/5, 2/5]], not as 0.6000000001.

    What each operation does

    • Addition and subtraction work entry by entry and need two matrices of the same size.
    • Multiplication A × B needs as many columns in A as rows in B: an m × n matrix times an n × p matrix gives an m × p matrix. Each entry is a row of A times a column of B, and the steps write out every one of these sums, such as c₁₁ = 1 × 5 + 2 × 7 = 19. Remember that A × B and B × A are usually different.
    • Determinant: 2 × 2 matrices use ad − bc, 3 × 3 matrices use cofactor expansion along the first row (with each minor shown), and larger matrices are reduced to triangular form by row operations. The determinant is then the product of the diagonal, with one sign change per row swap.
    • Inverse: Gauss–Jordan elimination on the augmented matrix [A | I]. Each step lists the row operations, such as R2 → R2 − 3R1, with the matrix after them. When the left block becomes the identity, the right block is A⁻¹. If a pivot is missing, the matrix is singular and has no inverse.
    • Rank and RREF: the same elimination on A alone. The rank is the number of pivots, and the steps say which columns hold them.
    • Power Aⁿ uses repeated squaring, so A¹⁰⁰ takes only a handful of multiplications. A⁰ is the identity and negative exponents use the inverse.
    • Dot and cross products treat a single row or a single column as a vector. The cross product needs 3 components.

    Eigenvalues: exact and approximate

    The tool first computes the characteristic polynomial det(λI − A) exactly, with the Faddeev–LeVerrier method. For a 2 × 2 matrix, the eigenvalues come from the quadratic formula and stay exact, including square roots and complex values: [[1, 1], [1, 0]] gives 1/2 ± √5/2. For 3 × 3 matrices and larger, the roots are found numerically with the shifted QR algorithm. Any root that is a simple fraction is then checked exactly in the polynomial and shown without the ≈ sign. The others are approximations, accurate to about 8 significant digits, and are marked ≈. Eigenvectors are not computed.

    Frequently asked questions

    Why is the result shown as a fraction?

    Because it is exact. Matrix inversion and elimination divide by pivots, and decimals would pile up rounding errors. Tick Show decimals if you prefer rounded values to 6 decimal places.

    How do I know if a matrix is invertible?

    A square matrix is invertible when its determinant is not zero, which is the same as having full rank. If you ask for the inverse of a singular matrix, the tool says so and the steps show the column where a pivot is missing.

    Can I paste a matrix from Excel or Google Sheets?

    Yes. Copy the cells, open Type or paste as text, paste and press Fill the grid. Tabs, spaces and commas separate entries, and each line is a row.

    What is the largest matrix I can use?

    Six rows by six columns. For powers, the exponent can go from −100 to 100. If the fractions become too long to display, the tool asks for a smaller exponent.

    Does it solve systems of linear equations?

    The RREF of the augmented matrix gives the solution: put the coefficients and the right-hand side in the same matrix and choose Reduced row echelon form (RREF) of A. For a guided solver with variable names, use the linear system solver.