Result will appear here
Select an operation and click Calculate// perform matrix operations with step-by-step results
Perform matrix addition, subtraction, multiplication, transpose, determinant, and inverse with step-by-step solutions. Free browser-based tool.
Result will appear here
Select an operation and click CalculateSelect from Add, Subtract, Multiply, Transpose, Determinant, Inverse, or Scalar.
Set the size and fill in your values. Use ⚂ to fill with random integers.
Click Calculate to see the result with full step-by-step breakdown.
A matrix calculator for performing linear algebra operations. Each result includes step-by-step explanations so you can follow the math and verify your work.
This calculator supports 2×2, 3×3, and 4×4 square matrices for most operations. For multiplication, non-square matrices are supported as long as the number of columns in A equals the number of rows in B.
A matrix inverse only exists when the determinant is non-zero. If det(A) = 0, the matrix is singular and has no inverse. The calculator will display an error in this case.
For 2×2 matrices: det = ad − bc. For 3×3 and 4×4, the calculator uses cofactor expansion along the first row, showing each sub-determinant step.
Transposing a matrix flips it over its main diagonal — rows become columns and columns become rows. An m×n matrix becomes an n×m matrix after transposition.
Yes, all input fields accept decimal numbers. Results are displayed with up to 6 significant figures to balance precision and readability.
Scalar multiplication multiplies every element of the matrix by a constant value k. For example, 3 × [[1,2],[3,4]] = [[3,6],[9,12]].
Matrices are fundamental to linear algebra, computer graphics, machine learning, physics simulations, and countless engineering disciplines. This free online matrix calculator lets you perform all common matrix operations instantly, with step-by-step breakdowns so you can follow the math at every stage.
💡 Looking for premium web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and assets — worth checking out.
Adding or subtracting two matrices requires them to have the same dimensions. The operation is performed element-by-element: each cell (i,j) in the result equals A[i][j] ± B[i][j]. This is one of the simplest matrix operations, but it is the foundation for many more complex calculations like neural network weight updates and image blending.
Matrix multiplication (also called the matrix product) is more complex than element-wise operations. To multiply A (m×n) by B (n×p), the number of columns in A must equal the number of rows in B, producing a result of size m×p. Each element C[i][j] is the dot product of row i from A and column j from B. The step-by-step view in this calculator shows exactly which elements are being multiplied and summed for each output cell.
Matrix multiplication is used extensively in 3D transformations (rotating, scaling, translating objects), neural networks (forward pass computations), and systems of linear equations.
The transpose of a matrix A (written Aᵀ) is formed by flipping the matrix over its main diagonal. Element A[i][j] becomes A[j][i]. A 3×2 matrix becomes a 2×3 matrix after transposing. Transposition is heavily used in linear regression (the normal equation is (AᵀA)⁻¹Aᵀb), covariance matrices, and proving properties of symmetric matrices.
The determinant is a scalar value computed from a square matrix. For a 2×2 matrix [[a,b],[c,d]], the determinant is simply ad − bc. For larger matrices, the calculator uses cofactor (Laplace) expansion, breaking down the calculation into smaller sub-determinants.
The determinant tells you important things: if it's zero, the matrix is singular (non-invertible); if it's non-zero, the matrix is invertible. Geometrically, the absolute value of the determinant represents the scale factor of the linear transformation described by the matrix.
The inverse of a matrix A (written A⁻¹) satisfies A · A⁻¹ = I, where I is the identity matrix. Not every matrix has an inverse — only non-singular matrices (det ≠ 0) are invertible. This calculator computes the inverse using the adjugate method (cofactor matrix transpose divided by the determinant). Matrix inverses are used to solve systems of linear equations, compute regression coefficients, and invert transformations in graphics pipelines.
Scalar multiplication simply multiplies every element of the matrix by a constant k. This is used to scale vectors, adjust learning rates in gradient descent, and normalize data. The result preserves the shape of the matrix while scaling its magnitude.
Matrix operations appear everywhere in computing and science. Computer graphics use 4×4 transformation matrices to represent rotation, translation, scaling, and projection. Machine learning relies on matrix multiplication for every layer of a neural network. Physics simulations use matrices to describe rotational inertia, stress tensors, and covariance. Solving systems of simultaneous equations is equivalent to computing a matrix inverse or using Gaussian elimination.
Use the ⚂ (random) button to quickly populate a matrix with integer values for testing. For multiplication, make sure the number of columns in A matches the number of rows in B. For determinant and inverse operations, only square matrices (same rows and columns) are valid. Decimal inputs are fully supported — useful when working with normalized or measured data.