Matrix Calculator

Add, subtract and multiply matrices, and compute the transpose, determinant or inverse of a matrix — up to 6×6, right in your browser.

Rows separated by ";", columns by ",". Example: 1,2;3,4

Leave empty for transpose, determinant or inverse of A.

How is it calculated?

Write each matrix as rows separated by ";" and columns separated by "," (for example "1,2;3,4" is the matrix [[1,2],[3,4]]). Addition and subtraction require both matrices to have the same dimensions; multiplication requires A's number of columns to match B's number of rows. The determinant and inverse only exist for square matrices, and the inverse additionally requires the determinant to be nonzero.

Examples

  • Add two 2×2 matrices

    [[1,2],[3,4]] + [[5,6],[7,8]] = [[6,8],[10,12]].

  • Multiply two 2×2 matrices

    [[1,2],[3,4]] × [[5,6],[7,8]] = [[19,22],[43,50]].

  • Determinant of a 2×2 matrix

    det([[1,2],[3,4]]) = 1×4 − 2×3 = −2.

Input format

Each matrix is written as text: a row's columns are separated by commas, and rows are separated by semicolons. There's no separate size field — it's detected automatically from how many rows and columns you write.

Format examples
MatrixHow to write it
[[1,2],[3,4]] (2×2)1,2;3,4
[[1,2,3]] (1×3, a row vector)1,2,3
[[1],[2],[3]] (3×1, a column vector)1;2;3

Frequently asked questions

Related calculators

We use analytics cookies to understand which calculators are useful. They are never used for advertising. More information in our privacy policy.