# Matrix Calculator

> Find the determinant, inverse, rank, trace or transpose of a matrix, or add, subtract and multiply two matrices, with exact fractions.

Category: Algebra, geometry & advanced math · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/matrix-calculator

Type each matrix row on its own line. Arithmetic is done in exact fractions, so an inverse comes out as 13/9 rather than 1.444444.

Also called: Determinant calculator, Inverse matrix calculator, Matrix multiplication calculator.

## Inputs
- Operation (options: Determinant of A, Inverse of A, Rank of A, Trace of A, Transpose of A, A + B, A − B, A × B; default inverse)
- Matrix A (default 2 1
7 4)
- Matrix B (default 1 0
0 1)

## Results
- Result (exact)
- Result (decimal)
- Size of the result

## Formula

```
det and rank by Gaussian elimination;  A⁻¹ by Gauss–Jordan elimination on [A | I];  (AB)ᵢⱼ = Σₖ Aᵢₖ Bₖⱼ
```

Where:
- A, B: the matrices
- I: the identity matrix
- i, j: row and column positions

## Worked example
1. det A = 2 × 4 − 1 × 7 = 1.
2. For a 2 × 2 matrix, swap the diagonal, negate the off-diagonal and divide by det: [4, −1; −7, 2] ÷ 1.
3. Check: [2 1; 7 4] × [4 −1; −7 2] = [1 0; 0 1].

**Result:** The inverse of [2 1; 7 4] is [4 −1; −7 2].

## What the result means

A matrix has an inverse only when its determinant is not zero. The rank is the number of independent rows; a square matrix of full rank is invertible. Results are written row by row, with rows separated by semicolons.

## Assumptions and limits
- Entries are real numbers entered as decimals or fractions.
- Up to 10 × 10. Eigenvalues and decompositions are not covered.

## Questions

### When can I multiply two matrices?

A × B needs the number of columns of A to equal the number of rows of B. An m × n matrix times an n × p matrix gives an m × p matrix, and in general A × B ≠ B × A.

### Why does it say the matrix is singular?

Its determinant is zero: some row is a combination of the others, so the matrix squashes space flat and cannot be undone.

## Related calculators
- [Fraction Calculator](https://calculators.geekmidst.com/calculators/fraction-calculator)
- [Big Number Calculator](https://calculators.geekmidst.com/calculators/big-number-calculator)
- [Distance Calculator](https://calculators.geekmidst.com/calculators/distance-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/matrix-calculator
