{ Matrix Calculator }

// 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.

Matrix A
Size: ×
Matrix B
Size: ×

Result will appear here

Select an operation and click Calculate

HOW TO USE

  1. 01
    Choose Operation

    Select from Add, Subtract, Multiply, Transpose, Determinant, Inverse, or Scalar.

  2. 02
    Enter Matrix Values

    Set the size and fill in your values. Use ⚂ to fill with random integers.

  3. 03
    Calculate

    Click Calculate to see the result with full step-by-step breakdown.

OPERATIONS

Addition A+B Subtraction A−B Multiplication A×B Transpose Aᵀ Determinant det(A) Inverse A⁻¹ Scalar k·A

MATRIX SIZES

  • 📐 2×2 matrices
  • 📐 3×3 matrices
  • 📐 4×4 matrices
  • 📐 Non-square for multiply

WHAT IS THIS?

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.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What matrix sizes are supported?

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.

When does the inverse not exist?

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.

How is the determinant calculated?

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.

What does the Transpose operation do?

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.

Can I use decimal values?

Yes, all input fields accept decimal numbers. Results are displayed with up to 6 significant figures to balance precision and readability.

What is scalar multiplication?

Scalar multiplication multiplies every element of the matrix by a constant value k. For example, 3 × [[1,2],[3,4]] = [[3,6],[9,12]].

Matrix Calculator — Linear Algebra Operations Online

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.

Matrix Addition and Subtraction

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

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.

Transpose

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.

Determinant

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.

Matrix Inverse

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

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.

Practical Applications

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.

Tips for Using This Calculator

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.