Cholesky Decomposition Calculator logo

Factor the matrix, keep control

Cholesky Decomposition Calculator

Pick a matrix size, enter your symmetric matrix A, and get the lower-triangular factor L. The tool computes in your browser and warns you when the matrix is not symmetric or not positive definite.

Community rating 4.8/5 · 96 reviews

Cholesky Decomposition Calculator

Enter integers, decimals, or fractions (example: 3/4). The matrix must be symmetric and positive definite for Cholesky decomposition to exist.

Matrix size

Matrix input (A) ()

Cholesky factor (L) ()

Fill all matrix entries to compute the decomposition.

This is the lower-triangular matrix L such that A = L Lᵀ. Values above the diagonal are intentionally blank.

How to use this calculator

  1. Select 2×2, 3×3, or 4×4.
  2. Enter the matrix values using the a₁, b₂ style labels.
  3. Check the result grid for the lower-triangular factor L.
  4. If you see an error message, confirm symmetry and positive definiteness.

What Is Cholesky Decomposition?

Cholesky decomposition, also called Cholesky factorization, writes a symmetric positive definite matrix A as A = L LT. Here L is lower triangular, and its diagonal entries are positive.

This is a matrix factorization concept, not just a formula. Once you have L, you can reuse it to solve linear systems and to understand relationships between A and its inverse on the problems where Cholesky applies.

In practice, Cholesky decomposition shows up wherever positive definiteness and symmetry are natural assumptions, for example, covariance matrices in statistics, energy terms in engineering, and stable computations in scientific and numerical analysis.

  • Definition

    A = L L^T, with L lower triangular and positive diagonal entries.

  • Matrix requirements

    The calculator expects A to be symmetric, and it needs A to be positive definite so the diagonal square roots are real.

  • What you get

    A lower-triangular factor L you can use to reconstruct A and to support fast solves.

Cholesky Decomposition Formula

Cholesky factorization: A = L LT

L is lower triangular.

For i = 1..n and j = 1..i:

If i = j:

L[i,i] = sqrt( A[i,i] - sum_{k=1..i-1} L[i,k]^2 )

If i > j:

L[i,j] = ( A[i,j] - sum_{k=1..j-1} L[i,k] L[j,k] ) / L[j,j]

The algorithm builds L entry by entry. Each diagonal term uses the remaining part of A after subtracting already-computed contributions.

Off-diagonal entries use a subtraction of cross-products, divided by an earlier diagonal term L[j,j]. That division is why positive definiteness matters.

How to Perform Cholesky Decomposition

Use this checklist to compute L manually, then compare it to the calculator output at the top of the page.

  1. Verify symmetry

    Check that Ai,j equals Aj,i for all entries. If it is not symmetric, a real Cholesky factor L is not expected.

  2. Check positive definiteness

    Cholesky requires A to be positive definite. In the manual process, this shows up as each computed diagonal term staying positive before taking a square root.

  3. Compute diagonal entries

    For each i, compute L[i,i] using the diagonal formula and only previously computed L values.

  4. Compute off-diagonal entries

    For each i, compute L[i,j] with i greater than j using the off-diagonal subtraction and divide by L[j,j].

  5. Reconstruct and verify

    Rebuild A as L LT. If the reconstruction does not match A beyond rounding, double-check symmetry and each arithmetic step.

Cholesky Decomposition Examples

Try these matrices in the calculator, then read each resulting L entry directly from the lower-triangular grid.

  • 2×2 example

    A = [[4, 2], [2, 3]].

    L[1,1] = sqrt(4) = 2, L[2,1] = (2)/2 = 1, L[2,2] = sqrt(3 - 1^2) = sqrt(2).

    L: [[2, 0], [1, sqrt(2)]]

  • 3×3 example

    A = [[25, 15, -5], [15, 18, 0], [-5, 0, 11]].

    One valid factor is L = [[5, 0, 0], [3, 3, 0], [-1, 1, 3]].

    L: [[5, 0, 0], [3, 3, 0], [-1, 1, 3]]

  • 4×4 diagonal example

    A = diag(4, 9, 16, 25).

    For a diagonal SPD matrix, Cholesky stays diagonal, with L[i,i] = sqrt(A[i,i]).

    L: diag(2, 3, 4, 5)

Cholesky Factorization Calculator

The calculator returns the lower-triangular factor L. This factorization is designed for fast reuse, for example, when you need multiple solves with the same A.

For symmetric positive definite matrices, Cholesky is computationally efficient, and it tends to behave well numerically compared with general-purpose factorizations.

  • Lower triangular factor

    Only the lower triangle of L is displayed, because L above the diagonal is always zero.

  • Reuse across computations

    Once L is known, you can reconstruct A as L L<sup>T</sup> and use it to support linear solves.

  • Numerical stability intent

    Cholesky is a structured method that avoids unnecessary operations outside the symmetric positive definite setting.

Cholesky Decomposition vs LU Decomposition

LU decomposition can be applied more broadly, but it does not exploit the special structure of symmetric positive definite matrices.

Cholesky is specialized, so when A is symmetric and positive definite, it is often the simpler and more stable choice.

TopicCholeskyLU
Matrix requirementsSymmetric positive definite ANo SPD requirement, typically general square matrices
Factor shapeLower triangular L, with A = L L<sup>T</sup>Lower and upper triangular factors, A = L U (with permutations in many cases)
Common useFast solves and stable factor reuse for SPD systemsGeneral linear solves across broader matrix types

Positive Definite Matrix Calculator

A matrix is positive definite if xT A x is greater than zero for every nonzero vector x. This property is what makes the Cholesky square roots real.

On the calculator, you see positive definiteness indirectly. If a diagonal term becomes non-positive during the process, the decomposition cannot be formed.

  • Symmetry requirement

    Real Cholesky is built for symmetric matrices.

  • Validation behavior

    If the computed diagonal term would be invalid, the calculator reports that the matrix is not positive definite.

  • Where it appears

    Covariance matrices in statistics and certain energy matrices in engineering are commonly SPD.

Cholesky Decomposition in Numerical Analysis

In numerical analysis, stable factorizations matter because of floating-point rounding. Cholesky focuses on a structured matrix class, so it can reduce complexity and improve reliability.

It is often used to solve symmetric systems efficiently, to support iterative methods indirectly, and to speed up computations in scientific workflows.

  • Solving linear systems

    Use L to solve Ax = b without explicitly inverting A.

  • Optimization problems

    Many least squares and quadratic optimization settings lead to SPD systems.

  • Computational efficiency

    Cholesky performs only the operations needed for the lower triangular structure.

Cholesky Decomposition Calculator

Use the matrix grid to enter your symmetric matrix A, then read the lower-triangular output L in the result grid.

If you see an error message, confirm symmetry, then try inputs that produce a positive definite matrix.

Back to calculator

Common Cholesky Decomposition Mistakes

Most failures come from small requirement issues, or from sign and indexing mixups during the manual process.

  • Matrix not symmetric

    Cholesky expects A_ij equals A_ji. A single swapped entry can break the factor.

  • Assuming it works for non-positive diagonal terms

    If a computed diagonal value is zero or negative, the algorithm cannot take a real square root.

  • Mixing diagonal and off-diagonal formulas

    Diagonal entries use a square root step, off-diagonal entries use division by L[j,j].

  • Forgetting the subtraction step

    Each L entry uses A minus a sum of already computed products, not just A itself.

Cholesky Decomposition in Machine Learning

Cholesky decomposition often appears when modeling uncertainty. Covariance matrices are frequently symmetric and positive definite, so they can be factored as A = L LT for efficient downstream computations.

In Gaussian models and related regression workflows, L supports stable evaluation and transforms without relying on explicit inverses.

  • Covariance matrix factorization

    Use L to work with covariance structure efficiently.

  • Stable linear solves

    Avoid direct inverse computations by solving through the triangular factors.

  • Numerical robustness intent

    Cholesky is designed to be reliable for symmetric positive definite inputs, which matches how covariance is typically constructed.

FAQ