Floating-point row reduction is a bad way to show students (or yourself) the Gauss-Jordan method. A pivot of 1/3 becomes 0.3333333333333333 , the next elimination step drifts, and the “step-by-step” write-up no longer matches the exact arithmetic you would do by hand.
I needed the opposite of that for a math site I work on, MathAI GPT (I built it, so treat this as a maintainer’s write-up, not a review). The result is a zero-dependency library that keeps every entry as an exact BigInt fraction, prints each row operation, and also does 2×2–4×4 cofactor determinants and 2×2/3×3 eigenvalues the same way.
The code is MIT-licensed at vaso81/matrix-rref-steps . It is not on the npm registry.…