Matrix Calculator - Add, Multiply, Determinant, Inverse

    Perform operations on 2x2 and 3x3 matrices: addition, subtraction, multiplication, transpose, determinant and inverse. Enter elements, pick an operation, get the result with step-by-step explanation.

    Parameters

    Enter data for calculations

    Choose the operation to perform on the matrix

    Choose matrix size (2×2 or 3×3)

    Top-left corner of the matrix

    Top-right corner for 2×2

    Bottom-left corner for 2×2

    Bottom-right corner of the matrix

    Form progress0 / 6 fields

    💡 Fill in all required fields to unlock the calculate button

    Seven matrix operations in one tool

    This calculator handles seven operations on 2x2 and 3x3 matrices: addition, subtraction, matrix multiplication, scalar multiplication, transpose, determinant, and inverse. Pick the operation from the dropdown, fill in the matrix elements, and click Calculate. The result appears as a formatted matrix alongside a plain-language explanation of how the computation was performed. No matrix notation knowledge required - the tool labels every element by row and column.

    Quick start example
    Find the determinant of a 2x2 matrix. Select Determinant (det A), choose size 2x2, enter: a11 = 3, a12 = 7, a21 = 1, a22 = 5. Click Calculate.
    Result: det(A) = 3 x 5 - 7 x 1 = 8
    Since det(A) is not 0, the inverse exists. Switch operation to Inverse matrix (A^-1) with the same values to find it.

    Supported operations

    Operation Input Output Requirement
    Addition (A + B) Two matrices A and B Matrix where each element = A[i][j] + B[i][j] Same dimensions
    Subtraction (A - B) Two matrices A and B Matrix where each element = A[i][j] - B[i][j] Same dimensions
    Multiplication (A x B) Two matrices A and B Matrix where element [i][j] = sum of row i of A times column j of B Columns of A = rows of B
    Scalar multiplication Matrix A and a number Matrix where each element = A[i][j] x scalar None
    Transpose (A^T) Matrix A Matrix where rows become columns and columns become rows None
    Determinant (det A) Square matrix A Single number representing the signed volume scaling factor Square matrix (2x2 or 3x3)
    Inverse (A^-1) Square matrix A Matrix such that A x A^-1 = identity matrix det(A) must not be 0

    The calculator supports both 2x2 and 3x3 matrices. For operations that require two matrices (addition, subtraction, multiplication), fill in Matrix B as well. The explanation field shows which formula was applied and how the result was derived.

    Key formulas reference

    Formula Definition
    det(2x2) a11 x a22 - a12 x a21
    det(3x3) a11(a22*a33 - a23*a32) - a12(a21*a33 - a23*a31) + a13(a21*a32 - a22*a31)
    A^-1 (2x2) (1/det) x [[a22, -a12], [-a21, a11]]
    A^-1 (3x3) (1/det) x transpose of cofactor matrix
    (A x B)[i][j] Sum over k of A[i][k] x B[k][j]

    Practical examples

    Example 1 - solving a system of equations
    The system 2x + 3y = 8, x + 4y = 11 can be written as A*v = b where A = [[2,3],[1,4]], b = [[8],[11]]. Find A^-1: det(A) = 2*4 - 3*1 = 5. Then A^-1 = (1/5)*[[4,-3],[-1,2]] = [[0.8,-0.6],[-0.2,0.4]]. Multiply A^-1 * b to get x = 1, y = 2. Enter A as a 2x2 matrix, select Inverse, and verify.
    Example 2 - rotation matrix
    A 90-degree counterclockwise rotation in 2D is represented by the matrix [[0,-1],[1,0]]. Enter this as matrix A, select Determinant: det = 0*0 - (-1)*1 = 1. The determinant of a rotation matrix is always 1, confirming it preserves area. Select Transpose to get [[0,1],[-1,0]] - the transpose of a rotation matrix equals its inverse.
    Example 3 - image transformation
    Scaling an image by 2x horizontally and 3x vertically uses the matrix [[2,0],[0,3]]. To also apply a shear, multiply by [[1,0.5],[0,1]]. Enter A = [[2,0],[0,3]] and B = [[1,0.5],[0,1]], select Multiplication. The combined transformation matrix is [[2,1],[0,3]].
    Example 4 - checking if a matrix is singular
    The matrix [[1,2],[2,4]] has det = 1*4 - 2*2 = 0. This means the rows are linearly dependent (row 2 is 2 times row 1). The calculator will show "Singular matrix (det = 0). Inverse does not exist." when you try to compute the inverse. This is a fundamental property - only matrices with nonzero determinant have inverses.
    Example 5 - network flow addition
    Two departments report monthly traffic between three servers as 3x3 matrices. Department A: [[10,20,5],[0,15,8],[3,0,12]]. Department B: [[5,10,2],[7,0,4],[1,8,3]]. Adding them gives the total traffic: [[15,30,7],[7,15,12],[4,8,15]]. Select Addition, set both matrices to 3x3, enter the values.
    Example 6 - scalar multiplication for unit conversion
    A matrix of distances in kilometers: [[100,200],[150,300]]. To convert to miles, multiply by the scalar 0.6214. Select Scalar multiplication, enter the matrix and scalar 0.6214. Result: [[62.14, 124.28],[93.21, 186.42]].

    Common properties to remember

    • Matrix multiplication is not commutative: A x B does not equal B x A in general. Order matters.
    • Transpose of a product: (A x B)^T = B^T x A^T. The order reverses.
    • Determinant of a product: det(A x B) = det(A) x det(B).
    • Inverse of a product: (A x B)^-1 = B^-1 x A^-1. Again, the order reverses.
    • A matrix is invertible if and only if its determinant is nonzero.
    • The identity matrix [[1,0],[0,1]] acts as the "1" of matrix multiplication: A x I = I x A = A.

    FAQ

    What is a determinant and why does it matter?
    The determinant is a single number computed from a square matrix. Geometrically, for a 2x2 matrix it represents the signed area of the parallelogram formed by the row vectors. For 3x3, it represents the signed volume of the parallelepiped. If the determinant is zero, the matrix is singular - it squashes space into a lower dimension, and no inverse exists. If the determinant is positive, the transformation preserves orientation; if negative, it reverses it.
    Why can I not multiply a 2x2 matrix by a 3x3 matrix?
    Matrix multiplication A x B requires the number of columns in A to equal the number of rows in B. A 2x2 matrix has 2 columns, and a 3x3 matrix has 3 rows - these do not match, so the product is undefined. The result matrix has dimensions (rows of A) x (columns of B). This calculator uses square matrices of the same size, so both must be either 2x2 or 3x3 for multiplication to work.
    What does it mean when the inverse does not exist?
    A matrix has no inverse when its determinant equals zero. This means the rows (or columns) are linearly dependent - one row can be expressed as a combination of the others. In terms of systems of equations, a singular matrix means the system either has no solution or infinitely many solutions. The calculator shows an error message and keeps the original matrix displayed so you can adjust the values.
    How is the 3x3 determinant calculated?
    The calculator uses Laplace expansion along the first row. It computes: a11 times the 2x2 determinant of the submatrix without row 1 and column 1, minus a12 times the submatrix without row 1 and column 2, plus a13 times the submatrix without row 1 and column 3. This recursive approach breaks a 3x3 determinant into three 2x2 determinants. For larger matrices, LU decomposition would be more efficient, but for 3x3 the direct formula is fast and exact.
    Can I use this for larger matrices (4x4, 5x5)?
    This calculator supports 2x2 and 3x3 matrices only. These sizes cover most textbook linear algebra problems and practical applications like 2D/3D transformations, small systems of equations, and rotation matrices. For larger matrices, you would need a tool that implements Gaussian elimination or LU decomposition, as the direct formula approach becomes computationally expensive beyond 3x3.
    Why does matrix multiplication order matter?
    Matrix multiplication is not commutative because each element of the result depends on an entire row of the first matrix and an entire column of the second. Swapping the matrices changes which rows and columns interact. For example, if A is a rotation and B is a scaling, A x B rotates first then scales, while B x A scales first then rotates - producing different results. The only exception is when one matrix is a scalar multiple of the identity, or both matrices are diagonal.

    Related tools

    Combinations & Permutations Calculator

    Calculate C(n,r), P(n,r) and variations with repetition for any set - Open calculator

    Standard Deviation Calculator

    Compute mean, variance and standard deviation for a dataset - Open calculator

    Quadratic Equation Calculator

    Solve ax^2 + bx + c = 0 with step-by-step discriminant analysis - Open calculator

    Linear Function Calculator

    Analyze y = mx + b with slope, intercepts and graph description - Open calculator

    Percentage Calculator

    Calculate percentages, percentage change and X% of any number - Open calculator

    Similar calculators from this section