Last updated October 5, 2026 · Report an error
LU decomposition factors a square matrix into a lower triangular matrix (L) and an upper triangular matrix (U), making systems of equations and determinants much faster to compute repeatedly.
This calculator performs LU decomposition using Doolittle's method for any square matrix from 2×2 up to 6×6.
How it works
Enter your matrix size and values. The calculator eliminates rows from top to bottom, building U from the eliminated matrix and L from the multipliers used along the way, such that \(A = LU\).
- Click Calculate to see your results.
Examples
2×2 example
The matrix [[4,3],[6,3]] decomposes into L = [[1,0],[1.5,1]] and U = [[4,3],[0,-1.5]] — multiplying L by U reconstructs the original matrix.
Who should use it
- Checking linear algebra coursework involving LU decomposition.
- Understanding the elimination steps behind solving a linear system efficiently.
Industry applications
- Linear algebra and numerical methods education
- Engineering and scientific computing
Advantages
- Shows both L and U matrices clearly, with A = LU verifiable by multiplication.
- Supports matrices from 2×2 up to 6×6.
Limitations
- Doesn't perform partial pivoting, so some matrices with zero pivots can't be decomposed by this method.
Common mistakes to avoid
- Expecting a result for a matrix with a zero pivot — Doolittle's method without pivoting can't handle every matrix.
- Forgetting that L always has 1s on its diagonal in this convention (Doolittle's method), which distinguishes it from other LU conventions.
Best practices
- If your matrix fails to decompose due to a zero pivot, try the Gauss-Jordan Elimination calculator instead, which handles row swapping automatically.
Tips
- Once you have L and U, solving Ax = b becomes two easy triangular solves (forward substitution with L, then backward substitution with U) instead of one harder elimination.