Math

Matrix Calculator

Add, subtract and multiply matrices, or find a transpose, determinant or inverse in one workspace.

Exact method explained belowEditable inputs
Matrix workspace
Matrix workspace

One row per line. Choose an operation; dimensions are checked before calculation.

See the method

Enter your matrices

Runs on your device

Matrix result

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter matrix a — one row per line, matrix b — used for add, subtract or multiply, operation.
  2. Select Calculate to view the result.
  3. Check the method and assumptions below before using the result.

Input reference and sample values

Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.

InputFormat and unitsSample
Matrix A — one row per lineKeep the structure and separators shown in the sample. Line breaks are retained in this input.2, 1 1, 3
Matrix B — used for add, subtract or multiplyKeep the structure and separators shown in the sample. Line breaks are retained in this input.1, 0 0, 1
OperationChoose A × B / A + B / A − B / Transpose A / Determinant A / Inverse A.A × B

Result for these sample inputs

2  1
1  3
Result dimensions
2 × 2

Rows are separated by line breaks. Displayed values use ten significant digits.

Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.

The method, explained

Addition and subtraction combine matching entries. Matrix multiplication uses row-column dot products. Transpose swaps rows and columns. Determinant and inverse use elimination with partial pivoting.

A WORKED EXAMPLE

Using matrix a — one row per line = 2, 1 1, 3, matrix b — used for add, subtract or multiply = 1, 0 0, 1, operation = multiply, the result is 2 1 1 3. Change these example inputs to match your task; use the method above to check each step.

What to keep in mind

Real numbers only, up to 10 × 10. Matrix B is ignored for unary operations. Near-singular matrices use a scale-based numerical threshold; floating-point results are approximate. Finite-precision arithmetic is used. Check the domain and the stated convention before using an approximation.

Common questions

How do I enter matrix rows?

Put each row on a separate line or separate rows with semicolons. Within a row, separate numbers with spaces or commas. All rows must have the same number of entries.

Why can an inverse fail?

A singular matrix has no inverse. A nearly singular matrix can amplify rounding error so strongly that this calculator rejects it rather than present an unreliable result.

Methodology maintained by ClarityKit. How these tools are built and checked.