Skip to content

Matrix Calculator

Free online Matrix Calculator -- perform matrix addition, subtraction, multiplication, transposition, and find determinants and inverses. Supports 2x2 and 3x3 matrices with step-by-step results.

Matrix Calculator: Example Calculation

Using a₁₁ (row 1, col 1): 4, a₁₂ (row 1, col 2): 7, a₂₁ (row 2, col 1): 2, a₂₂ (row 2, col 2): 6:

The estimated Determinant is 10.

Result Value
Determinant 10
Matrix [[4, 7], [2, 6]]

Adjust the values in the calculator above for your own scenario.

Loading calculator

Preparing Matrix Calculator...

Reviewed & Methodology

Every calculator is built using industry-standard formulas, validated against authoritative sources, and reviewed for accuracy against our published methodology. All calculations run privately in your browser - no data is stored or shared.

Last reviewed:

Reviewed by:

Written by:

How to Use the Matrix Calculator

  1. 1. Set matrix dimensions - choose the size of your matrix (e.g., 2x2 or 3x3).
  2. 2. Enter matrix values - fill in each cell of the matrix with your numerical values.
  3. 3. Select an operation - choose addition, subtraction, multiplication, transpose, determinant, or inverse.
  4. 4. Enter the second matrix - for binary operations (add, subtract, multiply), fill in the second matrix.
  5. 5. View the result - the calculated result matrix or scalar value is displayed instantly.

Matrix Calculator

Matrices encode systems of equations, transformations, and datasets into a form that supports exact arithmetic at any scale. This calculator handles the six core operations -- addition, subtraction, multiplication, transpose, determinant, and inverse -- for 2x2 and 3x3 matrices. Enter the values for one or two matrices, select an operation, and see the result immediately with no manual row operations required.

How Matrix Operations Are Calculated

Each operation follows a strict rule based on matrix dimensions:

  • Addition and Subtraction -- matrices must share identical dimensions; each element [i,j] of the result equals A[i,j] plus or minus B[i,j]
  • Multiplication -- A must have as many columns as B has rows; result element [i,j] is the dot product of row i of A and column j of B
  • Transpose -- rows become columns; element [i,j] of A^T equals element [j,i] of A
  • Determinant (2x2) -- for [[a,b],[c,d]], det = ad - bc; a scalar that tells whether the matrix is invertible
  • Inverse -- exists only when det is not zero; for a 2x2 matrix [[a,b],[c,d]], inverse = (1/det) x [[d,-b],[-c,a]]

Worked Examples

Scenario 1 -- Finding an inverse to solve a 2x2 system System: 4x + 7y = 23, 2x + 6y = 18. Coefficient matrix A = [[4,7],[2,6]]. det(A) = (4)(6) - (7)(2) = 24 - 14 = 10. Inverse = (1/10) x [[6,-7],[-2,4]] = [[0.6,-0.7],[-0.2,0.4]]. Solution: X = A^(-1) x [23,18] = [0.6x23 - 0.7x18, -0.2x23 + 0.4x18] = [1.2, 2.6], so x = 1.2 and y = 2.6.

Scenario 2 -- Multiplying two 2x2 matrices for a combined transformation A = [[2,0],[0,3]], B = [[1,4],[2,1]]. Result[1,1] = (2)(1)+(0)(2) = 2. Result[1,2] = (2)(4)+(0)(1) = 8. Result[2,1] = (0)(1)+(3)(2) = 6. Result[2,2] = (0)(4)+(3)(1) = 3. Product = [[2,8],[6,3]]. Note that B x A gives a different result -- matrix multiplication is not commutative.

Scenario 3 -- Checking if a 3x3 matrix is singular before inverting A = [[1,2,3],[4,5,6],[7,8,9]]. Expanding along row 1: det = 1(5x9 - 6x8) - 2(4x9 - 6x7) + 3(4x8 - 5x7) = 1(45-48) - 2(36-42) + 3(32-35) = -3 + 12 - 9 = 0. The matrix is singular -- no inverse exists and the system has no unique solution.

Matrix Operations Reference Table

Operation Input Requirement Output Size Key Formula
Addition A + B A and B same size m x n m x n C[i,j] = A[i,j] + B[i,j]
Subtraction A - B A and B same size m x n m x n C[i,j] = A[i,j] - B[i,j]
Multiply A x B cols(A) = rows(B); A is m x n, B is n x p m x p C[i,j] = sum of A[i,k] x B[k,j]
Transpose A^T Any m x n matrix n x m A^T[i,j] = A[j,i]
Determinant Square matrix (2x2 or 3x3) Scalar 2x2: ad - bc
Inverse A^(-1) Square, det not zero Same as A A^(-1) x A = Identity
Identity 2x2 -- 2x2 [[1,0],[0,1]]
Identity 3x3 -- 3x3 [[1,0,0],[0,1,0],[0,0,1]]
Singular test Any square matrix Yes/No Singular if det = 0
Solution X = A^(-1)B A invertible, B column vector Column vector X = A^(-1) x B

When to Use This Calculator

  • Solving a system of two or three simultaneous linear equations by computing A^(-1) x B
  • Verifying that a coefficient matrix is invertible (det is not zero) before attempting a solution
  • Applying a 2D geometric transformation such as rotation or scaling, then combining two transformations by matrix multiplication
  • Checking whether two transformation matrices commute (A x B == B x A) for a physics or graphics problem
  • Transposing a data matrix to switch between row-vector and column-vector conventions in a statistics or machine learning workflow

Common Mistakes

  1. Reversing the multiplication order -- matrix multiplication is not commutative; A x B and B x A generally give different answers, so always confirm which matrix is applied first
  2. Attempting to invert a singular matrix -- if the determinant equals zero, no inverse exists; the calculator will flag this rather than return a meaningless result
  3. Dimension mismatch in multiplication -- a 2x3 matrix can only multiply a 3x2 or 3xN matrix, never another 2x3; check that the inner dimensions match before multiplying
  4. Sign errors in the 2x2 inverse -- the formula swaps the main diagonal (a and d) and negates the off-diagonal (b and c); a common error is negating the wrong elements

Context and Applications

Matrix operations appear across engineering and data science. In 3D computer graphics, a 4x4 transformation matrix encodes rotation, translation, and scale; multiplying the camera matrix by a model matrix combines both transformations in one step, which is the foundation of OpenGL and WebGL rendering pipelines. In machine learning, a neural network layer is defined by a weight matrix W and a bias vector b; the forward pass computes z = W x input + b as a matrix-vector multiplication. In civil engineering, the stiffness method for structural analysis assembles a global stiffness matrix K from element matrices and solves K x displacement = force for nodal displacements. Economists use input-output matrices (Leontief models) to estimate how a change in one industry's output ripples through the whole economy. PageRank, the algorithm behind early Google search, is the dominant eigenvector of the web's link matrix.

Tips

  1. For 2x2 determinants, the shortcut is clear: multiply the main diagonal (top-left to bottom-right), subtract the anti-diagonal (top-right to bottom-left)
  2. Always verify an inverse by multiplying A x A^(-1) -- the result should be the identity matrix with 1s on the diagonal and 0s elsewhere
  3. If the determinant is very close to zero (such as 0.0001) but not exactly zero, the matrix is near-singular and the inverse will contain very large numbers that amplify numerical errors
  4. For 3x3 systems, cofactor expansion along the row or column with the most zeros saves arithmetic -- choose strategically rather than always expanding along row 1
  5. Matrix addition and subtraction are element-wise and commutative (A + B = B + A), unlike multiplication -- use this when rearranging terms in a derivation
  6. In data science, transposing a matrix is often the first step when converting between row-major and column-major storage or when computing the Gram matrix X^T x X for least squares regression

Frequently Asked Questions

What are the basic matrix operations and their rules?
Matrix addition and subtraction require matrices of the same dimensions and operate element by element: (A+B)[i,j] = A[i,j] + B[i,j]. Matrix multiplication requires that the number of columns in the first matrix equals the number of rows in the second: if A is m x n and B is n x p, the result is m x p. Each element of the product is computed as the dot product of a row from A and a column from B. Importantly, matrix multiplication is not commutative -- A x B does not generally equal B x A.
What is a determinant and what does it tell you?
The determinant is a scalar value computed from a square matrix that indicates whether the matrix is invertible and how it transforms space. For a 2x2 matrix [[a,b],[c,d]], the determinant is ad - bc. If the determinant is zero, the matrix is singular (non-invertible) and the system of equations it represents has no unique solution. Geometrically, the absolute value of the determinant represents the scaling factor of area (2D) or volume (3D) under the transformation described by the matrix.
What is an inverse matrix and when does it exist?
The inverse of a square matrix A (written A^(-1)) is the matrix that satisfies A x A^(-1) = I, where I is the identity matrix. A matrix has an inverse only if its determinant is non-zero. For a 2x2 matrix [[a,b],[c,d]], the inverse is (1/det) x [[d,-b],[-c,a]]. Matrix inverses are used to solve systems of linear equations: if AX = B, then X = A^(-1) x B. This is the matrix equivalent of dividing both sides of an equation by a coefficient.
What are some real-world applications of matrices?
Matrices are used extensively in computer graphics (rotation, scaling, and translation of 3D objects), machine learning (neural network weights and data transformations), economics (input-output models and Markov chains), physics (quantum mechanics state vectors and rotations), engineering (stress analysis and circuit analysis), and data science (representing datasets as matrices for statistical computations). Google's PageRank algorithm is fundamentally a matrix eigenvalue problem.
How do you use matrices to solve a system of linear equations?
Write the system as a matrix equation AX = B, where A is the coefficient matrix, X is the variable vector, and B is the constants vector. For example, the system 2x + 3y = 8 and x - y = 1 becomes [[2,3],[1,-1]] x [[x],[y]] = [[8],[1]]. If A is invertible (determinant is not zero), multiply both sides by A^(-1) to get X = A^(-1) x B. For the example, the determinant is -5, the inverse is [[-1/5,-3/5],[-1/5,2/5]] (negated and swapped), and multiplying by B gives x = 2.2 and y = 1.2.
Embed this calculator

Add this free calculator to your website. Copy the code below and keep the attribution link - it's what keeps these tools free:

Cite this calculator

Copy this citation for papers, articles, or coursework:

Alex Crabinsky. "Matrix Calculator." Numeraty, February 24, 2026, https://numeraty.com/matrix-calculator/

Related Math & Science Calculators

Math & Science

Age Calculator

Free online Age Calculator -- find your exact age in years, months, days, weeks, and total days from your date of birth. Includes next birthday countdown and milestone tracking.

Math & Science

Basic Calculator

Free online Basic Calculator -- perform addition, subtraction, multiplication, division, exponents, and modulo operations. Instant results with up to 10 decimal places of precision.

Math & Science

Binary Hex Decimal Converter

Free online Binary, Hexadecimal, and Decimal Converter -- convert between base-2, base-10, and base-16 number systems instantly. Essential for programming, computer science, and digital electronics.

Math & Science

Date Calculator

Free online Date Calculator -- find the exact number of days, weeks, months, and years between any two dates. Calculate date differences for project planning, contracts, age verification, and event countdowns.

Math & Science

Fraction Calculator

Free online Fraction Calculator -- add, subtract, multiply, and divide fractions with automatic simplification. Shows results as fractions and decimals. Supports mixed numbers and improper fractions.

Math & Science

Fuel Consumption Converter

Free Fuel Consumption Converter -- convert between MPG (US), MPG (UK), L/100km, and km/L. Compare fuel economy ratings across US, UK, and metric systems for any vehicle.

Math & Science

GPA Calculator

Free online GPA Calculator -- compute your grade point average from letter grades and credit hours. Supports weighted and unweighted GPA on a 4.0 scale with instant results.

Math & Science

Grade Calculator

Free online Grade Calculator -- compute your weighted course grade from assignments, exams, and projects. Find out what score you need on your final exam to reach your target grade.

Math & Science

Logarithm Calculator

Free online Logarithm Calculator -- compute common log (base 10), natural log (ln), and logarithms of any base. Includes log rules, formulas, and real-world applications.

Math & Science

Mean Median Mode Calculator

Free online Mean, Median, and Mode Calculator -- enter a data set to instantly compute all three measures of central tendency plus range and count. Includes explanations of when to use each measure.

Math & Science

Percentage Calculator

Free online Percentage Calculator -- find a percentage of a number, calculate percentage increase or decrease, compute percentage change, and determine percentage difference. Instant results with formulas and examples.

Math & Science

Probability Calculator

Free online Probability Calculator -- compute single event probability, combined probability for independent and dependent events, and complementary probability. Includes formulas and practical examples.

Calculators