LU Decomposition Calculator

This tool factorises a square matrix into a unit lower triangular L and an upper triangular U using the Doolittle method with partial pivoting, so the largest available entry is always brought onto the diagonal before dividing. Enter a 2x2, 3x3 or 4x4 matrix, one row per line, and you get L, U, the permutation matrix P that records the row swaps, the sign of that permutation and the determinant as the signed product of the pivots. The factors are multiplied back out and shown next to the row-swapped original, so PA and LU can be compared entry by entry. A singular matrix is handled rather than refused: the pivot comes out zero, the determinant is zero, and the factorisation printed is one of many.

One row per line, or separate rows with semicolons. Entries may be negative or decimal, separated by commas or spaces.

For a 3 x 3 you would enter something like 1,2,3;4,5,6;7,8,10
Widget