Matrix Calculator
Perform matrix calculations quickly with the interactive matrix calculator below. Select an operation, enter the size and values of your matrices, and get instant results along with step-by‑step breakdowns for supported operations.
What Matrix Operations Are Supported?
The calculator covers all fundamental matrix operations:
- Addition and subtraction – combine or subtract two matrices of the same dimensions element‑wise.
- Multiplication – multiply two matrices when the number of columns in the first equals the number of rows in the second; also supports scalar multiplication (multiply all elements by a single number).
- Determinant – compute the scalar value that characterizes a square matrix, essential for solving linear systems.
- Inverse – find the matrix \(A^{-1}\) such that \(A \cdot A^{-1} = I\), provided the determinant is non‑zero.
- Transpose – flip a matrix over its diagonal, turning rows into columns and vice versa.
- Rank – determine the maximum number of linearly independent rows or columns.
- Eigenvalues and eigenvectors – calculate the special scalars and associated vectors for square matrices up to 10×10.
The tool accepts matrix sizes from 2×2 up to 10×10 for most operations. Eigenvalue computations are limited to square matrices of order up to 10.
How to Multiply Matrices – Step by Step
Matrix multiplication is not element‑wise. For two matrices \(A\) (\(m \times n\)) and \(B\) (\(n \times p\)), the product \(C = AB\) has dimensions \(m \times p\), and each entry \(c\_{ij}\) is the dot product of the \(i\)-th row of \(A\) and the \(j\)-th column of \(B\):
\[ c*{ij} = a*{i1}b*{1j} + a*{i2}b*{2j} + \dots + a*{in}b\_{nj} \]Example with 2×2 matrices:
\[ A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix},\quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} \]The product \(C\) computes as:
- \(c\_{11} = (1)(5) + (2)(7) = 5 + 14 = 19\)
- \(c\_{12} = (1)(6) + (2)(8) = 6 + 16 = 22\)
- \(c\_{21} = (3)(5) + (4)(7) = 15 + 28 = 43\)
- \(c\_{22} = (3)(6) + (4)(8) = 18 + 32 = 50\)
Thus \(C = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}\).
The matrix calculator above automatically checks dimension compatibility and can display intermediate dot products for each cell when multiplying matrices up to 10×10.
Calculating the Determinant
The determinant, denoted \(\det(A)\) or \(|A|\), is defined only for square matrices. For a 2×2 matrix:
\[ A = \begin{pmatrix} a & b \\ c & d \end{pmatrix},\quad \det(A) = ad - bc \]For a 3×3 matrix, the determinant is often computed by expansion along a row (Laplace expansion). For example, with
\[ A = \begin{pmatrix} 2 & 3 & 1 \\ 4 & 1 & 2 \\ 3 & 2 & 1 \end{pmatrix} \]expanding along the first row gives:
\[ \det = 2(1\cdot1 - 2\cdot2) - 3(4\cdot1 - 2\cdot3) + 1(4\cdot2 - 1\cdot3) = 2(-3) -3(-2) +5 = -6 +6 +5 = 5 \]The calculator handles determinants up to 10×10 and, for smaller matrices, shows the step‑by‑step cofactor expansion.
Finding the Inverse Matrix
A square matrix \(A\) has an inverse \(A^{-1}\) if and only if \(\det(A) \neq 0\). The inverse satisfies \(A \cdot A^{-1} = A^{-1} \cdot A = I\), the identity matrix.
For 2×2 matrices, the inverse is straightforward:
\[ A^{-1} = \frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix} \]For larger matrices, the calculator uses Gaussian elimination or the adjugate method to compute \(A^{-1}\). If the determinant is zero (the matrix is singular), the tool alerts you that no inverse exists.
Advanced Operations: Transpose, Rank, and Eigenvalues
- Transpose \(A^T\) – swaps rows and columns. The operation is always defined, requiring no special conditions.
- Rank – the number of linearly independent rows or columns. The calculator reduces the matrix to row‑echelon form and counts non‑zero rows, identifying full‑rank and rank‑deficient matrices.
- Eigenvalues \(\lambda\) and eigenvectors – for a square matrix \(A\), an eigenvalue \(\lambda\) and eigenvector \(\mathbf{v}\) satisfy \(A\mathbf{v} = \lambda \mathbf{v}\). The tool finds all real and complex eigenvalues for matrices up to 10×10 using numerical methods and returns corresponding eigenvectors when possible.
Every operation listed above is available directly in the matrix calculator. Choose the desired operation, enter the matrix values, and the result – often with intermediate steps – appears immediately.