How to use the matrix calculator
- Type or paste Matrix A and Matrix B, one row per line with the values separated by spaces or commas. Fractions such as 1/2, decimals and negatives all work, and so do brackets like
[[1,2],[3,4]]. The limit is 10×10. - For two matrices, press A + B, A - B, A × B or B × A. For one matrix, pick Matrix A or Matrix B, then Determinant, Inverse, Transpose, Rank or Row reduce (RREF). The Scalar k and Power n fields feed the two buttons beside them.
- The answer updates as you edit. Choose Decimals or Fractions next to Show values as.
- Press Copy result to paste into a spreadsheet, or Use as Matrix A to chain the result into the next step.
How each operation works
- Add and subtract work entry by entry, so both matrices must be the same size.
- Multiply pairs each row of A with each column of B: entry (i, j) is the sum of A(i, k) × B(k, j). The columns of A must equal the rows of B.
- Determinant uses Gaussian elimination: multiply the pivots and flip the sign for each row swap. For 2×2 it is
ad - bc. - Inverse row-reduces [A | I] with Gauss-Jordan elimination. It exists only when the determinant is not 0.
- Rank counts the nonzero rows left after row reduction.
All arithmetic uses exact fractions, so a determinant of 0 really is 0, not "close to zero". See matrix multiplication, determinants and matrix inverses for the theory.
Worked example with the default matrices
With A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], the tool shows A × B:
- 1×5 + 2×7 = 19 and 1×6 + 2×8 = 22
- 3×5 + 4×7 = 43 and 3×6 + 4×8 = 50
- Result: [[19, 22], [43, 50]]
Now pick Matrix A and press Determinant: 1×4 - 2×3 = -2. Press Inverse to get 1 ÷ (-2) × [[4, -2], [-3, 1]] = [[-2, 1], [1.5, -0.5]], which Fractions shows as -2, 1, 3/2 and -1/2.
Limits and edge cases
- Mismatched sizes give a message such as "A has 3 columns but B has 2 rows" instead of a wrong answer.
- Determinant, inverse and power need a square matrix. A matrix with determinant 0, such as [[1, 2], [2, 4]], has no inverse and the tool says so.
- Commas separate values, so write 1.5, not 1,5. Powers run from -10 to 10, and negative powers use the inverse.
- Decimals mode rounds to 10 significant digits and says so. Fractions are always exact.
For single-fraction arithmetic use the fraction calculator, and for another common algebra step try the quadratic equation solver.
Frequently asked questions
How do I enter a matrix?
Put one row on each line and separate the values with spaces or commas. For a 2×2 matrix type 1 2, press Enter, then type 3 4. Brackets and semicolons between rows also work.
When does a matrix have no inverse?
When its determinant is 0, which happens when one row is a combination of the others. For [[1, 2], [2, 4]] the determinant is 1×4 - 2×2 = 0, so the matrix is singular.
Can I multiply a 2×3 matrix by a 3×2 matrix?
Yes. The first matrix has 3 columns and the second has 3 rows, so the product exists and is 2×2. A 2×3 matrix times another 2×3 matrix is undefined.
Why is A × B different from B × A?
Matrix multiplication is not commutative. With the default matrices, A × B is [[19, 22], [43, 50]] but B × A is [[23, 34], [31, 46]].
What is the determinant used for?
It tells you whether a matrix is invertible (nonzero) and how much it scales area or volume. For a 2×2 matrix, its absolute value is the area of the parallelogram formed by the columns.
Sources: Wolfram MathWorld, Matrix Multiplication; Wolfram MathWorld, Determinant; Wolfram MathWorld, Matrix Inverse; MIT OpenCourseWare 18.06 Linear Algebra.