Matrices: operations, dimensions and worked examples
Choose an operation. Set each matrix’s rows and columns, then fill the labelled cells. Paste tab-separated spreadsheet cells directly into the grid. Unary operations use A; swap A and B to work on B.
Enter matrices in the same order as the expression
An m×n matrix has m rows and n columns. The cell a[i,j] is row i, column j; the grid and formulas keep this mathematical order in every language. Choose A+B, A−B, AB or BA, or a single-matrix operation. Set the dimensions and fill every needed cell. Spreadsheet paste uses tabs between cells and newlines between rows. All 0, All 1, Identity and Random fill the input explicitly; transposing input exchanges rows and columns. Swap exchanges both matrices. One-matrix operations use A, so swap first to use the previous B.
Addition, scalar multiplication and matrix products
Addition and subtraction require identical dimensions and act entry by entry: Cᵢⱼ = Aᵢⱼ ± Bᵢⱼ. A scalar k multiplies every entry. For A of size m×p and B of size p×n, AB has size m×n and Cᵢⱼ = Σₖ AᵢₖBₖⱼ. With A = [1,2,3;4,5,6] and B = [7,8;9,10;11,12], AB = [58,64;139,154]. AB and BA generally differ; one order may be defined while the other is not.
Determinants, inverses and singular matrices
For [a,b;c,d], det(A) = ad−bc. If it is nonzero, A⁻¹ = [d,−b;−c,a]/det(A). Thus [1,2;3,4] has determinant −2 and inverse [−2,1;3/2,−1/2]. An inverse exists only for a square matrix of full rank. The calculator uses exact rational elimination: a pivot is zero only when it is exactly zero, without a floating-point tolerance. Determinant elimination tracks row-swap signs and multiplies pivots; inverse calculation reduces [A|I] to [I|A⁻¹].
RREF, rank and the complete solution of Ax = b
Row operations swap rows, multiply a row by a nonzero number, or add a multiple of one row to another. RREF normalizes each pivot to 1 and eliminates its column above and below. Rank is the number of pivots. To solve Ax = b, enter the coefficients in A and constants as the single-column B. A contradiction gives no solution. Full column rank with a consistent system gives one vector. Otherwise the page shows a particular solution x₀, free-variable parameters and a null-space basis, with x = x₀ + Σ tᵢvᵢ for arbitrary real parameters. A particular vector alone is not the complete infinite solution set.
Powers, trace and exact result tables
For a square matrix, Aⁿ uses repeated multiplication; negative n uses the inverse and requires nonsingularity. A⁰ = I, including for the zero matrix, under the matrix empty-product convention. Trace is the sum of diagonal entries. This is matrix power, not entrywise exponentiation. Result tables retain reduced exact fractions; decimal entries are interpreted exactly as typed. Copy, CSV and Print / Save as PDF include the inputs, operation, exact values, classifications and working; infinite-solution reports also include the free parameters and basis.
Limits, privacy and practical use
Matrices support 1–10 rows and columns. Each fraction component or decimal coefficient permits up to 40 digits; scientific exponents are within ±40. Integer powers range from −20 to 20. Numerators and denominators of exact intermediate and result values are limited to 4096 digits; oversized work is rejected explicitly. Every required cell must contain a valid finite number. No digit grouping, expressions, NaN or infinity. Decimal separators follow the entry’s language; mathematical matrix order remains left-to-right. Large grids and tables scroll within their own area. Calculations stay in this tab. These operations support classroom algebra, coefficient systems and small exact linear models.
Use Fraction Calculator to inspect an individual rational entry and Scientific Calculator to evaluate an expression before entering its value. Exponent Calculator handles scalar powers; matrix powers use the rules above. Keep exact values during the calculation and use Rounding Calculator only when choosing the final reporting precision.
ISO 80000-2:2019 supplies mathematical-symbol context. The operation and elimination methods are explained in OpenStax — Matrices and Matrix Operations and OpenStax — Gaussian Elimination. These references identify scope; they do not certify this calculator.
Common questions
Why can’t I multiply these matrices?
For AB, the number of columns in A must equal the number of rows in B. The result uses A’s rows and B’s columns.
Why is there no inverse?
A must be square and nonsingular. A zero determinant means it has no inverse; negative matrix powers are also undefined.
How is transpose different from inverse?
Transpose swaps rows and columns and exists for rectangular matrices. Inverse reverses multiplication and exists only for nonsingular square matrices.
Can I enter fractions or decimals?
Yes. Every entry is interpreted as an exact rational value, including a finite decimal or an integer fraction with nonzero denominator.
What does an infinite solution mean?
The particular vector is one solution. Add any real linear combination of the displayed null-space basis vectors to obtain all solutions.
Is a matrix power entrywise?
No. A² means A multiplied by A, not squaring each cell. A⁰ is the identity and negative powers use A⁻¹.
Explore related tools
- Right Triangle Calculator
- Pythagorean Theorem Calculator
- Surface Area Calculator
- Circle Calculator
- Distance Calculator
- Area Calculator
- Slope Calculator
- Volume Calculator
- Triangle Calculator
- Confidence Interval Calculator
- Z-score Calculator
- Permutation and Combination Calculator
- Mean, Median, Mode & Range Calculator
- Statistics Calculator
- Probability Calculator
- Sample Size Calculator
- Number Sequence Calculator
- Standard Deviation Calculator
- Random Number Generator
- Scientific Notation Calculator
- Big Number Calculator
- Root Calculator
- Log Calculator
- Rounding Calculator
- Exponent Calculator
- Fraction Calculator
- Scientific Calculator
- Percentage Calculator
- Percent Error Calculator
- Quadratic Formula Calculator
- Least Common Multiple Calculator
- Greatest Common Factor Calculator
- Factor Calculator
- Ratio Calculator