Percentages and Math

Matrix Calculator

Type one or two matrices and choose an operation to get an exact result with the steps named.

Your numbers

One row per line, entries separated by spaces or commas. Integers, decimals and fractions such as 1/3 work. Up to 10 by 10.

Result

A x B

2 x 2 matrix

19 22; 43 50

Size
2 x 2

A x B

Col 1Col 2
Row 11922
Row 24350
How this was calculated
  1. A is 2 x 2 and B is 2 x 2, so A x B is 2 x 2.
  2. Entry (i, j) = the sum over k of A(i, k) x B(k, j): row i of A times column j of B.
  • Arithmetic is exact (fractions), so no rounding happens until the result is shown. Decimals are shown to at most 6 places.

Calculated using SumPanda.com · https://sumpanda.com/matrix-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the matrix calculator

  1. Pick an Operation: add, subtract, multiply, scalar multiply, transpose, determinant, inverse, rank, trace or row reduced form.
  2. Type Matrix A with one row per line and the entries separated by spaces or commas. Integers, decimals and fractions such as 1/3 are all accepted, up to 10 by 10.
  3. For adding, subtracting and multiplying, type Matrix B too. For the scalar operation, enter k.
  4. Choose to see results as decimals or fractions. The result appears as a table, with a note on the method below it.

Formula

(A x B)(i, j) = sum over k of A(i, k) x B(k, j)

det of a 2 x 2 matrix [[a, b], [c, d]] = a x d - b x c

inverse of A = the matrix X where A x X = I

To multiply, the number of columns of A must equal the number of rows of B. The inverse exists only for a square matrix with a determinant that is not zero.

Multiplying two 2 x 2 matrices

Let A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]. Entry (1, 1) is 1 x 5 + 2 x 7 = 19, entry (1, 2) is 1 x 6 + 2 x 8 = 22, entry (2, 1) is 3 x 5 + 4 x 7 = 43 and entry (2, 2) is 3 x 6 + 4 x 8 = 50, so A x B = [[19, 22], [43, 50]].

The determinant of A is 1 x 4 - 2 x 3 = -2. For C = [[4, 7], [2, 6]] the determinant is 4 x 6 - 7 x 2 = 10, and the inverse is [[0.6, -0.7], [-0.2, 0.4]], which is [[3/5, -7/10], [-1/5, 2/5]] as fractions.

Exact arithmetic

Every entry is stored as an exact fraction made of two whole numbers of any size, so there is no rounding while the calculation runs. A decimal such as 0.1 is read as one tenth, not as the binary approximation a spreadsheet would use. That is why the inverse of [[4, 7], [2, 6]] shows exactly 0.6 and -0.7 and why a singular matrix is detected reliably, instead of a determinant that is almost, but not exactly, zero.

Results are shown as decimals rounded to six places, or as exact fractions if you choose. Decimals ignore trailing zeros, so 0.5 shows as 0.5. The determinant is found by Gaussian elimination with row swaps, the inverse by Gauss-Jordan elimination on A joined to the identity matrix, and rank as the number of pivot columns after row reduction.

Which operations need which sizes

Add and subtract need two matrices of the same size. Multiply needs the columns of A to equal the rows of B, and the product has the rows of A and the columns of B. Determinant, inverse and trace need a square matrix. Transpose, scalar multiplication, rank and row reduction work on any size. The tool names the problem when sizes do not fit, for example "A has 3 columns but B has 2 rows".

Matrix multiplication is not commutative: A x B and B x A are usually different, and one may exist when the other does not. To solve equations written as a matrix problem, the system of equations solver is more direct, and for arrows in space see the vector calculator.

Limits

Matrices can be up to 10 by 10, and each entry up to 24 characters long. Everything runs in your browser and nothing is uploaded. Complex numbers, symbols such as x and y, and eigenvalues are not supported. For general arithmetic use the scientific calculator, and for logic expressions rather than numbers, the truth table generator lists every case.

Assumptions and limits

  • Entries are real numbers written as integers, decimals or fractions. Scientific notation such as 1e5 is not accepted.
  • Rows are separated by new lines and entries by spaces, commas or semicolons. Every row needs the same number of entries.
  • Results are exact. Decimals are rounded to at most six places only for display.
  • Matrices are limited to 10 rows and 10 columns.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

How do I multiply two matrices?

Make sure the columns of the first equal the rows of the second. Each entry of the product is the sum of the products of a row of the first matrix with a column of the second. The calculator does this and shows the result as a table.

Why does the tool say my matrix is singular?

A singular matrix has a determinant of exactly zero, so it has no inverse. This happens when one row is a multiple or a combination of the others. The tool uses exact fractions, so the answer is not a rounding accident.

What is the rank of a matrix?

The rank is the number of independent rows, found as the number of pivot columns after row reduction. A square matrix has an inverse exactly when its rank equals its size.

Can I enter fractions?

Yes. Write them like 1/3 or -2/5 and mix them with decimals and integers. Choose to show the result as fractions to see exact values.