Math calculator

Free matrix calculator

Perform 2×2 matrix operations including determinant, multiplication, and inverse — enter matrix values to see the result, updated live, as you type.

InputsLive
Operation
Matrix 1 [a, b; c, d]
a₁
b₁
c₁
d₁
Result
Determinant
-2
det(M₁) = ad − bc = -2
a1
b2
c3
det(M)-2

2×2 matrix operations. det(M) = ad − bc.

Results are estimates. Consult a professional.

How it's calculated

How the matrix calculator works

A matrix is a rectangular array of numbers arranged in rows and columns. This calculator performs the core operations on 2×2 and larger matrices: addition, subtraction, multiplication, determinant, transpose, and inverse. Each operation follows strict linear algebra rules — matrix multiplication, for example, is not commutative (A×B ≠ B×A).

2×2 Determinant: det[[a,b],[c,d]] = ad bc
Matrix multiply: result[i][j] = Σ A[i][k] × B[k][j] (sum over k)
Transpose: A^T[i][j] = A[j][i]
Inverse (2×2): A⁻¹ = (1 ÷ det(A)) × [[d, b], [c, a]]
Strang, G. — Introduction to Linear Algebra (matrix operations reference)
Example

Worked example: determinant and inverse of a 2×2 matrix

Example: A = [[3, 7], [1, −4]]

Find the determinant and inverse of matrix A = [[3, 7], [1, −4]].

det(A) = (3 × 4) (7 × 1) = 12 7 = 19
A⁻¹ = (1 ÷ 19) × [[4, 7], [1, 3]]
A⁻¹ = [[4/19, 7/19], [1/19, 3/19]]
Verify: A × A⁻¹ = [[1, 0], [0, 1]] ✓ (identity matrix)
det = −19
The determinant is −19. The inverse exists and can be used to solve linear systems of the form Ax = b by computing x = A⁻¹b.
Quick reference

Common matrix operations and their rules

Use this reference to identify which operations are valid for your matrix dimensions and what each operation produces.

OperationRequirementResult size
Addition (A + B)A and B same size (m×n)m×n matrix
Subtraction (A − B)A and B same size (m×n)m×n matrix
Scalar multiply (kA)Any matrixSame size as A
Multiply (A × B)Cols of A = rows of B (m×n and n×p)m×p matrix
Transpose (Aᵀ)Any matrix (m×n)n×m matrix
DeterminantSquare matrix only (n×n)Single scalar
Inverse (A⁻¹)Square and det ≠ 0n×n matrix

Source: standard linear algebra conventions. Matrix multiplication requires inner dimensions to match.

Practical tips

Tips for working with matrices

Matrix operations appear across engineering, economics, computer graphics, and data science. These tips help you avoid common errors.

  • Check dimensions before multiplying — A (m×n) times B (n×p) works; A (m×n) times B (p×n) does not. The inner dimensions must match.
  • AB ≠ BA in general — matrix multiplication is not commutative; swapping the order of matrices usually gives a different result.
  • Check the determinant first — before computing an inverse, verify det ≠ 0. A zero determinant means the matrix is singular and has no inverse.
  • Use the inverse to solve linear systems — if Ax = b, then x = A⁻¹b. For large systems, this is less efficient than row reduction (Gaussian elimination), but conceptually clear.
  • Transpose swaps rows and columns — useful in statistics (covariance matrices), physics (rotation transforms), and machine learning (weight matrices in neural networks).
Accuracy & limits

Accuracy and limitations

Calculations are performed using floating-point arithmetic, which introduces rounding errors for irrational or repeating decimals. For very large matrices or ill-conditioned systems (where det is very close to zero), numerical errors can accumulate significantly. Near-singular matrices (|det| close to 0) may produce unstable inverses — small changes in entries produce large changes in the result. For high-precision work or large systems, dedicated linear algebra libraries (LAPACK, NumPy) using stable algorithms such as LU decomposition are recommended.

Glossary

Key terms

A rectangular array of numbers arranged in m rows and n columns, written as an m×n matrix.
A scalar value computed from a square matrix that encodes whether the matrix is invertible and how it scales area or volume. det = 0 means singular (non-invertible).
The matrix that, when multiplied by A, gives the identity matrix. Exists only when det(A) ≠ 0.
The matrix formed by flipping A over its main diagonal — rows become columns and columns become rows.
A square matrix with 1s on the main diagonal and 0s elsewhere. Multiplying any matrix by I leaves it unchanged.
A square matrix with determinant equal to zero. It has no inverse and the linear system it represents has no unique solution.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free matrix calculator

A matrix calculator is a free online tool that helps you 2×2 matrix operations — determinant. Standard linear algebra. It runs entirely in your browser with instant results and no sign-up.
JavaScript double-precision floating-point — accurate to about 15-17 significant digits. For arbitrary precision, use the Big Number calculator.
The statistics calculator computes population variance (divides by n). For sample variance, multiply variance by n/(n-1).

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.