Linear system solver

Solve a square linear system using exact fractions, with ranks, reduced row-echelon form and a residual, distinguishing unique solutions, infinitely many solutions and inconsistency.

Coefficients and operation
Coefficient matrix A
Right-hand vector b

A×x = b is a square system of 1–6 equations. Results include its classification, ranks and reduced row-echelon form. Infinite solutions include a particular solution and a basis of free-solution directions. Variable numbering starts at 1.

Enter integers or finite decimals. Digits 0–9, ٠–٩ and ۰–۹, a +, - or − sign, and decimal separator . or ٫ are accepted. No whitespace, grouping separators, fractions such as 1/2, scientific notation or expressions. Line breaks are not allowed and are not removed to join digits into a number.

Each coefficient allows at most 48 text units and 30 total digits, including up to 18 after the decimal separator; leading zeroes count. Up to 6 rows, 6 columns, 72 input cells and 8,192 text units per operation.

Cells outside the visible dimensions, c in linear mode and B in unary operations are excluded from calculation. Their values remain on this page while hidden. A rejected cell stays rejected until that same cell is corrected or cleared.

Exact rational arithmetic inside your browser, with one worker and a 5-second deadline. Reports are limited to 64 KiB. No automatic storage or requests carrying coefficients. Work or intermediate-number limits can reject a calculation.

How to use

Choose the number of equations and unknowns. Enter each equation’s coefficients in a row of A and its right-hand side in the corresponding row of b. Calculate, then inspect the status, rank of A, rank of [A|b] and reduced row-echelon form. Infinitely many solutions are represented by a particular solution plus free multiples of basis directions. Copy the complete report or download TXT.

Try an example

A=[[2,1],[1,−1]] and b=[5,1] represent 2x₁+x₂=5 and x₁−x₂=1. The solution is x=[2,1], both ranks are 2, and A×x−b=[0,0]. With A=[[1,2],[2,4]] and b=[3,6], infinitely many solutions exist; changing b to [3,7] makes the system inconsistent.

Support & limits

Row reduction uses exact reduced fractions rather than approximate decimal arithmetic or a numerical tolerance. The residual is computed from the original A and the solution; for infinite solutions it belongs to the particular solution, and A multiplied by every free direction is also checked to be zero. Free-variable numbering starts at 1. An inconsistent system has no solution or displayed residual. Resizing hides out-of-range cells without including them in calculation or erasing their values; their rejection states return when shown again.

Common questions

Does a singular coefficient matrix always mean there is no solution?

No. When rank([A|b]) exceeds rank(A), there is no solution. If the ranks agree but are below the number of unknowns, infinitely many solutions exist. If both equal the number of unknowns, the solution is unique. The tool does not replace an inconsistent system with a least-squares approximation.

Related tools