Matrix Calculator

Free online matrix calculator with steps — add, subtract, multiply, scale, transpose, and find the determinant, inverse, or trace of a matrix instantly in your browser. No login, no upload.

Build your matrices

Edit either matrix, then choose the operation b/w the Matrices.

Matrix A

Rows
Cols
Add

Matrix B

Rows
Cols
Matrix A and Matrix B must have the same number of rows and columns.

The result already updates live. This button takes you directly to the complete result and steps.

Result

About the Matrix Calculator

Use this browser-based matrix calculator to add, subtract, multiply, scale, transpose, or analyze matrices. Results and calculation steps update live as you edit the values. Once you have your solution, you can easily export it as a PDF or CSV file. You can also copy the output directly to LaTeX to seamlessly include it in your math assignments or research papers.

What is a matrix?

In mathematics, a matrix is a rectangular array or table of numbers, symbols, or expressions, arranged in rows and columns. Matrices are widely used in linear algebra to represent linear transformations and solve systems of linear equations.

Where matrices are used

Matrices are fundamental in computer graphics for 3D transformations, in engineering for structural analysis, in physics for quantum mechanics, and in statistics and data science for handling large datasets and machine learning algorithms.

How to Use the Matrix Calculator

Set Dimensions: Use the stepper controls to define the number of rows and columns for Matrix A and Matrix B.

Input Values: Enter your numbers into the matrix grid. You can also use the Zero, Identity, or Random buttons to act as an identity matrix generator or random matrix generator. You can randomize matrix values with one click.

Choose Operation: Click the operation dropdown to choose from Add, Subtract, Multiply, Scalar, Transpose, Determinant, Inverse, or Trace.

View Results: Our matrix calculator with steps will instantly display the result and detailed calculation steps below.

Matrix Operations Explained

Our tool functions as a complete matrix determinant, inverse and trace calculator all in one. Here is a breakdown of the supported operations:

Addition & Subtraction

Matrix addition and subtraction are performed element-by-element. Both matrices must have the exact same dimensions.

Example (2x2 Addition):
[1, 2] + [5, 6] = [6, 8] [3, 4]    [7, 8]    [10, 12]

Multiplication

To multiply two matrices, the number of columns in the first matrix must equal the number of rows in the second matrix. The result is calculated using the dot product of rows and columns.

Example (2x2 Multiplication):
[1, 2] × [5, 6] = [19, 22] [3, 4]    [7, 8]    [43, 50]

Determinant

The determinant is a scalar value that can be computed from the elements of a square matrix. It provides important properties about the matrix, such as whether it has an inverse.

Example (3x3 Determinant):
[a, b, c] [d, e, f] [g, h, i] Det = a(ei - fh) - b(di - fg) + c(dh - eg)

Inverse

The inverse of a square matrix is a matrix that, when multiplied by the original matrix, yields the identity matrix. A matrix only has an inverse if its determinant is non-zero.

Transpose

The transpose of a matrix is found by swapping its rows and columns. What was in the first row becomes the first column, and so on.

Trace

The trace of a square matrix is the sum of the elements on its main diagonal (from top-left to bottom-right).

Step-by-Step Example (2x2 Determinant)

To demonstrate our matrix calculator with steps feature, here is exactly how the tool solves a 2x2 determinant:

Problem: Find the determinant of Matrix A

Matrix A =
[ 4    2 ]
[ 3    5 ]

Step 1: Formula

The determinant of a 2x2 matrix [a, b; c, d] is calculated as (a × d) - (b × c).

Step 2: Substitution

Plug in our values: (4 × 5) - (2 × 3)

Step 3: Multiplication

20 - 6

Step 4: Final Result

14

Our tool instantly shows you all these calculation steps right below the result grid for any operation you choose.

Dimension rules

Addition and subtraction require equal dimensions. For multiplication, the columns in Matrix A must match the rows in Matrix B. Determinant, inverse, and trace calculations require a square matrix.

Privacy

All matrix values and calculations stay in your browser. This is a no upload, no login matrix calculator. Toolslight does not upload or store your entries.

Frequently Asked Questions

How do you calculate the determinant of a matrix?

To calculate the determinant of a 2x2 matrix, you multiply the elements of the main diagonal and subtract the product of the other diagonal (ad - bc). For larger square matrices, you use cofactor expansion or row reduction.

How do you find the inverse of a matrix?

To find the inverse of a 2x2 matrix, swap the positions of the main diagonal elements, change the signs of the other diagonal elements, and multiply the entire matrix by 1 divided by the determinant. For larger matrices, you can use Gaussian elimination or the adjugate matrix method. The determinant must not be zero.

Can you multiply two matrices of different sizes?

Yes, but only if the number of columns in the first matrix is exactly equal to the number of rows in the second matrix. The resulting matrix will have the same number of rows as the first matrix and the same number of columns as the second.

What is the difference between matrix transpose and inverse?

A matrix transpose simply flips the matrix over its main diagonal, turning rows into columns. A matrix inverse is a specific matrix that, when multiplied by the original matrix, results in the identity matrix. They are fundamentally different operations.

Is this matrix calculator free to use?

Yes, this online matrix calculator is 100% free to use. It works entirely in your browser with no upload, no login required, and gives you instant step-by-step solutions. Check our other calculators for more math tools.