Math

Matrix Calculator

Perform matrix operations including addition, multiplication, transposition, and determinant calculation. Free online matrix calculator.

Did this calculator help you?

What is Matrix Calculator?

A matrix calculator performs operations on matrices, which are rectangular arrays of numbers arranged in rows and columns. Matrix operations are fundamental to linear algebra and have wide applications in computer graphics, engineering, physics, economics, and data science. Whether you're solving systems of equations, transforming images, or analyzing data, matrices are an essential mathematical tool. Matrices can be added, subtracted, multiplied, and more complex operations like finding determinants, inverses, and transposes can be performed. While manual matrix calculations become tedious with larger matrices, this calculator handles them instantly, making it invaluable for students and professionals working with linear algebra.

When to Use This Calculator

  • Solve systems of linear equations by setting them up as Ax = b and computing x = A⁻¹b
  • Check whether a square matrix is invertible by evaluating its determinant before attempting an inverse
  • Find the transpose or LU factors of a matrix when preparing data or equations for numerical analysis
  • Perform linear transformations such as rotation, scaling, and shear in computer graphics and physics
  • Organize and analyze multi-variable data in statistics, economics, and machine learning
  • Verify linear algebra homework, textbook exercises, and exam practice problems

Steps:

  1. Select the matrix size (2×2, 3×3, or custom).
  2. Enter the values for matrix A.
  3. Enter the values for matrix B (if needed).
  4. Select the operation to perform.
  5. View the result matrix and any intermediate calculations.

Formula

Matrix Addition: [A] + [B] = [aᵢⱼ + bᵢⱼ] (element-wise) Matrix Multiplication: [C]ᵢⱼ = Σ(aᵢₖ × bₖⱼ) Determinant (2×2): |A| = ad - bc Transpose: [Aᵀ]ᵢⱼ = [A]ⱼᵢ (swap rows and columns) Inverse (2×2): A⁻¹ = (1/|A|) × [d -b; -c a]

Use Cases

  • Solving systems of linear equations in algebra
  • Performing transformations in computer graphics
  • Analyzing data in statistics and machine learning
  • Working with electrical circuit analysis in engineering

Key Benefits

  • Matrix addition multiplication inversion instantly
  • Determinants and eigenvalues in seconds
  • Various sizes without manual errors
  • Step-by-step verification

Pro Tips

  • Verify dimensions before multiplication
  • Check determinant before inverse
  • Addition requires identical dimensions

Common Mistakes to Avoid

  • Multiplying in wrong order not commutative
  • Column count must equal row count
  • Only square non-zero determinant invert

Key Terms Explained

Matrix: Rectangular number array
Determinant: Scalar for inverse check
Identity Matrix: Diagonal ones zeros elsewhere
Transpose: Flipped rows and columns

Related Concepts

Example

Multiplying [2 3; 1 4] × [5 1; 2 3]: C₁₁ = 2×5 + 3×2 = 16, C₁₂ = 2×1 + 3×3 = 11, C₂₁ = 1×5 + 4×2 = 13, C₂₂ = 1×1 + 4×3 = 13. Result: [16 11; 13 13].

Interpreting Your Results

A determinant of zero means the matrix is singular: it has no inverse and a related system of equations either has no solution or infinitely many. A non-zero determinant confirms the matrix is invertible and describes how much the transformation scales areas. The inverse, when it exists, gives the solution to Ax = b directly as x = A⁻¹b. The transpose mirrors the matrix across its main diagonal, and the LU factors show the original matrix as a product of a lower and an upper triangular matrix, which is how the solver breaks the problem into quick back-substitution steps.

Frequently Asked Questions

When can two matrices be multiplied?
Two matrices can be multiplied when the number of columns in the first matrix equals the number of rows in the second. An m×n matrix can be multiplied by an n×p matrix, resulting in an m×p matrix.
What does the determinant tell us?
The determinant indicates whether a matrix has an inverse (non-zero determinant = invertible). It also represents the scaling factor of the linear transformation described by the matrix.
How do I add or subtract matrices?
Add or subtract matrices element by element, position by position. Both matrices must have exactly the same dimensions. For example, [1 2; 3 4] + [5 6; 7 8] = [6 8; 10 12], because 1 + 5 = 6, 2 + 6 = 8, 3 + 7 = 10, and 4 + 8 = 12. Subtraction works the same way, subtracting each entry of the second matrix from the corresponding entry of the first.
How do I find the inverse of a 2×2 matrix?
For A = [a b; c d], the inverse is A⁻¹ = (1/|A|) × [d -b; -c a], where |A| = ad - bc is the determinant. For example, A = [2 3; 1 4] has determinant |A| = 2×4 - 3×1 = 5, so A⁻¹ = (1/5) × [4 -3; -1 2] = [0.8 -0.6; -0.2 0.4]. The inverse exists only when the determinant is not zero; a zero determinant means the matrix is singular and has no inverse.
How do I solve a system of linear equations using matrices?
Write the system as Ax = b, where A holds the coefficients, x the unknowns, and b the constants. Then x = A⁻¹b. For x + 2y = 5 and 3x + 4y = 11, A = [1 2; 3 4], b = [5; 11], and A⁻¹ = [-2 1; 1.5 -0.5], giving x = A⁻¹b = [1; 2]. Check: 1 + 2×2 = 5 and 3×1 + 4×2 = 11, so x = 1 and y = 2 are correct.
What is LU decomposition and why is it useful?
LU decomposition factors a matrix A into a lower triangular matrix L times an upper triangular matrix U, so A = LU. For example, A = [4 3; 6 3] factors into L = [1 0; 1.5 1] and U = [4 3; 0 -1.5], since L × U returns [4 3; 6 3]. Triangular systems are fast to solve by back-substitution, so LU decomposition speeds up solving systems, inverting matrices, and computing determinants, especially when the same matrix is reused many times.
What is the identity matrix and what does it do?
The identity matrix I has ones on the main diagonal and zeros everywhere else, such as I₃ = [1 0 0; 0 1 0; 0 0 1]. It is the multiplicative identity for matrices: multiplying any matrix A by the identity leaves it unchanged, so AI = IA = A. It plays the same role for matrix multiplication that the number 1 plays for ordinary multiplication.
How do I compute the determinant of a 3×3 matrix?
Use Laplace (cofactor) expansion along the first row. For A = [1 2 3; 0 1 4; 5 6 0], the determinant is 1×(1×0 - 4×6) - 2×(0×0 - 4×5) + 3×(0×6 - 1×5) = 1×(-24) - 2×(-20) + 3×(-5) = -24 + 40 - 15 = 1. Each term multiplies one first-row entry by the determinant of the 2×2 matrix left after removing its row and column, with signs alternating +, -, +.
What is the difference between a matrix and a determinant?
A matrix is a rectangular array of numbers, such as [1 2; 3 4], and can have any number of rows and columns. A determinant is a single scalar number computed only from a square matrix, written |A|. Every square matrix has exactly one determinant, but the matrix and its determinant are different objects: the matrix is the full grid of values, while the determinant is one number derived from it that signals invertibility and scaling.
What is the transpose of a matrix used for?
The transpose Aᵀ flips a matrix across its main diagonal, turning rows into columns. For [1 2; 3 4], the transpose is [1 3; 2 4]. Transposes are used to convert row vectors into column vectors, to define symmetric matrices (where Aᵀ = A), to compute dot products as Aᵀb, and in physics and statistics, where the transpose of a data matrix aligns variables and observations for analysis.
What is a symmetric matrix?
A symmetric matrix is a square matrix that equals its own transpose, so Aᵀ = A. This means the entry in row i, column j always equals the entry in row j, column i, making the matrix mirrored across the main diagonal. For example, [1 2; 2 3] is symmetric because both off-diagonal entries are 2. Symmetric matrices appear throughout statistics, physics, and machine learning, and they always have real eigenvalues.

Discover More Tools

Fresh picks from across our tool library.