Expert Reviewed
Prof. Emily Rodriguez, Ph.D. MathematicsUpdated June 1, 2026Our Standards →

Last updated:

Matrix Calculator

Perform 2x2 and 3x3 matrix operations including addition, multiplication, determinant, transpose, and inverse.

Back to Math

Matrix Calculator

Ad-FreeAI-Powered

Free online matrix calculator — add, subtract, multiply, find determinant, transpose, and inverse of 2×2 and 3×3 matrices with AI-powered insights.

Enter values above to see results.

About This Calculator

Related Articles

🔢 Matrix Calculator — Complete Guide

m × n
Rows × Columns matrix dimensions
det(A)
Determinant: scalar value of a square matrix
A⁻¹
Inverse matrix: A × A⁻¹ = Identity
Rank
Number of linearly independent rows/columns

Matrix Operations

OperationRequirementResult Size
Addition (A + B)Same dimensions (m×n = m×n)m×n
Subtraction (A − B)Same dimensionsm×n
Multiplication (A × B)Cols(A) = Rows(B): m×k and k×nm×n
Scalar × MatrixAny matrixSame as input
Transpose (Aᵀ)Any matrixn×m (rows/cols swapped)
DeterminantSquare matrix only (n×n)Scalar
Inverse (A⁻¹)Square, non-singular (det ≠ 0)n×n

Frequently Asked Questions

What is a matrix?

A rectangular array of numbers arranged in rows and columns. An m×n matrix has m rows and n columns. Matrices represent systems of equations, transformations, and data in linear algebra.

How is matrix multiplication different from scalar multiplication?

Matrix multiplication is not element-by-element. For A×B, each element [i,j] of the result equals the dot product of row i of A with column j of B. Columns of A must equal rows of B.

What is the determinant and what does it tell you?

The determinant (det or |A|) is a scalar value computed from a square matrix. det=0 means the matrix is singular (non-invertible, represents a degenerate transformation). |det| represents scaling factor of the transformation.

When does an inverse matrix not exist?

When the determinant is 0 (singular matrix). This occurs when rows or columns are linearly dependent — the matrix does not have full rank. Non-square matrices cannot have a standard inverse.

What are eigenvalues and eigenvectors?

For A·v = λ·v: v is an eigenvector (direction unchanged by transformation A) and λ is its eigenvalue (scaling factor). Eigenvalues appear in PCA, differential equations, quantum mechanics, and Google's PageRank algorithm.

Where are matrices used in practice?

Computer graphics (3D transformations, rotations), machine learning (neural networks, PCA), economics (input-output models), quantum mechanics (state representations), and solving systems of linear equations.

Explore All Math Calculators

Reviewed by CalculatorApp.me Math Team

Matrix Calculator — Complete Guide

Addition, multiplication, determinant, inverse, eigenvalues, and linear system solutions.

n×m

Any dimension

det(A)

Determinant

A⁻¹

Inverse matrix

Ax=b

System solver

What Are Matrices?

A matrix is a rectangular array of numbers arranged in rows and columns. An m × n matrix has m rows and n columns. Matrices are the fundamental data structure of linear algebra — they encode linear transformations, systems of equations, graph connections, and data tables. From quantum mechanics to Google's PageRank, matrices are everywhere.

Square matrices (m = n) have special properties: they can have determinants, eigenvalues, and inverses. The identity matrix I has 1s on the diagonal and 0s elsewhere — it acts like the number 1 in multiplication. A matrix is invertible (non-singular) if and only if its determinant ≠ 0.

Matrix multiplication is not commutative (AB ≠ BA in general), which distinguishes it from scalar arithmetic. This non-commutativity has deep implications in physics (quantum mechanics operators) and computer graphics (rotation order matters).

Matrix Operations — Formulas

Addition & Scalar Multiplication
Matrix Addition (same dimensions):
  [A + B]ᵢⱼ = Aᵢⱼ + Bᵢⱼ

Example:
  [1 2]   [5 6]   [6  8]
  [3 4] + [7 8] = [10 12]

Scalar Multiplication:
  [cA]ᵢⱼ = c × Aᵢⱼ

  3 × [1 2] = [3  6]
      [3 4]   [9 12]

Properties:
  A + B = B + A  (commutative)
  c(A + B) = cA + cB
  A + 0 = A  (zero matrix identity)

Addition is element-wise and commutative. Matrices must have identical dimensions. The zero matrix acts as the additive identity.

Matrix Multiplication
C = AB where Cᵢⱼ = Σₖ Aᵢₖ × Bₖⱼ

Dimensions: (m×p)(p×n) → (m×n)
Inner dimensions must match!

[1 2] × [5 6] = [1×5+2×7  1×6+2×8]
[3 4]   [7 8]   [3×5+4×7  3×6+4×8]
                = [19 22]
                  [43 50]

Complexity: O(n³) for n×n matrices
Strassen: O(n^2.807)
Best known: O(n^2.3728...)

AB ≠ BA  (NOT commutative!)
A(BC) = (AB)C  (associative)
AI = IA = A  (identity)

Matrix multiplication is row-by-column dot products. Non-commutativity is fundamental — rotation order in 3D graphics depends on this.

Determinant (2×2 and 3×3)
2×2:
  det[a b] = ad − bc
     [c d]

  det[3 7] = 3×2 − 7×1 = −1
     [1 2]

3×3 (cofactor expansion):
  det[a b c]
     [d e f] = a(ei−fh)−b(di−fg)+c(dh−eg)
     [g h i]

  det[1 2 3]
     [4 5 6] = 1(5·9−6·8)−2(4·9−6·7)
     [7 8 9]   +3(4·8−5·7)
             = 1(−3)−2(−6)+3(−3)
             = −3+12−9 = 0

det=0 → singular (no inverse)
det(AB) = det(A) × det(B)

The determinant tells you if the matrix is invertible (det≠0) and the volume scaling factor of the linear transformation. A zero determinant means the transformation 'squishes' space.

Inverse Matrix
For 2×2:
  A = [a b]  →  A⁻¹ = (1/det) × [ d -b]
      [c d]                       [-c  a]

Example:
  A = [4 7]  det = 4×2−7×3 = −13
      [3 2]

  A⁻¹ = (1/−13) [ 2 -7] = [-2/13  7/13]
                [-3  4]   [ 3/13 -4/13]

Verify: A × A⁻¹ = I
  [4 7] [-2/13  7/13]
  [3 2] [ 3/13 -4/13]
  = [1 0]
    [0 1] ✓

For n×n: use Gauss-Jordan
elimination or adjugate method.

A matrix has an inverse if and only if det(A) ≠ 0. The inverse is crucial for solving systems Ax = b → x = A⁻¹b.

Special Matrix Types

TypePropertyDeterminantInverseExample Use
Identity (I)1s on diagonal, 0s else1ItselfMultiplicative identity
DiagonalNon-zero only on diagonalProduct of diagonalReciprocals on diagonalScaling transforms
SymmetricA = AᵀReal eigenvaluesSymmetric if existsCovariance matrices
OrthogonalAᵀA = I±1= Aᵀ (transpose)Rotation matrices
TriangularZeros above/below diagonalProduct of diagonalBack-substitutionLU decomposition
SparseMostly zero entriesStandard methodsIterative solversNetwork graphs
Positive DefinitexᵀAx > 0 for all x≠0Always > 0Always existsOptimization, ML
Singulardet(A) = 00Does NOT existDependent systems

Real-World Applications

FieldApplicationMatrix TypeScale
Computer Graphics3D rotation, scaling, projection4×4 transformation60fps × millions of vertices
Machine LearningWeight matrices in neural networksm×n dense/sparseGPT-4: billions of parameters
Google PageRankWeb graph adjacency matrixn×n stochastic~200 billion pages
Quantum MechanicsOperators, density matricesn×n HermitianSystem-dependent
Structural EngineeringFinite element analysisLarge sparseMillions of elements
EconomicsInput-output models (Leontief)n×n squareNational economies

History of Matrices

~200 BC

Chinese — The Nine Chapters

The ancient Chinese text 'Jiuzhang Suanshu' used rectangular arrays to solve systems of linear equations via a method equivalent to Gaussian elimination — 2,000 years before Gauss.

1683

Seki Takakazu & Leibniz — Determinants

Japanese mathematician Seki Takakazu and German Gottfried Leibniz independently developed the concept of determinants. Leibniz used them to solve systems of equations, while Seki applied them to geometric problems.

1858

Cayley — Matrix Theory Founded

Arthur Cayley published 'A Memoir on the Theory of Matrices,' defining matrix algebra including addition, multiplication, and inverses. He proved the Cayley-Hamilton theorem: every matrix satisfies its own characteristic equation.

1929

Von Neumann — Quantum Mechanics

John von Neumann formalized quantum mechanics using matrix algebra in his 'Mathematical Foundations of Quantum Mechanics,' establishing matrices as fundamental to physics.

1998

Page & Brin — PageRank Algorithm

Google founders used the dominant eigenvector of a massive web-link matrix to rank pages. This matrix computation — applied to billions of web pages — became one of the most commercially important matrix algorithms in history.

2017

Transformer Architecture — Attention Matrices

Vaswani et al. introduced self-attention via Query-Key-Value matrix multiplications. Every modern large language model (GPT, Claude, Gemini) is fundamentally a massive matrix computation engine.

Key Research & Data

Myths vs. Facts

Matrix multiplication is commutative (AB = BA).

Matrix multiplication is NOT commutative. AB ≠ BA for most matrices. In 3D graphics, rotating then translating gives a different result than translating then rotating. This non-commutativity is fundamental, not a bug.

Every matrix has an inverse.

Only square matrices with det ≠ 0 (non-singular matrices) have inverses. Rectangular matrices and singular square matrices do not. The pseudoinverse (Moore-Penrose) provides a 'best approximation' for non-invertible cases.

Matrices are just for math class — no real applications.

Matrices are the computational backbone of AI/ML (neural network weights), computer graphics (every 3D render), search engines (PageRank), economics (Leontief models), quantum computing, and structural engineering. Modern technology is matrix computation.

Bigger matrices are always harder to work with.

Sparse matrices (mostly zeros) can be enormous yet fast to compute with. A million×million sparse matrix may be handled easily, while a dense 10,000×10,000 matrix is more challenging. Structure matters more than size.

Frequently Asked Questions

What is a matrix determinant used for?
The determinant indicates if a system has a unique solution (det≠0), measures the volume scaling of a linear transformation, and appears in eigenvalue calculations, Cramer's rule, and cross products.
How do I solve a system of linear equations with matrices?
Write the system as Ax = b. If A is invertible, x = A⁻¹b. Practically, use Gaussian elimination (row reduction) to solve — it's more numerically stable and efficient than computing the inverse.
What are eigenvalues and eigenvectors?
For matrix A, if Av = λv (a vector v scaled by λ when multiplied by A), then λ is an eigenvalue and v is an eigenvector. They reveal the fundamental behavior of linear transformations — stretch factors and directions.
Why is matrix multiplication O(n³)?
For n×n matrices, each of the n² entries in the result requires a dot product of n elements = n multiplications. Total: n² × n = n³. Faster algorithms (Strassen: n^2.807) reduce this by clever recursive decomposition.
What is the transpose of a matrix?
Aᵀ swaps rows and columns: (Aᵀ)ᵢⱼ = Aⱼᵢ. A symmetric matrix equals its transpose (A = Aᵀ). Transpose is used in least squares, covariance matrices, and orthogonal projections.
How do GPUs speed up matrix operations?
GPUs have thousands of simple cores that can perform matrix multiplications in parallel. A single GPU can execute trillions of floating-point matrix operations per second (TFLOPS), making them essential for AI training.
What is the rank of a matrix?
Rank is the number of linearly independent rows (or columns). It determines the dimension of the solution space for Ax = b. Full rank means a unique solution; reduced rank means infinite solutions or no solution.
What is LU decomposition?
Factoring A = LU where L is lower-triangular and U is upper-triangular. It allows solving Ax = b via forward then back-substitution, which is more efficient than re-computing Gaussian elimination for multiple b vectors.
How are matrices used in machine learning?
Neural network layers are matrix multiplications: y = σ(Wx + b). Training adjusts weight matrices W via backpropagation (computing gradients — also matrix operations). The entire ML pipeline is linear algebra.
What is the condition number of a matrix?
κ(A) = ||A|| × ||A⁻¹||. It measures sensitivity to numerical errors. A high condition number means small input changes cause large output changes — the matrix is 'ill-conditioned' and results may be unreliable.
What is the Cayley-Hamilton theorem?
Every square matrix satisfies its own characteristic equation. If the characteristic polynomial is p(λ) = det(A − λI), then p(A) = 0 (the zero matrix). This connects eigenvalues to matrix properties.
How do matrices represent graphs?
An adjacency matrix A has Aᵢⱼ = 1 if there's an edge from node i to j, and 0 otherwise. Aⁿ gives the number of paths of length n between nodes. Eigenvalues of the adjacency matrix reveal graph structure.

References

Related Calculators

Explore All Math Calculators

Precision math tools for students, teachers, and professionals — CalculatorApp.me.

Browse Math Calculators →

See Also