Matrix Calculator
Add, subtract, multiply, transpose, invert, and find determinants of matrices online
Matrix A
Matrix B
A & B Operations
Individual Operations
Scalar Multiply
Free Online Matrix Calculator — Add, Subtract, Multiply, Transpose & Invert Matrices
Matrices are a fundamental part of mathematics, engineering, computer science, machine learning, and data science. Whether you are solving a system of linear equations, performing 3D graphics transformations, working on a machine learning algorithm, or studying linear algebra, you need to be able to perform matrix operations quickly and accurately. This free online Matrix Calculator handles all core matrix operations in your browser — no software installation and no signup required.
Enter values in Matrix A and Matrix B using the input grids. Add or remove rows and columns using the +Row, −Row, +Col, −Col buttons. Use the Quick Size presets (2×2, 3×3, 4×4, 2×3, 3×2) to set both matrices to identity matrices of that size instantly. Then choose from the available operations: add, subtract, or multiply the two matrices together; transpose, find the determinant, or invert each matrix individually; or multiply either matrix by a scalar constant. Results are displayed instantly and can be copied to your clipboard as CSV.
All calculations are performed in your browser using exact floating-point arithmetic with 10-decimal-place rounding for inverse results. No data is uploaded to any server.
Matrix Operations Explained
Matrix Addition (A + B)
Add two matrices of the same dimensions. Each element in the result is the sum of the corresponding elements in A and B. Requirement: A and B must have the same number of rows and columns.
Matrix Subtraction (A − B)
Subtract corresponding elements. Each element of the result is A[i][j] − B[i][j]. Same dimension requirement as addition.
Matrix Multiplication (A × B)
Multiply two matrices together using the dot-product rule. The number of columns in A must equal the number of rows in B. The result has dimensions (rows of A) × (columns of B). This operation is not commutative — A×B ≠ B×A in general.
Transpose (Aᵀ or Bᵀ)
Flip a matrix over its main diagonal. Rows become columns and columns become rows. An m×n matrix transposes to an n×m matrix. Transposing is used in many algorithms including covariance matrix calculation and the normal equation for linear regression.
Determinant (det(A))
A scalar value that represents certain structural properties of a square matrix. If the determinant is 0, the matrix is singular (not invertible). The determinant is used to solve systems of linear equations using Cramer's rule and to check whether a transformation is area/volume-preserving.
Matrix Inverse (A⁻¹)
For a square matrix A, its inverse A⁻¹ satisfies A × A⁻¹ = I (the identity matrix). The inverse exists only if the determinant is non-zero. This calculator uses Gauss-Jordan elimination for numerical stability. Inverses are used to solve linear systems Ax = b as x = A⁻¹b.
Scalar Multiplication (k × A)
Multiply every element in a matrix by a constant scalar k. This scales the matrix without changing its shape or relative proportions between elements.
