Matrix Calculator

The matrix calculator adds, subtracts and multiplies matrices and finds the determinant, inverse, transpose, rank and scalar multiples. Type or paste your matrices — any size, with fractions if you like — and pick an operation. Results are neatly aligned and ready to copy, and everything runs in your browser.

Size rules

OperationRequirement
A + B, A − BSame size
A × BColumns of A = rows of B
det(A), A⁻¹Square matrix
A⁻¹Determinant ≠ 0

When to use it

  1. Check linear algebra homework.
  2. Invert a matrix to solve a system of equations.
  3. Multiply transformation matrices for graphics.
  4. Find whether a matrix is singular.

How to Use

  1. Enter matrix A (and B if needed).
  2. Choose an operation.
  3. Copy the result.

Features

  1. Add, subtract, multiply
  2. Determinant and inverse
  3. Transpose, rank and scalar multiple
  4. Any size
  5. Fractions accepted
  6. 100% client-side

FAQs

How do I multiply two matrices?

Enter A and B and choose A×B. The number of columns in A must equal the number of rows in B.

When does a matrix have an inverse?

Only when it's square and its determinant isn't zero.

How do I enter a matrix?

One row per line with values separated by spaces or commas, or rows separated by semicolons.

Can I use fractions?

Yes. Values like 1/3 are accepted; results are shown as decimals.

Is anything uploaded?

No. It runs in your browser.

Technical Details

Matrices are typed or pasted with values separated by spaces or commas and rows by new lines or semicolons; fractions such as 1/2 are accepted. Addition and subtraction work element by element and require equal sizes; multiplication sums row-by-column products and requires A's column count to equal B's row count, with a clear message when it doesn't. The determinant is found by Gaussian elimination with partial pivoting — the product of the pivots, with the sign flipped for each row swap — which is far faster and more stable than cofactor expansion. The inverse uses Gauss–Jordan elimination on [A | I], and singular matrices (determinant 0) are reported rather than producing infinities. Rank is the number of non-zero pivots after elimination, with a small tolerance for rounding. Results are shown aligned and rounded to 8 significant digits.

Calculators & Converters

Calculators & Converters

  • Prime Number Checker
  • Ratio & Proportion Calculator
  • Roman Numeral Converter
  • Rounding Calculator
  • Scientific Notation Converter
  • Number Sequence Generator
  • Data Size Converter
  • Discount & Sales Tax Calculator