Logo

Matrix Calculator

Add, subtract, multiply, transpose, invert, and find determinants of matrices online

Quick Size:

Matrix A

2×2

Matrix B

2×2

A & B Operations

Individual Operations

Scalar Multiply

Free Online Matrix Calculator — Add, Subtract, Multiply, Transpose & Invert Matrices

Matrices are a fundamental part of mathematics, engineering, computer science, machine learning, and data science. Whether you are solving a system of linear equations, performing 3D graphics transformations, working on a machine learning algorithm, or studying linear algebra, you need to be able to perform matrix operations quickly and accurately. This free online Matrix Calculator handles all core matrix operations in your browser — no software installation and no signup required.

Enter values in Matrix A and Matrix B using the input grids. Add or remove rows and columns using the +Row, −Row, +Col, −Col buttons. Use the Quick Size presets (2×2, 3×3, 4×4, 2×3, 3×2) to set both matrices to identity matrices of that size instantly. Then choose from the available operations: add, subtract, or multiply the two matrices together; transpose, find the determinant, or invert each matrix individually; or multiply either matrix by a scalar constant. Results are displayed instantly and can be copied to your clipboard as CSV.

All calculations are performed in your browser using exact floating-point arithmetic with 10-decimal-place rounding for inverse results. No data is uploaded to any server.

Matrix Operations Explained

Matrix Addition (A + B)

Add two matrices of the same dimensions. Each element in the result is the sum of the corresponding elements in A and B. Requirement: A and B must have the same number of rows and columns.

Matrix Subtraction (A − B)

Subtract corresponding elements. Each element of the result is A[i][j] − B[i][j]. Same dimension requirement as addition.

Matrix Multiplication (A × B)

Multiply two matrices together using the dot-product rule. The number of columns in A must equal the number of rows in B. The result has dimensions (rows of A) × (columns of B). This operation is not commutative — A×B ≠ B×A in general.

Transpose (Aᵀ or Bᵀ)

Flip a matrix over its main diagonal. Rows become columns and columns become rows. An m×n matrix transposes to an n×m matrix. Transposing is used in many algorithms including covariance matrix calculation and the normal equation for linear regression.

Determinant (det(A))

A scalar value that represents certain structural properties of a square matrix. If the determinant is 0, the matrix is singular (not invertible). The determinant is used to solve systems of linear equations using Cramer's rule and to check whether a transformation is area/volume-preserving.

Matrix Inverse (A⁻¹)

For a square matrix A, its inverse A⁻¹ satisfies A × A⁻¹ = I (the identity matrix). The inverse exists only if the determinant is non-zero. This calculator uses Gauss-Jordan elimination for numerical stability. Inverses are used to solve linear systems Ax = b as x = A⁻¹b.

Scalar Multiplication (k × A)

Multiply every element in a matrix by a constant scalar k. This scales the matrix without changing its shape or relative proportions between elements.

Frequently Asked Questions

What sizes of matrices are supported?+
Any size up to what your browser can handle. The calculator dynamically adds or removes rows and columns. Practical limits depend on your device, but matrices up to about 8×8 are comfortable to work with on screen.
Why does matrix multiplication require specific dimensions?+
Matrix multiplication is defined as the dot product of rows of A with columns of B. For this to work, the number of columns in A must equal the number of rows in B. A (2×3) matrix can multiply a (3×4) matrix to give a (2×4) result, but not a (4×3) matrix.
Why is matrix multiplication not commutative?+
A×B and B×A generally produce different results (and may not even be valid if the dimensions are different). Matrix multiplication is associative (A×(B×C) = (A×B)×C) but not commutative.
What is a singular matrix?+
A matrix whose determinant is 0. A singular matrix cannot be inverted. In geometric terms, it represents a transformation that "collapses" space into fewer dimensions (e.g., a 3D→3D transformation where the output is actually 2D).
How is the inverse calculated?+
This calculator uses Gauss-Jordan elimination with partial pivoting for numerical stability. The method constructs an augmented matrix [A | I] and applies row operations until the left half becomes the identity matrix. The right half then becomes A⁻¹.
What is the identity matrix?+
A square matrix with 1s on the main diagonal and 0s everywhere else. It is the matrix equivalent of the number 1 — multiplying any matrix by the identity gives back the original matrix.
Can I use decimal numbers in the matrix cells?+
Yes. Type any decimal number into the matrix cells. The calculator handles floating-point arithmetic throughout all operations.
Does this work on mobile devices?+
Yes. The matrix grids are horizontally scrollable on small screens. All operations work on mobile and tablet browsers.
Advertisement
Logo

Your all-in-one digital toolkit with 100+ free online tools. Fast, secure, and always available when you need them.

Secure & Private

All processing happens locally in your browser

Mobile Friendly

Works perfectly on all devices and screen sizes

Always Free

No registration, no limits, completely free to use

100+
Free Tools
50K+
Daily Users
1M+
Tools Used
150+
Countries
© 2026 OmniWebKit. All rights reserved.
Made withfor developers and creators