Factorization
P A = L U
If no row swaps are needed, P is the identity matrix and this reduces to A = LU.
Enter integers, decimals, or scientific notation. The displayed precision does not round intermediate calculations.
At pivot column k, partial pivoting chooses the largest available absolute entry. Each lower row then uses mᵢₖ = Uᵢₖ / Uₖₖ and Rᵢ ← Rᵢ − mᵢₖRₖ.
This calculator uses a Doolittle-style factorization with partial row pivoting. L has ones on its diagonal, U is upper triangular, and P records the row order.
P A = L U
If no row swaps are needed, P is the identity matrix and this reduces to A = LU.
mᵢₖ = Uᵢₖ / Uₖₖ
The multiplier is stored in Lᵢₖ while the corresponding entry below the pivot is eliminated from U.
det(A) = (−1)ˢ ∏ Uᵢᵢ
Here s is the number of row swaps. The diagonal product of unit-lower-triangular L is 1.
A. You can also paste an entire matrix.P·A = L·U.For A = [[2,1,1],[4,−6,0],[−2,7,2]], the first pivot is 4, so rows 1 and 2 are swapped. Partial pivoting then continues with elimination multipliers stored below the diagonal in L. The final factors satisfy P·A = L·U, and the determinant is −16.
Choosing the largest absolute pivot in the current column avoids division by zero and usually reduces amplification of floating-point rounding.
Multiply L and U, then compare the product with the row-permuted matrix P·A. The calculator reports their relative maximum difference.
When rows were swapped, the product is LU = PA, not necessarily A. Include the permutation matrix in the check.
When two rows are swapped at a later pivot, the already-computed entries in those rows of L must also be swapped.
Rounding multipliers at each step can noticeably change later pivots. Keep full precision until the final display.
LU decomposition expresses a square matrix using a lower-triangular factor L and an upper-triangular factor U. It is a reusable form of Gaussian elimination.
Partial pivoting may move a stronger pivot into the diagonal position. P records these row swaps, making the calculator’s convention PA = LU.
Every nonsingular square matrix has a pivoted LU decomposition. If the matrix is singular to working precision, the calculator stops at the zero pivot and explains why a complete nonsingular factorization was not produced.
Multiply the diagonal entries of U and change the sign once for each row swap. Since the diagonal of L consists of ones, det(L) = 1.
It compares LU with PA. A value near machine precision indicates that the displayed factorization reconstructs the permuted input closely, although ill-conditioned matrices can still magnify rounding in later uses.
It supplies the expensive factorization step. To solve Ax=b, apply the same permutation to b, solve Ly=Pb by forward substitution, then solve Ux=y by back substitution.
Yes. This page performs parsing, factorization, copying, and CSV generation locally. The tool code does not transmit or store your entries.
Last reviewed: August 4, 2026 by the Starlight Tools editorial team.
Inputs must be finite and no larger than 10¹⁰⁰ in magnitude. Matrix size is limited to 8×8 so the complete working remains readable. Extremely ill-conditioned matrices may have meaningful numerical error even when the reconstruction check is small.