Home Math & Calculator Tools Matrix Calculator
[M]
Math

Matrix Calculator

Perform matrix operations with step-by-step working: Add, Subtract, Multiply, Transpose, Determinant (2×2 and 3×3 with cofactor expansion), and Inverse (2×2). Supports 2×2 and 3×3 matrices with clean grid inputs and formatted results.

➕ Add & Subtract✖ Multiplydet DeterminantA⁻¹ Inverse
Switch Tool:
🔒 100% Private — All calculations run in your browser. Nothing sent to any server.
Matrix A
+
Matrix B

📖 How to Use the Matrix Calculator

  1. 1
    Enter matrix values

    Click the cells in the matrix grid and type your values. Matrix A is always on the left; Matrix B on the right (for binary operations). Use Tab to move between cells. Select matrix size (2×2 or 3×3) from the dropdown. Decimal values and negative numbers are supported.

  2. 2
    Choose an operation

    Select from: Addition (A+B), Subtraction (A−B), Multiplication (A×B), Transpose (Aᵀ), Determinant (det A), or Inverse (A⁻¹). Incompatible operations (e.g. multiplying non-conformable matrices) are greyed out with an explanation.

  3. 3
    View step-by-step results

    Results are displayed in a formatted matrix grid. For multiplication, each cell's calculation (row × column dot product) is shown. For determinant, the cofactor expansion is shown step by step. For inverse, the adjugate and division by det are shown. Copy the result matrix as text.

💡 Key Reference

PropertyRule
det([[a,b],[c,d]])ad − bc
A×A⁻¹= I (identity)
A×B ≠ B×ANot commutative
(AB)ᵀ= BᵀAᵀ

Frequently Asked Questions

What is matrix multiplication and when is it defined?

Matrix multiplication (A×B) is defined only when the number of columns in A equals the number of rows in B. For an m×n matrix A and n×p matrix B, the product C = A×B is an m×p matrix where each element C[i][j] = Σ A[i][k]×B[k][j] (dot product of row i of A with column j of B). Matrix multiplication is NOT commutative: A×B ≠ B×A in general. It IS associative: (A×B)×C = A×(B×C). These properties are fundamental in linear algebra, computer graphics (transformation matrices), and machine learning (neural network weight matrices).

What is a determinant and what does it represent?

The determinant (det A) is a scalar value computed from a square matrix that encodes important geometric and algebraic properties. For a 2×2 matrix [[a,b],[c,d]], det = ad−bc. Geometrically, |det A| is the scaling factor for area (2D) or volume (3D) when A is applied as a linear transformation. det A = 0 means the matrix is singular (no inverse, transforms space into a lower dimension). det A < 0 means the transformation includes a reflection. det A = 1 means the transformation preserves area/volume.

How is the inverse of a matrix calculated?

For a 2×2 matrix A = [[a,b],[c,d]], the inverse A⁻¹ = (1/det A) × [[d,−b],[−c,a]]. The inverse exists only when det A ≠ 0. For 3×3 matrices, A⁻¹ = (1/det A) × adj(A) where adj(A) is the adjugate (transpose of the cofactor matrix). The matrix inverse is the equivalent of division: A×A⁻¹ = I (identity matrix). Applications include solving systems of linear equations (X = A⁻¹B instead of Gaussian elimination), and in graphics/physics for inverting transformation matrices.

What is the transpose of a matrix?

The transpose of an m×n matrix A, written Aᵀ, is the n×m matrix formed by flipping rows and columns: Aᵀ[i][j] = A[j][i]. For example, if A = [[1,2,3],[4,5,6]], then Aᵀ = [[1,4],[2,5],[3,6]]. Key properties: (Aᵀ)ᵀ = A, (A+B)ᵀ = Aᵀ+Bᵀ, (AB)ᵀ = BᵀAᵀ (note the reversed order). A symmetric matrix satisfies A = Aᵀ. The transpose is used extensively in statistics (covariance matrices), machine learning (gradient computations), and in computing the dot product as aᵀb.

What are some real-world uses of matrices?

Computer graphics: 4×4 transformation matrices encode rotation, scaling, and translation of 3D objects in a single matrix multiplication. Machine learning: neural networks are essentially large matrix multiplications between weight matrices and input vectors. Economics: input-output models (Leontief matrices) analyse interdependence between industries. Cryptography: Hill cipher encrypts text by multiplying a key matrix. Physics: quantum mechanics represents quantum states and operators as matrices. Network analysis: adjacency matrices encode graph connections and can find shortest paths via matrix powers.

Why does order matter in matrix multiplication?

Matrix multiplication is non-commutative because changing the order changes what gets transformed first. Consider rotating then scaling vs scaling then rotating in computer graphics — these produce different results. Algebraically, for A=[[1,2],[3,4]] and B=[[5,6],[7,8]]: AB=[[19,22],[43,50]] but BA=[[23,34],[31,46]]. These are completely different matrices. This is why the order of operations in linear algebra must always be carefully specified, and why the chain rule in calculus for matrix functions follows specific conventions.