Matrix Calculator

Calculate matrix inverse, determinant, multiplication, power, rank, RREF, LU, QR and eigenvalues online, with exact fractions such as 1/3 instead of rounded decimals. Type or paste matrices into spreadsheet grids straight from Excel or Google Sheets, solve AX = B, and copy or download the result.

About this tool

What does the Matrix Calculator do?

Enter one or two matrices in spreadsheet-style grids and pick an operation. The result appears immediately as another grid that you can copy back into Excel, reuse as the next input, or download as CSV. Calculations are exact by default: the inverse of [[2, 1], [1, 3]] is shown as 3/5, -1/5, -1/5, 2/5, not 0.6, -0.2, … with rounding errors.

How to use

  1. Enter Matrix A (and Matrix B for operations that need two matrices). Click a cell and type, or copy a range in Excel or Google Sheets and paste it with Ctrl+V / Cmd+V. The grid grows automatically.
  2. Choose an operation, for example A⁻¹, det(A) or A × B.
  3. Choose Fraction for exact results or Decimal with the number of digits you need.
  4. Use Copy to paste the result into a spreadsheet, Use as A / Use as B to chain calculations, or CSV to download it.

The matrix is read from A1 to the last filled row and column, and empty cells inside it count as 0, so sparse matrices are quick to enter. Numbers can be integers, decimals (-0.25), fractions (2/3) or exponents (1.5e-3).

Operations

OperationWhat it calculates
A + B, A − BElement-wise sum and difference of two matrices of the same size
A × B, B × AMatrix product (the number of columns of the left matrix must equal the rows of the right one)
A ∘ BHadamard (element-wise) product
A ⊗ BKronecker product
Solve AX = BSolution of the linear system, X = A⁻¹B, for a square, non-singular A; B can have several columns
det(A)Determinant
A⁻¹Inverse matrix
AᵀTranspose
AⁿInteger power; negative n uses the inverse, and n = 0 gives the identity
k·AMultiplication by a scalar k (fractions allowed)
tr(A)Trace (sum of the diagonal)
rank(A)Rank
RREF(A)Reduced row echelon form, with the pivot columns
LULU decomposition with partial pivoting, PA = LU
QRQR decomposition, A = QR
EigenvaluesEigenvalues (real or complex) and eigenvectors
A⁺Moore–Penrose pseudo-inverse, also for singular and non-square matrices

QR, eigenvalues and the pseudo-inverse generally involve square roots, so they are always calculated with decimals.

FAQ

How do I find the inverse of a matrix?

Enter the matrix as Matrix A and choose A⁻¹. If the determinant is 0, the matrix is singular and has no inverse; the calculator says so and you can use the pseudo-inverse A⁺ instead.

How do I solve a system of linear equations?

Write the coefficients as Matrix A and the right-hand side as a single column in Matrix B, then choose Solve AX = B. For example, 2x + y = 1 and x + 3y = 2 give A = [[2, 1], [1, 3]], B = [[1], [2]] and the solution x = 1/5, y = 3/5. If A is singular, use RREF on the augmented matrix to see whether there are no solutions or infinitely many.

Why are the results fractions?

Fraction mode calculates with exact rational numbers, so results such as 1/3 are not rounded. Switch to Decimal to see decimal numbers.

Can I paste a matrix from Excel?

Yes. Copy the cells in Excel, Google Sheets or Numbers, click A1 of the grid and paste. The result can be copied back the same way.

Is there a size limit?

There is no fixed limit, but exact calculations on large matrices (for example 30 × 30 and larger) can take a while; use Decimal mode for big matrices.

📐 Math Notebook
An online math notebook where every line is typeset like a textbook: write expressions, variables and functions, and see exact fractions, matrices, units and complex numbers as beautiful formulas.
📈 Graph Plotter
Plot functions and equations online: y = f(x), curves such as x^2 + y^2 = 9, and functions you define, with automatic sliders for parameters like a and b.
📏 Area Calculator
Convert area between square meters, square feet, acres, hectares, square miles and more. Enter a value in any unit and all the others update instantly.
🔢 Base Number Converter
Convert integers between binary, octal, decimal and hexadecimal, plus Base26, Base36 and Base62. Type in any base and all the others update instantly.
💻 Byte Calculator
Convert data sizes between bits, bytes, KB, MB, GB, TB and up to YB, including binary units (KiB, MiB, GiB, TiB) and bit units (kbit, Mbit, Gbit).
✓ Check Digit Validator & Generator
Validate or calculate check digits with Luhn (mod 10), Verhoeff, Damm, ISBN-10, ISBN-13, EAN-13 (JAN), UPC-A, Modulus 10 and Modulus 11 (weights 2-7).