ToolSphere

Matrix Calculator

Student tools

Find a matrix inverse, determinant or RREF with exact fractions and step-by-step work. Includes cofactor expansion, row reduction and matrix arithmetic.

Inverse A = A⁻¹

-21
3/2-1/2

Exact fractions; no decimal rounding.

Enter integers, decimals or fractions such as 1/3. A and B share dimensions; rectangular multiplication requires compatible rows and columns.

Matrix A
Matrix B (only for add/multiply)

Work shown

Reduce [A | I] to [I | A⁻¹]. The vertical line separates the two blocks.

0. Start

1210
3401

1. R2 ← R2 − (3) × R1

1210
0-2-31

2. R2 ← (-1/2) × R2

1210
013/2-1/2

3. R1 ← R1 − (2) × R2

10-21
013/2-1/2

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use Matrix Calculator

  1. 1Read the loaded inverse example, or choose one to four rows and columns for your own matrix.
  2. 2Enter integers, decimals or fractions in A. Only addition and multiplication require B.
  3. 3Choose Inverse A, RREF A or a determinant method and Determinant A. Square matrices are required for inverse and determinant.
  4. 4Read the exact answer first, then follow every row operation or cofactor contribution under Work shown.
  5. 5After editing, choose an operation again. Enter 0 explicitly instead of leaving a required cell blank.

About Matrix Calculator

Exact matrix calculations with work shown

Use this matrix calculator to check homework in an introductory US linear algebra course. It finds an inverse with Gauss-Jordan elimination, calculates a determinant by row reduction or cofactor expansion, and produces reduced row echelon form, or RREF. Addition, multiplication and transpose remain available. The loaded example already shows an actual inverse, so you can compare an answer before entering your own problem.

Choose the number of rows and columns, then enter matrix A row by row. Both grids share those dimensions. Each dimension can run from one through four. Inverse and determinant require square matrices; RREF and transpose also accept rectangular matrices. Matrix B is needed only for addition and multiplication. Because both grids share dimensions, use square grids for multiplication here. For a general system of equations, the separate linear system solver may fit your assignment better.

Enter fractions without rounding

Entries accept signed integers, finite decimals, scientific notation and fractions written with a slash. For example, entering 1/3 keeps that rational value through every operation. Decimal text is converted exactly to a fraction before calculation. The calculator uses BigInt numerators and denominators and reduces each fraction to lowest terms. It never converts the answer to a rounded decimal display.

Enter an explicit zero for a zero entry. A blank required cell is missing input and causes a correction message when you calculate. A fraction cannot have a zero denominator. Each entry is limited to 100 characters, and scientific notation exponents must be between negative 100 and positive 100. These limits keep classroom calculations manageable in a browser. Irrational constants, complex numbers and symbolic variables are outside this tool's scope.

Worked example: inverse by Gauss-Jordan elimination

The loaded matrix is A = [[1,2],[3,4]]. Its inverse is [[−2,1],[3/2,−1/2]]. These results and the steps below were computed by running the same exact arithmetic library used by the page. The second grid starts at B = [[5,6],[7,8]].

To find the inverse, append the identity matrix to A, giving [A | I]. Subtract three times the first row from the second row. The second row of the augmented matrix becomes [0,−2,−3,1]. Multiply that row by −1/2 to get [0,1,3/2,−1/2]. Finally, subtract twice the second row from the first row. The left block becomes the identity and the right block is the inverse printed above.

Every displayed row operation applies to the entire augmented row, including the identity block. The vertical separator distinguishes the original coefficient columns from the appended columns. To verify your answer independently, enter the inverse into B and multiply A by B. The product should be the identity. Keep fractions as fractions when copying; replacing them with short decimals changes the problem.

Determinants by two methods

For the loaded matrix, both determinant methods give −2. Cofactor expansion along the first row calculates +(1) × (4) and −(2) × (3), then adds the contributions. The output names the row and column removed for each minor and shows the recursive minor determinants. The alternating signs belong to the cofactor expansion and must be retained even when an entry is negative.

Row reduction instead subtracts three times the first row from the second. The resulting triangular matrix has diagonal entries 1 and −2. Their product is −2. Row replacements preserve the determinant. Every row interchange changes its sign, and the calculator tracks that sign separately. This determinant procedure does not scale pivot rows, which avoids an extra scaling correction. The displayed final expression includes the diagonal product and the row-swap sign.

RREF, pivots and singular matrices

RREF uses elementary row operations to make each pivot equal to one and clear its column above and below. Zero rows end up below pivot rows. The calculator reports rank as the number of pivots and shows the starting matrix followed by a new matrix after every swap, scaling or row replacement. A matrix already in RREF may need no operations beyond the starting snapshot.

For the loaded nonsingular square matrix, RREF is the identity. For A = [[1,2],[2,4]], the RREF is [[1,2],[0,0]] and the rank is one. Its dependent rows prevent the left block of [A | I] from becoming the identity. The inverse operation therefore reports that no inverse exists and keeps the elimination steps available for inspection. A zero determinant is a valid mathematical result, not an input error.

Check the operation and input order

Addition combines matching entries. With the loaded matrices it gives [[6,8],[10,12]]. Multiplication uses row-column dot products and gives [[19,22],[43,50]]. Transpose exchanges rows and columns, giving [[1,3],[2,4]] for A. Matrix multiplication generally depends on operand order; the multiply button always calculates A times B.

Editing a grid, changing dimensions or changing the determinant method clears the previous answer. Choose an operation again to calculate from the new inputs. Load example restores the original grids and inverse result. Compare the displayed operations with your written work when preparing for a midterm or final exam. For individual scalar checks, use the scientific calculator.

Guides and tutorials

Frequently asked questions

Can this calculator find a matrix inverse?

Yes. It reduces [A | I] with exact Gauss-Jordan row operations and shows the inverse when the left block becomes the identity. Singular matrices have no inverse.

What sizes are supported?

Each grid supports one through four rows and columns. Inverse and determinant require a square matrix. RREF and transpose also work on rectangular matrices.

Are fractions exact?

Yes. Integer, decimal and fraction text is converted to reduced BigInt rational values. Results and intermediate matrices use exact fractions without decimal rounding.

How do I choose a determinant method?

Select Row reduction or Cofactor expansion, then press Determinant A. Row reduction shows matrices after row operations; cofactor expansion shows signed terms and minor determinants.

Does RREF show every row operation?

Yes. Each swap, scaling and row replacement has a label and a complete matrix snapshot. Rank is the number of pivots.

What does a zero determinant mean?

A square matrix with zero determinant is singular and has no inverse. Its RREF has fewer pivots than rows.

Can I enter decimals or scientific notation?

Yes. Finite decimal text and scientific notation are interpreted exactly. Entries have a 100-character limit and scientific notation exponents range from -100 to 100. Complex numbers and symbolic expressions are unsupported.

When is matrix B required?

Only addition and multiplication use B. Both grids share dimensions, so multiplication in this interface requires square grids. The button calculates A times B.

Why did my answer disappear after an edit?

Edits clear the old result so it cannot be mistaken for the answer to the new matrix. Choose an operation again after changing values, dimensions or the determinant method.

Can I use a blank cell for zero?

No. Enter 0 explicitly. Required blank cells, malformed fractions and zero denominators produce a correction message.

Have a suggestion for Matrix Calculator?Share your feedback ↗