Cholesky Decomposition Formulas
For a real symmetric positive-definite matrix A, the lower-triangular Cholesky factor has positive diagonal entries and satisfies A = LLᵀ. Here aᵢⱼ and lᵢⱼ denote the entries in row i, column j of A and L, respectively. Each sum runs from k = 1 through j − 1; for the first column (j = 1), the sum is zero.
Diagonal entries
lⱼⱼ = √(aⱼⱼ − Σₖ<ⱼ lⱼₖ²)The radicand must be strictly positive at every column.
Entries below the diagonal
lᵢⱼ = (aᵢⱼ − Σₖ<ⱼ lᵢₖlⱼₖ) / lⱼⱼCalculate these entries for i > j; entries above the diagonal remain zero.
Verification
A − LLᵀ ≈ 0The relative reconstruction residual is maxᵢⱼ |aᵢⱼ − (LLᵀ)ᵢⱼ| / maxᵢⱼ |aᵢⱼ|, the largest absolute reconstruction difference divided by the largest absolute matrix entry. A small residual indicates close reconstruction but does not establish good conditioning.
How to Use the Cholesky Calculator
- Select a matrix size from 2×2 through 8×8.
- Enter the complete symmetric matrix, paste it, or fill the lower triangle and select Mirror lower → upper.
- Select Calculate Cholesky. If the matrix is positive definite, the page displays L, Lᵀ, and each entry formula.
- Check the reconstruction error, then copy the summary or download the matrices as CSV.
Worked 3×3 Cholesky Example
The loaded example is A = [[4, 12, −16], [12, 37, −43], [−16, −43, 98]]. Its exact lower factor is L = [[2, 0, 0], [6, 1, 0], [−8, 5, 3]].
First column
l₁₁ = √4 = 2, then l₂₁ = 12/2 = 6 and l₃₁ = −16/2 = −8.
Second and third columns
l₂₂ = √(37 − 6²) = 1, then l₃₂ = (−43 − (−8 × 6))/1 = 5, and finally l₃₃ = √(98 − (−8)² − 5²) = 3.
Check
Multiplying the displayed L by Lᵀ returns the original A; any tiny reported residual comes from floating-point arithmetic.
When Cholesky Decomposition Fails
The matrix is not symmetric
For example, a₁₂ and a₂₁ must match within the symmetry tolerance. If entering only the lower triangle, select Mirror lower → upper.
A diagonal radicand is zero
A real symmetric positive-semidefinite matrix can have a Cholesky factor with zero diagonal entries. This calculator requires strictly positive diagonal entries; the standard division step used here divides by lⱼⱼ and does not handle zero pivots.
A diagonal radicand is negative
This means the positive-definiteness test failed at working precision. Rounding near the positive-definite boundary can affect this result, so higher-precision software may classify the matrix differently. Changing display precision does not change the calculation.
Cholesky Decomposition FAQs
What is a Cholesky decomposition?
For a real symmetric positive-definite matrix A, it is the factorization A = LLᵀ, where L is lower triangular and its diagonal entries are positive.
Which matrices can this calculator decompose?
It accepts real square matrices from 2×2 through 8×8 and returns a factor only when the input passes the symmetry and positive-definiteness checks at double-precision working accuracy. Rounding near the positive-definite boundary can affect the test result.
Is the Cholesky factor unique?
Yes. The requirement that every diagonal entry of L be positive selects one unique factor for a positive-definite matrix.
Why does a positive-semidefinite matrix fail?
A real symmetric positive-semidefinite matrix can have a Cholesky factor with zero diagonal entries. This calculator requires every diagonal entry to be strictly positive and stops at a zero radicand because its standard division step does not handle zero pivots. Such a failure does not mean that no Cholesky factor exists.
How is Cholesky different from LU decomposition?
Cholesky uses symmetry and positive definiteness to store one triangular factor and its transpose. General LU decomposition uses separate lower and upper factors and may need row pivoting.
What does the reconstruction error tell me?
It compares LLᵀ with A using maxᵢⱼ |aᵢⱼ − (LLᵀ)ᵢⱼ| / maxᵢⱼ |aᵢⱼ|. A value near machine precision indicates close reconstruction, but does not establish good conditioning or estimate the condition number.
Are my matrix entries private?
Yes. Calculation, clipboard text, and CSV creation happen in your browser. This page does not send or save the matrix values you enter.
Calculation Notes and Reference
Last reviewed: August 5, 2026 by the Starlight Tools editorial team.
The factorization convention matches the lower-triangular form documented by LAPACK DPOTRF2. This browser implementation uses the entry-by-entry unblocked algorithm rather than LAPACK's optimized routines.
Inputs use JavaScript double-precision arithmetic and must be zero or have magnitude from 10⁻¹⁰⁰ through 10¹⁰⁰. A matrix extremely close to the positive-definite boundary can be classified differently by higher-precision software.
