Matrix Calculator
Enter one or two matrices of any dimension and the calculator performs the operation you pick, addition, subtraction, scalar or matrix multiplication, transpose, inverse, determinant, rank, trace, and shows the intermediate work where it matters. Useful for linear-algebra homework, engineering checks, computer-graphics transforms and any time you don’t want to hand-crank row reduction on a calculator with tiny buttons.
How to compute on matrices
-
1
Set dimensions
Rows and columns for matrix A (and B if the operation needs a second operand).
-
2
Enter values
Click into each cell. Decimals, negatives and fractions (`1/3`) are accepted.
-
3
Pick the operation
A+B, A−B, AB, kA, A^T, A^−1, det(A), rank, trace.
-
4
Read result and steps
Output matrix plus the formula used and any intermediate row operations.
Operations and their dimension rules
| Operation | Rule | Result dimensions |
|---|---|---|
| A + B | Same dimensions | m×n |
| A − B | Same dimensions | m×n |
| k · A | Any A | same as A |
| A · B | columns(A) = rows(B) | rows(A)×cols(B) |
| A^T (transpose) | Any A | n×m |
| A^−1 (inverse) | A is square and det(A) ≠ 0 | n×n |
| det(A) | A is square | scalar |
| rank(A) | Any A | scalar |
| trace(A) | A is square | scalar |
Why matrix multiplication isn’t commutative
For general matrices A and B, AB ≠ BA even when both products are defined. Each entry of AB is a dot product of a row of A with a column of B; swapping the order dots different rows and columns. Commuting matrices are the exception (multiples of identity, diagonal matrices with distinct entries, some rotations that share an axis).
Invertibility quick test
- A square matrix is invertible iff
det(A) ≠ 0. - Invertible ⇔ full rank ⇔ columns are linearly independent ⇔ trivial null space.
- For a 2×2:
A^−1 = 1/det(A) · [[d, −b], [−c, a]]. - For larger matrices, Gauss-Jordan elimination (augment with I, row-reduce to [I | A^−1]) is what the calculator uses.
Common gotchas
- Dimension mismatches. The most common error. The calculator flags these early and tells you exactly which dimensions don’t agree.
- Round-off in the inverse. Double-precision arithmetic accumulates small errors. A matrix that is nearly singular (determinant near zero) produces an inverse that’s wildly inaccurate. Check the condition number if precision matters.
- Non-integer fractions. Enter
1/3and the calculator keeps it exact where possible; it falls back to floats once the operation introduces irrational numbers.
Uses outside homework
- Computer graphics: 4×4 transform matrices for translation, rotation, scaling in 3D.
- Physics: stress and inertia tensors.
- Machine learning: weight matrices in dense layers; covariance matrices; PCA.
- Networking and Markov models: transition matrices and their powers.
- Economics: input-output models (Leontief).
Frequently Asked Questions
Hundreds of rows and columns work but become slow for operations with O(n³) complexity (multiplication, inverse, determinant). Beyond ~500×500, use a numerical library (NumPy, Octave) with BLAS-backed routines.
For simple operations (add, subtract, scalar multiply, transpose), yes. For inverse and determinant, the calculator can either stay rational (slow for large matrices) or use double-precision floats (fast but with round-off). You can toggle the mode.
Gauss-Jordan elimination: augment A with the identity, row-reduce to reduced row-echelon form. If the left half becomes I, the right half is A^−1; if not, A is singular and has no inverse.
No, this calculator is real-only. For complex matrices, use a dedicated complex-matrix tool.
No. All arithmetic runs in your browser.
Related Tools
BMI Calculator
Calculate body mass index from height and weight. Shows WHO category, healthy-weight range and limitations of BMI.
Social Security Calculator
Estimate a US Social Security retirement benefit from your PIA and claiming age. Compare monthly and annual amounts at 62, FRA 67 and 70.
Age Calculator
Calculate exact age in years, months and days from a birth date, plus total days, hours and the next birthday countdown.
Dog Age Calculator
Convert your dog's age to human years using modern veterinary research. Breed-size aware: small, medium and large dogs age differently.
Fahrenheit to Celsius Converter
Convert Fahrenheit temperatures to Celsius with the exact formula, Kelvin output and common reference points for weather, cooking and health.
Time Zone Converter
Convert a time between any two time zones, with daylight-saving shifts applied automatically.
Tool available in other languages
- Calculadora de Matrices [ES]
- Calculatrice de Matrices [FR]
- 行列計算機 [JA]
- Calculadora de Matrizes [PT]
- Matriskalkylator [SV]
- เครื่องคำนวณเมทริกซ์ [TH]
- Máy tính Ma trận [VI]
- حاسبة المصفوفات [AR]
- Matrix-Rechner [DE]
- 행렬 계산기 [KO]
- Kalkulator Matriks [ID]
- Matrixrekenmachine [NL]
- Kalkulator macierzy [PL]
- Калькулятор матриц [RU]
- Matris Hesaplama [TR]
- 矩阵计算器 [ZH]
- Calcolatore di Matrici [IT]