🔢

Online Matrix Calculator

Compute matrix addition, multiplication, determinant, inverse, and transpose for 2x2 to 4x4 matrices.

MATHEMATICS

The Online Matrix Calculator helps you perform linear algebra operations on matrices.

Supports addition, subtraction, multiplication, determinant (cofactor expansion), inverse (Gauss-Jordan), and transpose for matrices sized 2x2 up to 4x4.

Matrix Calculator

Calculate matrix operations: addition, subtraction, multiplication, determinant, transpose, and inverse. Sizes 2×2, 3×3, and 4×4.

Matriks A
+
Matriks B

Referensi Operasi Matriks

Penjumlahan & Pengurangan (A ± B)
Hanya dapat dilakukan jika A dan B berukuran sama. Setiap elemen dijumlahkan/dikurangkan pada posisi yang sama: (A±B)ᵢⱼ = aᵢⱼ ± bᵢⱼ.
Perkalian (A × B)
Elemen baris A dikalikan dengan kolom B dan dijumlahkan: (A×B)ᵢⱼ = Σₖ aᵢₖ · bₖⱼ. Perkalian matriks tidak bersifat komutatif (A×B ≠ B×A).
Determinan (det A)
Matriks 2×2: det = ad − bc. Untuk 3×3 dan 4×4 digunakan ekspansi kofaktor. Jika det = 0, matriks disebut singular dan tidak memiliki invers.
Invers (A⁻¹)
Hanya ada jika det(A) ≠ 0. Didefinisikan sebagai A · A⁻¹ = I (matriks identitas). Kalkulator ini menggunakan eliminasi Gauss–Jordan.
Transpose (Aᵀ)
Baris dan kolom ditukar: (Aᵀ)ᵢⱼ = aⱼᵢ. Sifat: (Aᵀ)ᵀ = A, (AB)ᵀ = BᵀAᵀ.
Matriks 2×2: A = [[a,b],[c,d]]
det(A) = ad − bc
A⁻¹ = (1/det) · [[d,−b],[−c,a]]

Calculator information

How to use this calculator

  1. Choose a matrix size (2x2, 3x3, or 4x4) - the number of rows and columns sets the number of input fields.
  2. Fill in matrix A row by row from left to right; use a period for decimals (e.g., 3.14).
  3. For binary operations (addition, subtraction, multiplication), also fill in matrix B with a compatible size.
  4. Pick the operation: A+B, A-B, A×B, det(A), A⁻¹ (inverse), Aᵀ (transpose), or A^n (power).
  5. Press Calculate to view the result plus step-by-step work (e.g., cofactor expansion for the determinant, Gauss-Jordan for the inverse).
  6. Watch for error messages: a singular matrix (det = 0) has no inverse; multiplication requires columns of A = rows of B.
  7. Tip: use the inverse to solve Ax = b via x = A⁻¹b (provided det(A) ≠ 0).

Basic Matrix Operations

det(A) = Σ(-1)^(i+j) × aᵢⱼ × Mᵢⱼ ; A⁻¹ = (1/det A) × adj(A)
  • Mᵢⱼ = minor (determinant of the submatrix without row i and column j)
  • adj(A) = transpose of the cofactor matrix
  • Addition: (A+B)ᵢⱼ = aᵢⱼ + bᵢⱼ
  • Multiplication: (A·B)ᵢⱼ = Σₖ aᵢₖ · bₖⱼ
  • Transpose: (Aᵀ)ᵢⱼ = aⱼᵢ

Gauss-Jordan: the augmented matrix [A | I] is reduced to [I | A⁻¹] using elementary row operations.

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

Given:
  • A = [[4, 7], [2, 6]]
Steps:
  1. det(A) = (4 × 6) - (7 × 2) = 24 - 14 = 10.
  2. adj(A) = [[6, -7], [-2, 4]] (swap the main diagonal, negate the anti-diagonal).
  3. A⁻¹ = (1/10) × [[6, -7], [-2, 4]] = [[0.6, -0.7], [-0.2, 0.4]].
  4. Verify: A × A⁻¹ = [[4×0.6+7×(-0.2), 4×(-0.7)+7×0.4], [2×0.6+6×(-0.2), 2×(-0.7)+6×0.4]] = [[1, 0], [0, 1]].

Result: det(A) = 10; A⁻¹ = [[0.6, -0.7], [-0.2, 0.4]]; identity verified.

Frequently asked questions

When does a matrix have no inverse?
A matrix A is non-invertible (singular) when det(A) = 0. This happens when: (1) one row or column is a linear combination of others, (2) a row or column is all zeros, or (3) rows are duplicated. Geometrically, a singular matrix collapses space to a lower dimension - the mapping cannot be inverted because information is lost. For Ax = b with a singular A, use the Moore-Penrose pseudoinverse.
What is the difference between determinant and trace?
The determinant is a scalar that gives the volume scaling factor of a linear transformation (det = 2 means volumes double). The trace is the sum of the main diagonal entries and equals the sum of the eigenvalues. Both are invariant under change of basis. For a 2×2: det = ad - bc, trace = a + d. det = 0 means a singular matrix; a negative trace (for a symmetric matrix) implies at least one negative eigenvalue.
How are matrices used in the real world?
Applications are widespread: (1) computer graphics - 3D transformations (rotation, translation, scaling); (2) machine learning - tensor operations in neural networks; (3) engineering systems of linear equations (statics, electrical circuits); (4) cryptography - the Hill cipher; (5) econometrics - OLS regression (β = (XᵀX)⁻¹Xᵀy); (6) Google's PageRank - the principal eigenvector of an adjacency matrix. NumPy and MATLAB are built around matrix operations.
What is the fastest method for the determinant of a large matrix?
Cofactor expansion is O(n!) and impractical above 4×4. For large matrices, use LU decomposition: factor A = LU, then det(A) is the product of the diagonal of U. Complexity is O(n³). For symmetric positive-definite matrices, use Cholesky decomposition A = LLᵀ. Numerical libraries like LAPACK and NumPy's linalg automatically pick the optimal algorithm based on matrix structure.
What is an eigenvalue and eigenvector?
An eigenvector v is a non-zero vector that, when multiplied by A, only changes in length (not direction): Av = λv, where λ is the eigenvalue. They are found from the characteristic equation det(A - λI) = 0. Applications: principal component analysis (PCA), stability analysis of dynamical systems, vibration mode analysis, MRI imaging. A 3×3 matrix has at most 3 eigenvalues (real or as complex conjugate pairs).

Last updated: May 11, 2026