A matrix calculator handles the linear algebra operations that show up in engineering, computer graphics, machine learning, statistics, and physics. Whether you're a student doing homework, an engineer solving systems of equations, or a programmer working with transformations, computing matrices by hand is error-prone and slow.
This guide covers the core matrix operations (addition, subtraction, multiplication, transpose, inverse, determinant) with worked examples, the rules and limitations for each, and the most common real-world applications.
Calculate Matrices Online — Free
Add, multiply, transpose, invert, and find determinants. Supports up to 6×6 matrices with step-by-step results.
Matrix Basics
A matrix is a rectangular array of numbers arranged in rows and columns. Notation: A[i][j] = element in row i, column j.
Notation
A = | 1 2 3 |
| 4 5 6 | (2 rows, 3 columns — "2x3 matrix")
Special Matrices
- Square — same rows and columns (n×n)
- Identity (I) — diagonal of 1s, rest 0; A × I = A
- Zero (0) — all entries zero
- Diagonal — only diagonal entries non-zero
- Symmetric — A = A^T
Matrix Addition and Subtraction
Add or subtract corresponding elements. Matrices must have same dimensions.
| 1 2 | | 5 6 | | 6 8 |
| 3 4 | + | 7 8 | = | 10 12|
Rules
- Same dimensions required (2×3 + 2×3, but NOT 2×3 + 3×2)
- Commutative: A + B = B + A
- Associative: (A + B) + C = A + (B + C)
Matrix Multiplication
The trickiest operation. Element (i,j) of result = dot product of row i of A and column j of B.
Critical Rule
For A × B: columns of A must equal rows of B. Result has rows of A × columns of B.
(2×3 matrix) × (3×2 matrix) = (2×2 matrix)
(2×3 matrix) × (2×3 matrix) = ERROR (3 ≠ 2)
Example
| 1 2 | | 5 6 | | 1·5+2·7 1·6+2·8 | | 19 22 |
| 3 4 | × | 7 8 | = | 3·5+4·7 3·6+4·8 | = | 43 50 |
A × B ≠ B × A in general. Order matters in matrix multiplication, unlike with regular numbers.
Transpose, Inverse, and Determinant
Transpose (A^T)
Swap rows and columns. (a,b) becomes (b,a).
A = | 1 2 3 | A^T = | 1 4 |
| 4 5 6 | | 2 5 |
| 3 6 |
Determinant (det(A) or |A|)
Single scalar value. Defined only for square matrices. For 2×2:
det | a b | = ad - bc
| c d |
Inverse (A⁻¹)
Matrix such that A × A⁻¹ = I. Defined only for square matrices with non-zero determinant.
- If det(A) = 0 → matrix is "singular", no inverse exists
- For 2×2: A⁻¹ = (1/det(A)) × [[d, -b], [-c, a]]
- For larger: use Gauss-Jordan elimination or adjugate method
Real-World Applications
- Computer Graphics — 3D transformations (rotation, translation, scaling)
- Machine Learning — neural network weights, principal component analysis
- Engineering — circuit analysis, structural mechanics, control systems
- Physics — quantum mechanics, special relativity
- Economics — input-output analysis, linear programming
- Statistics — covariance matrices, regression analysis
- Cryptography — Hill cipher, lattice-based encryption
- Search engines — Google's PageRank uses giant matrix eigenvectors
How to Use the Tool (Step by Step)
- 1
Set Matrix Dimensions
Choose number of rows and columns for matrix A (and B if needed).
- 2
Enter Matrix Values
Type each number into the cells. Tool accepts integers, decimals, and fractions.
- 3
Pick Operation
Add, subtract, multiply, transpose, find determinant, or invert.
- 4
View Result
Tool computes and displays the result with optional step-by-step breakdown.
- 5
Verify Manually
For learning: check the result with hand calculation for small 2×2 cases.
Frequently Asked Questions
Can I multiply any two matrices?+−
No. Columns of first must equal rows of second. (2×3 × 3×2 works; 2×3 × 2×3 doesn't.)
What does it mean if determinant is zero?+−
Matrix is singular and has no inverse. Geometrically, the matrix collapses space onto a lower dimension.
Is matrix multiplication commutative?+−
No. A × B ≠ B × A in general. A few special matrices (diagonal, identity) are exceptions.
How is matrix multiplication used in machine learning?+−
Neural networks at every layer apply weight matrix to input vector. Training involves billions of matrix multiplications. GPUs are optimized for this.
What is an eigenvalue?+−
A scalar λ such that A × v = λ × v for some vector v. Eigenvalues describe how a matrix stretches or rotates space along specific directions.
What's the difference between det = 0 and rank deficient?+−
They're equivalent for square matrices. Det = 0 means at least one row/column is a linear combination of others, indicating rank less than n.
Calculate Matrices Online — Free
Add, multiply, transpose, invert, and find determinants. Supports up to 6×6 matrices with step-by-step results.
Open Matrix Calculator ->Related Guides
Free Online Scientific Calculator — Complete Guide (2026)
Free scientific calculator — trigonometry, logarithms, exponents, roots, factorials. Any device.
Statistics Calculator Guide
Calculate central tendency, dispersion, and probability — with worked examples for students, researchers, and analysts.
Permutation & Combination Calculator Guide
Understand permutations vs combinations, when to use each, and how to calculate them quickly with worked examples.