Matrix Calculator
Multiply, invert, find determinants, rank and eigenvalues, and solve Ax = b, up to 6 × 6
A matrix calculator carries out the standard operations of linear algebra on rectangular grids of numbers: addition, multiplication, the determinant, the inverse, the rank, powers, eigenvalues and the solution of Ax = b. This one keeps every entry as an exact fraction, so the inverse of A = [1, 2, −1; 3, 0, 4; 2, 1, 1] comes out in exact thirds such as −4/3 and 8/3, with det(A) = 3, instead of rounded decimals.
Last updated October 2026
Method: Exact rational arithmetic (integer numerators and denominators of any size) for every operation except irrational eigenvalues. Products use (AB)ij = Σ aikbkj; determinants use cofactor expansion for 2 × 2 and 3 × 3 (with the steps shown) and Gaussian elimination from 4 × 4 up; inverses, rank and Ax = b use Gauss-Jordan elimination. Eigenvalues come from the mathjs eigs routine, with a root finder on the exact characteristic polynomial as a fallback. Rational eigenvalues are confirmed exactly, the others are refined by Newton’s method on the exact polynomial, and multiplicities are counted exactly.
Included: A + B, A − B, A × B with entry-by-entry work, scalar multiples, transpose, determinant, inverse, rank, trace, powers from A−20 to A20, the characteristic polynomial, real and complex eigenvalues with eigenvectors and multiplicities, and Ax = b through the augmented matrix [A | b]. Matrices up to 6 × 6, typed into a grid or pasted as text.
Not included: Symbolic entries such as x or a, complex-number entries, decompositions (LU, QR, SVD, Jordan form), the matrix exponential, least-squares solutions and matrices larger than 6 × 6.
🔲 Choose an operation and enter your matrices
Empty cells count as 0. Entries can be integers, decimals (0.25) or fractions (3/4); exact fractions are kept through every step.
🔲 Inverse A⁻¹ (3 × 3)
| -4/3 | -1 | 8/3 |
| 5/3 | 1 | -7/3 |
| 1 | 1 | -2 |
✔️ Check
Multiplying A by the result gives the identity matrix exactly, because every entry was computed with exact fractions rather than rounded decimals.
Gauss-Jordan steps on [A | I] (8 row operations)
Write the identity matrix to the right of A and row-reduce. When the left half becomes I, the right half is A⁻¹. If a column runs out of nonzero pivots, A has no inverse.
Forward elimination
1.R2 → R2 − 3R1clear the entry below the pivot in column 11 2 -1 1 0 0 0 -6 7 -3 1 0 2 1 1 0 0 1 - 2.R3 → R3 − 2R1clear the entry below the pivot in column 1
1 2 -1 1 0 0 0 -6 7 -3 1 0 0 -3 3 -2 0 1 - 3.R2 → −(1/6)R2make the pivot in column 2 equal to 1
1 2 -1 1 0 0 0 1 -7/6 1/2 -1/6 0 0 -3 3 -2 0 1 - 4.R3 → R3 + 3R2clear the entry below the pivot in column 2
1 2 -1 1 0 0 0 1 -7/6 1/2 -1/6 0 0 0 -1/2 -1/2 -1/2 1 - 5.R3 → −2R3make the pivot in column 3 equal to 1
1 2 -1 1 0 0 0 1 -7/6 1/2 -1/6 0 0 0 1 1 1 -2 Back substitution
6.R1 → R1 + R3clear the entry above the pivot in column 31 2 0 2 1 -2 0 1 -7/6 1/2 -1/6 0 0 0 1 1 1 -2 - 7.R2 → R2 + (7/6)R3clear the entry above the pivot in column 3
1 2 0 2 1 -2 0 1 0 5/3 1 -7/3 0 0 1 1 1 -2 - 8.R1 → R1 − 2R2clear the entry above the pivot in column 2
1 0 0 -4/3 -1 8/3 0 1 0 5/3 1 -7/3 0 0 1 1 1 -2
Matrix calculator: how each operation works, with worked examples
Matrices turn up wherever several linear relationships act at once: systems of equations, rotations in computer graphics, population models that step forward one year at a time. The operations are simple to define but error-prone by hand, since a single 3 × 3 product already involves 27 multiplications. The calculator does the arithmetic exactly and shows the intermediate work, so you can check homework line by line.
The page links to three sister tools. The RREF Calculator lists every row operation of Gauss-Jordan elimination on any matrix. The System of Equations Calculator takes equations written out in x, y and z. The Vector Calculator handles dot products, cross products and angles. A note on notation: in the text below a matrix is written row by row, with commas between entries and semicolons between rows, so [1, 2; 3, 4] has first row 1, 2 and second row 3, 4. You can paste that exact text into the calculator.
Matrix sizes and which operations are allowed
A matrix with m rows and n columns is called an m × n matrix, always rows first. Adding two matrices pairs up matching entries, so they must be the same size. Multiplying pairs rows of the first with columns of the second, so the inner dimensions must agree. The determinant, the trace, the inverse, powers and eigenvalues are only defined for square matrices. The table summarizes the rules the calculator checks before it computes anything.
| Operation | Size requirement | Result |
|---|---|---|
| A + B, A − B | Both m × n | m × n |
| A × B | A is m × n, B is n × p | m × p |
| k × A, transpose AT | Any size | m × n, and n × m for AT |
| det(A), tr(A) | Square, n × n | One number |
| A−1 | Square and det(A) ≠ 0 | n × n |
| An | Square; negative n also needs det(A) ≠ 0 | n × n |
| rank(A) | Any size | A whole number from 0 to min(m, n) |
| Eigenvalues | Square, n × n | n values, counted with multiplicity |
| Solve Ax = b | b has one entry per row of A | x has one entry per column of A |
The formulas behind each operation
Each operation is a definition rather than an approximation, which is why exact answers are possible:
(A + B)ij = aij + bij (kA)ij = k · aij (AT)ij = aji (AB)ij = ai1b1j + ai2b2j + … + ainbnj det [a, b; c, d] = ad − bc [a, b; c, d]−1 = [d, −b; −c, a] / (ad − bc) det(A) = Σj (−1)i+j aij Mij (expansion along row i) tr(A) = a11 + a22 + … + ann Av = λv ⇔ det(λI − A) = 0 Here Mij is the minor of entry aij, the determinant of the smaller matrix left after deleting row i and column j, and (−1)i+jMij is its cofactor. The determinant of a product is the product of the determinants, det(AB) = det(A)·det(B), and an inverse exists exactly when det(A) ≠ 0. The eigenvalues satisfy two identities that make good checks: they add up to the trace and multiply to the determinant.
Worked example 1: a 2 × 3 matrix times a 3 × 2 matrix
Take A = [2, −1, 3; 0, 4, 1], a 2 × 3 matrix, and B = [1, 2; 3, 0; −2, 5], a 3 × 2 matrix. The inner dimensions match (3 and 3), so AB exists and has the outer dimensions, 2 × 2. Each entry is a row of A dotted with a column of B:
c11 = 2·1 + (−1)·3 + 3·(−2) = 2 − 3 − 6 = −7 c12 = 2·2 + (−1)·0 + 3·5 = 4 + 0 + 15 = 19 c21 = 0·1 + 4·3 + 1·(−2) = 0 + 12 − 2 = 10 c22 = 0·2 + 4·0 + 1·5 = 0 + 0 + 5 = 5 So AB = [−7, 19; 10, 5], with determinant (−7)(5) − (19)(10) = −225. Now press Swap A and B and multiply again. BA is a completely different object: a 3 × 3 matrix, [2, 7, 5; 6, −3, 9; −4, 22, −1]. Its determinant is 0, because a product that passes through a 2-dimensional middle step can have rank at most 2. One quantity survives the swap, though: the trace. tr(AB) = −7 + 5 = −2 and tr(BA) = 2 − 3 − 1 = −2. That identity, tr(AB) = tr(BA), holds for any sizes where both products exist. The transpose of the product reverses the order as well: (AB)T = BTAT = [−7, 10; 19, 5].
Worked example 2: a 3 × 3 determinant and the exact inverse
Let A = [1, 2, −1; 3, 0, 4; 2, 1, 1], the matrix the calculator loads by default. Expanding along row 1, the signs run +, −, +, and each entry multiplies the 2 × 2 determinant left after crossing out its row and column:
det(A) = 1·(0·1 − 4·1) − 2·(3·1 − 4·2) + (−1)·(3·1 − 0·2) = 1·(−4) − 2·(−5) + (−1)·3 = −4 + 10 − 3 = 3 Any row or column gives the same value, and a line with a zero saves work. Column 2 holds 2, 0 and 1 with signs −, +, −, so det(A) = −2·(3·1 − 4·2) + 0 − 1·(1·4 − (−1)·3) = 10 + 0 − 7 = 3. Pick Column 2 under Cofactor expansion along to see this version in full.
Because det(A) = 3 is not zero, A is invertible. Gauss-Jordan elimination on [A | I] takes eight row operations and produces
A−1 = [−4/3, −1, 8/3; 5/3, 1, −7/3; 1, 1, −2] Every entry is a multiple of 1/3, which is no accident: A−1 equals the adjugate (the transposed matrix of cofactors) divided by det(A), and here the adjugate is the integer matrix [−4, −3, 8; 5, 3, −7; 3, 3, −6]. In decimal form the inverse reads −1.3333, −1, 2.6667 in the first row, and multiplying A by those rounded numbers no longer returns the identity exactly. The fractions do. Two further checks follow from the determinant rules: det(A−1) = 1/3, and doubling every entry of this 3 × 3 matrix multiplies the determinant by 23, giving det(2A) = 24.
Worked example 3: eigenvalues and eigenvectors, real and complex
An eigenvector of A is a nonzero vector that A only stretches: Av = λv. For A = [5, 4; 1, 2] the characteristic polynomial is det(λI − A) = λ2 − 7λ + 6 = (λ − 6)(λ − 1), so the eigenvalues are 6 and 1. They add to 7, the trace, and multiply to 6, the determinant. For λ = 6, the system (A − 6I)v = 0 reads −x + 4y = 0, so v = (4, 1); for λ = 1 it reads 4x + 4y = 0, so v = (−1, 1). The calculator shows each eigenvector with its free variable set to 1, plus a whole-number version whenever fractions appear.
Eigenvalues predict powers. Since A = P D P−1 with D = diag(6, 1), every power is An = P Dn P−1, and the entries of A5 must grow like 65 = 7,776. Run the power operation with n = 5 and you get A5 = [6221, 6220; 1555, 1556], which matches the closed form (4·7,776 + 1)/5 = 6,221 exactly.
Not every real matrix has real eigenvalues. For [1, −2; 1, 3] the polynomial is λ2 − 4λ + 5, whose discriminant 16 − 20 = −4 is negative, so the eigenvalues are the conjugate pair 2 + i and 2 − i, shown exactly as 2 ± i. The eigenvector for 2 + i is (−1 + i, 1). The 3 × 3 preset [4, −1, −1; 0, 1, 0; −1, 3, 4] has characteristic polynomial λ3 − 9λ2 + 23λ − 15, eigenvalues 5, 3 and 1, and eigenvectors (−1, 0, 1), (1, 0, 1) and (0, −1, 1).
Powers of the Fibonacci matrix
The matrix F = [1, 1; 1, 0] produces the Fibonacci numbers when you raise it to a power: Fn = [Fn+1, Fn; Fn, Fn−1]. Because det(F) = −1, the product rule gives det(Fn) = (−1)n, which is Cassini's identity Fn+1Fn−1 − Fn2 = (−1)n. The trace of Fn runs through the Lucas numbers. Every value below was computed with the calculator's exact power routine (load the Fibonacci power preset and change n).
| n | Fn | det(Fn) | tr(Fn) |
|---|---|---|---|
| 1 | [1, 1; 1, 0] | −1 | 1 |
| 2 | [2, 1; 1, 1] | 1 | 3 |
| 3 | [3, 2; 2, 1] | −1 | 4 |
| 4 | [5, 3; 3, 2] | 1 | 7 |
| 5 | [8, 5; 5, 3] | −1 | 11 |
| 6 | [13, 8; 8, 5] | 1 | 18 |
| 8 | [34, 21; 21, 13] | 1 | 47 |
| 10 | [89, 55; 55, 34] | 1 | 123 |
| 12 | [233, 144; 144, 89] | 1 | 322 |
| 15 | [987, 610; 610, 377] | −1 | 1,364 |
| 20 | [10946, 6765; 6765, 4181] | 1 | 15,127 |
Negative powers work too, because det(F) ≠ 0: F−1 = [0, 1; 1, −1] and F−3 = [−1, 2; 2, −3], which extends the Fibonacci sequence backward with alternating signs.
Singular matrices, rank and why some inverses do not exist
A square matrix with determinant 0 is called singular. The classic example is [1, 2, 3; 4, 5, 6; 7, 8, 9]: the middle row is the average of the other two, so the rows are linearly dependent. Its determinant is 0, its reduced row echelon form is [1, 0, −1; 0, 1, 2; 0, 0, 0] and its rank is 2, one short of full rank, with nullity 3 − 2 = 1. The Singular matrix preset shows the calculator's response: Gauss-Jordan elimination runs out of pivots in the third column, so no inverse exists. For any n × n matrix these statements are equivalent: det(A) ≠ 0, rank(A) = n, the reduced form is the identity, Ax = b has exactly one solution for every b, and 0 is not an eigenvalue.
Solving Ax = b with the augmented matrix
The three equations x + 2y − z = −3, 3x + 4z = 18 and 2x + y + z = 6 have coefficient matrix A = [1, 2, −1; 3, 0, 4; 2, 1, 1] and right-hand side b = (−3, 18, 6). Choose Solve Ax = b and the calculator writes the augmented matrix [A | b], row-reduces it in eight operations and reads off x = 2, y = −1, z = 3. If the reduced matrix contains a row 0 = 1, the system has no solution; if some variables have no pivot, they become free parameters and the solution is written in parametric form, such as x = (0, 3, 0) + t(1, −2, 1). For long systems, or to see every intermediate matrix with explanations, the RREF Calculator goes into more detail.
How many multiplications a determinant needs
Cofactor expansion is the method taught first, and it is the one this calculator shows for 3 × 3 matrices. It does not scale. Each n × n determinant expands into n smaller ones, so the work grows like n factorial, while Gaussian elimination grows only like n3. The table counts multiplications and divisions for a full matrix, without additions; the elimination column assumes no zero pivots.
| Size n | Leibniz terms (n!) | Cofactor expansion | Gaussian elimination |
|---|---|---|---|
| 2 | 2 | 2 | 3 |
| 3 | 6 | 9 | 10 |
| 4 | 24 | 40 | 23 |
| 5 | 120 | 205 | 44 |
| 6 | 720 | 1,236 | 75 |
| 8 | 40,320 | 69,280 | 175 |
| 10 | 3,628,800 | 6,235,300 | 339 |
For 3 × 3 the two methods cost about the same (9 versus 10 operations), which is why hand calculation uses cofactors. From 4 × 4 on, elimination wins, and at 10 × 10 cofactor expansion needs more than eighteen thousand times as many multiplications. The calculator therefore switches to elimination from 4 × 4: a row swap flips the sign of the determinant, and adding a multiple of one row to another leaves it unchanged.
How to use this calculator, and who it is for
Pick an operation first, because the inputs adapt to it: matrix B appears only for A + B, A − B and A × B, and fields for k, n or b appear when an operation needs them. Set the size of each matrix with the menus (up to 6 × 6) and type the entries: integers, decimals such as 0.25 and fractions such as 3/4 all work, and empty cells count as 0. Paste as text accepts a whole matrix at once, one row per line or rows separated by semicolons; write numbers without thousands separators (1000, not 1,000). The Try buttons load the main worked examples on this page. In decimal mode, a nonzero value too small for the chosen number of decimal places is shown in e-notation, such as 3.333e-5, rather than as 0. Results update as you type, and Use this result as A chains operations, for example squaring a matrix and then taking its determinant.
Students in linear algebra, precalculus and engineering math use it to check matrix products, cofactor expansions, inverses and eigenvalue problems against their own work. Teachers use the presets to build examples with clean answers. Programmers and data analysts sanity-check small transformation, Markov or covariance matrices before trusting code that handles large ones, and engineers solve small systems from circuit and statics problems.
Key terms
- Identity matrix I: ones on the main diagonal and zeros elsewhere; AI = IA = A.
- Determinant: a single number computed from a square matrix; zero exactly when the matrix is singular.
- Minor and cofactor: the determinant left after deleting row i and column j, and that minor times (−1)i+j.
- Inverse A−1: the matrix with AA−1 = A−1A = I; it exists only when det(A) ≠ 0.
- Rank: the number of linearly independent rows (equivalently columns), equal to the number of pivots after row reduction.
- Eigenvalue and eigenvector: a number λ and a nonzero vector v with Av = λv.
- Algebraic and geometric multiplicity: how often an eigenvalue repeats as a root of the characteristic polynomial, and how many independent eigenvectors it has. When the second falls short of the first, the matrix is not diagonalizable.
- Augmented matrix: the coefficient matrix with the right-hand side attached as an extra column, written [A | b].
Limitations and numerical notes
Exact arithmetic covers everything except eigenvalues that are irrational or complex. Those come from a numerical routine and are rounded for display, so an eigenvalue such as (5 + √33)/2 for [1, 2; 3, 4] appears as 5.3723 at four decimal places; for 2 × 2 matrices the calculator also prints the exact radical form. Rational eigenvalues are snapped to fractions only after they are confirmed to be exact roots of the characteristic polynomial, so a printed 6 really is 6. Multiplicities are exact as well: dividing the characteristic polynomial by its greatest common factor with its derivative leaves one copy of each root, which tells the calculator how many distinct eigenvalues there are, so rounding can never split a repeated eigenvalue or merge two close ones. Exact entries can grow quickly under powers, so An is shown only while every entry has at most 300 digits. The 6 × 6 limit keeps the step-by-step output readable, and entries must be numbers, so a matrix containing a variable or a parameter k needs a computer algebra system.
Related calculators
- To see every row operation that reduces a matrix, use the RREF Calculator.
- To solve two or three equations typed in x, y and z, use the System of Equations Calculator.
- For dot products, cross products, magnitudes and angles, use the Vector Calculator.
- For arithmetic with complex eigenvalues such as 2 + i, use the Complex Number Calculator.
- The eigenvalues of a 2 × 2 matrix are the roots of a quadratic; the Quadratic Formula Calculator solves one directly.
- To simplify or combine the fractions in an exact inverse, use the Fraction Calculator, and for more Fibonacci numbers use the Fibonacci Calculator.
Sources
Matrix operations are exact mathematical definitions, so the worked examples and tables above were computed directly with the formulas shown. The definitions and identities follow these references:
- NIST Digital Library of Mathematical Functions, §1.2 Elementary Algebra: matrix multiplication (defined only when the inner dimensions agree, not commutative), the transpose, the determinant, the inverse (unique when det(A) ≠ 0), the trace, and eigenvalues as roots of det(A − λI) = 0, with the determinant equal to their product and the trace equal to their sum (§1.2(v) and §1.2(vi)).
- NIST Digital Library of Mathematical Functions, §1.3 Determinants: minors, cofactors, expansion along a row, the effect of row swaps and row additions, and det(AB) = det(A)det(B).
- MIT OpenCourseWare 18.06SC Linear Algebra: Multiplication and Inverse Matrices: matrix multiplication from several points of view, including row times column, and Gauss-Jordan elimination for the inverse.
- MIT OpenCourseWare 18.06SC: Determinant Formulas and Cofactors and Eigenvalues and Eigenvectors, and Diagonalization and Powers of A.
- math.js documentation, function eigs: the numerical eigenvalue routine used for eigenvalues that are not rational.
⚠️ Common mistakes & edge cases
Multiplying entry by entry
Matrix multiplication is rows times columns, not matching entries times matching entries. Multiplying [1, 2; 3, 4] by itself entry by entry gives [1, 4; 9, 16], but the real square is [7, 10; 15, 22]. The entry-by-entry product exists (it is called the Hadamard product), but it is a different operation with different rules.
Assuming AB = BA
Order matters. In worked example 1, AB is 2 × 2 with determinant −225 while BA is 3 × 3 with determinant 0. When you move a matrix across an equation, multiply on the same side of both terms: from AX = C you get X = A−1C, not CA−1.
Dropping a sign in cofactor expansion
The signs follow a checkerboard that starts with + in the top-left corner: + − + across row 1 and − + − across row 2. Expanding along row 2 with the wrong signs turns det(A) = 3 into a different number. The step list in the calculator prints the sign of every term so you can compare.
Trusting decimals near a singular matrix
A matrix such as [1, 2; 2, 4.0001] has determinant 0.0001: technically invertible, with entries of the inverse in the tens of thousands. Rounded inputs can hide or invent singularity, so enter values as exact as you have them, ideally as fractions, and treat a tiny determinant as a warning sign.
Mixing up rows and columns
A 2 × 3 matrix has 2 rows and 3 columns, never the other way around. Typing a column vector as a row turns Ax = b into a dimension error, and transposing by accident changes a product completely. Check the size line above each result.
Expecting one unique eigenvector
Eigenvectors are directions, not single vectors: (4, 1), (8, 2) and (−2, −0.5) are all valid for the eigenvalue 6 of [5, 4; 1, 2]. A matrix such as [2, 1; 0, 2] goes the other way: its eigenvalue 2 repeats twice but has only one eigenvector direction, so it cannot be diagonalized.
❓ Frequently asked questions
How do you multiply two matrices?
Multiply rows of the first matrix by columns of the second. The entry in row i, column j of AB is the sum of the products of row i of A with column j of B, entry by entry. For A = [2, −1, 3; 0, 4, 1] and B = [1, 2; 3, 0; −2, 5], the top-left entry is 2·1 + (−1)·3 + 3·(−2) = −7, and the full product is the 2 × 2 matrix [−7, 19; 10, 5]. The number of columns of A must equal the number of rows of B, or the product is not defined.
How do I find the inverse of a 3x3 matrix?
Write the 3 × 3 identity matrix to the right of A to form [A | I], then use row operations to turn the left half into the identity. Whatever appears on the right is A⁻¹. For A = [1, 2, −1; 3, 0, 4; 2, 1, 1] this takes eight row operations and gives A⁻¹ = [−4/3, −1, 8/3; 5/3, 1, −7/3; 1, 1, −2]. If a column runs out of nonzero pivots along the way, the matrix has no inverse.
What is the formula for the inverse of a 2x2 matrix?
For A = [a, b; c, d], the inverse is 1/(ad − bc) times [d, −b; −c, a]: swap the diagonal entries, change the signs of the other two, and divide everything by the determinant. For A = [4, 7; 2, 6] the determinant is 4·6 − 7·2 = 10, so A⁻¹ = [6/10, −7/10; −2/10, 4/10] = [3/5, −7/10; −1/5, 2/5]. If ad − bc = 0 the formula breaks down and no inverse exists.
How do you calculate the determinant of a 3x3 matrix?
Use cofactor expansion along any row or column: multiply each entry by its sign from the checkerboard pattern (+ − + across the first row) and by the 2 × 2 determinant left after deleting that entry's row and column, then add the three terms. For A = [1, 2, −1; 3, 0, 4; 2, 1, 1], expanding along row 1 gives 1·(−4) − 2·(−5) + (−1)·3 = −4 + 10 − 3 = 3. Expanding along column 2, which contains a zero, gives 10 + 0 − 7 = 3, the same answer with less work.
What does it mean when the determinant of a matrix is zero?
A determinant of zero means the matrix is singular. Its rows (and its columns) are linearly dependent, it has no inverse, its rank is less than its size, and the system Ax = b has either no solution or infinitely many, never exactly one. Geometrically, the matrix squashes space into a lower dimension, for example a 3 × 3 matrix with determinant 0 maps all of space onto a plane or a line.
How do you find eigenvalues and eigenvectors?
Solve the characteristic equation det(λI − A) = 0 for λ, then for each eigenvalue solve (A − λI)v = 0 for a nonzero vector v. For A = [5, 4; 1, 2] the characteristic polynomial is λ² − 7λ + 6 = (λ − 6)(λ − 1), so the eigenvalues are 6 and 1. Solving (A − 6I)v = 0 gives v = (4, 1), and solving (A − I)v = 0 gives v = (−1, 1). Any nonzero multiple of an eigenvector is also an eigenvector.
Can a real matrix have complex eigenvalues?
Yes. The characteristic polynomial of a real matrix can have complex roots, and they always come in conjugate pairs a ± bi. The matrix [1, −2; 1, 3] has characteristic polynomial λ² − 4λ + 5, whose discriminant 16 − 20 = −4 is negative, so its eigenvalues are 2 + i and 2 − i, with eigenvectors (−1 + i, 1) and (−1 − i, 1). Complex eigenvalues usually signal rotation: the matrix turns vectors as well as stretching them.
What is an augmented matrix calculator used for?
An augmented matrix [A | b] stores a whole system of linear equations in one grid: the coefficients in A and the right-hand sides in the extra column b. Row-reducing it solves the system. Choose Solve Ax = b above, enter A and b, and the calculator builds [A | b], reduces it to reduced row echelon form and reports a unique solution, no solution, or infinitely many solutions written with free parameters.
Why can't I multiply two 2x3 matrices?
Matrix multiplication pairs each row of the first matrix with each column of the second, so the rows of A must be exactly as long as the columns of B. A 2 × 3 matrix has rows of length 3, while a 2 × 3 matrix has columns of length 2, so the pairing fails. You can multiply a 2 × 3 matrix by the transpose of another 2 × 3 matrix (a 3 × 2 matrix), which gives a 2 × 2 result.
Is A times B the same as B times A?
Usually not. Matrix multiplication is not commutative, and AB and BA need not even have the same size. With A of size 2 × 3 and B of size 3 × 2, AB is a 2 × 2 matrix while BA is 3 × 3. Even for square matrices of the same size, AB and BA generally differ. Two things always agree, however: tr(AB) = tr(BA), and for square matrices det(AB) = det(BA).
💡 Good to know
Why exact fractions matter for inverses
The inverse of [1, 2, −1; 3, 0, 4; 2, 1, 1] has entries in thirds. Rounded to four decimals, −4/3 becomes −1.3333, and A times the rounded inverse misses the identity by about 0.0001 in places. Exact fractions reproduce the identity perfectly, which is why the calculator only converts to decimals for display.
Two free checks for any eigenvalue answer
The eigenvalues of a square matrix always add up to its trace and multiply to its determinant. For [4, −1, −1; 0, 1, 0; −1, 3, 4] that means 5 + 3 + 1 = 9 = 4 + 1 + 4 and 5 · 3 · 1 = 15 = det(A). If your hand-computed eigenvalues fail either test, one of them is wrong.
The determinant measures volume
The absolute value of det(A) is the factor by which A scales area (in 2D) or volume (in 3D), and its sign says whether A flips orientation. A determinant of 3 triples every volume; a determinant of 0 flattens space into a plane or a line, which is exactly why no inverse can undo it.