Cholesky Decomposition Calculator

Use this Cholesky Decomposition Calculator to enter values, adjust options, and review results in a compact responsive workspace.

Results are calculated automatically as you enter data.

Matrix A
Matrix Size:
3
Formula and steps

Core decomposition

\(A = LL^T\)

Diagonal term

\(L_{\scriptscriptstyle ii} = \sqrt{A_{\scriptscriptstyle ii} - \sum_{k=1}^{i-1} L_{\scriptscriptstyle ik}^2}\)

Off-diagonal term

\(L_{\scriptscriptstyle ij} = \frac{A_{\scriptscriptstyle ij} - \sum_{k=1}^{j-1} L_{\scriptscriptstyle ik}L_{\scriptscriptstyle jk}}{L_{\scriptscriptstyle jj}}\)

Enter a symmetric positive-definite matrix.

Factorization -
Size -
Symmetry error -
Reconstruction error -

Input A

Lower triangular L

L^T

Reconstruction L L^T

Highlighted derivation

Click a step in the table or a lower-triangular value in L to inspect its derivation.

Step Element Formula Value

▼ See explanations and tips below ▼

What Is Cholesky Decomposition?

Cholesky decomposition is a way to factor a special kind of square matrix into a lower-triangular matrix and its transpose. For a real symmetric positive-definite matrix \(A\), the factorization is written as:

$$ A = LL^T $$

Here, \(L\) is a lower-triangular matrix, meaning all entries above its main diagonal are \(0\), and \(L^T\) is the transpose of \(L\). In the standard Cholesky form, the diagonal entries of \(L\) are positive.

The main idea is simple: instead of working with the original matrix all at once, Cholesky decomposition rewrites it as the product of two triangular matrices. Triangular matrices are easier to work with because many entries are already known to be \(0\). This makes the factorization useful in linear algebra, numerical methods, statistics, optimization, engineering, and other fields where symmetric positive-definite matrices appear often.

The phrase “symmetric positive-definite” is important. A matrix must be symmetric, but symmetry alone is not enough. It must also be positive-definite, which means its quadratic form is positive for every nonzero vector:

$$ x^T A x > 0 \quad \text{for every nonzero vector } x $$

When this condition holds for a real symmetric matrix, the Cholesky factorization exists and is unique when the diagonal entries of \(L\) are required to be positive.


Why Cholesky Decomposition Matters

Cholesky decomposition matters because it takes advantage of structure. A general square matrix may need a general-purpose factorization, but a symmetric positive-definite matrix has extra properties that allow a cleaner triangular factorization.

This is especially useful when solving systems such as:

$$ Ax = b $$

If \(A = LL^T\), the system can be solved in two triangular steps:

$$ Ly = b $$

then

$$ L^T x = y $$

This is often more efficient and numerically convenient than treating \(A\) as an unrelated general matrix.

Cholesky decomposition also appears in statistics and probability. For example, covariance matrices are symmetric and, when they are valid and nondegenerate, positive-definite. A Cholesky factor can be used to transform uncorrelated variables into variables with a desired covariance structure.

Students use Cholesky decomposition to understand matrix factorization, positive definiteness, and triangular systems. Professionals use it as a practical tool in scientific computing, optimization, simulation, least squares methods, and numerical linear algebra.


Key Terms to Know

  • Matrix: A rectangular array of numbers arranged in rows and columns.
  • Square matrix: A matrix with the same number of rows and columns.
  • Symmetric matrix: A real matrix where mirrored entries match, so \(A_{i,j} = A_{j,i}\).
  • Positive-definite matrix: A symmetric matrix where \(x^T A x > 0\) for every nonzero vector \(x\).
  • Lower-triangular matrix: A square matrix whose entries above the main diagonal are all \(0\).
  • Transpose: A matrix formed by swapping rows and columns. The transpose of \(L\) is written as \(L^T\).
  • Pivot: A diagonal value used during a factorization step. In Cholesky decomposition, the pivot must stay positive enough to take a real square root and divide safely.
  • Reconstruction error: A numerical check that compares the original matrix \(A\) with the product \(LL^T\).
  • Floating-point arithmetic: Approximate computer arithmetic used for decimal calculations. It is fast and practical, but it is not the same as exact symbolic or rational arithmetic.

How Cholesky Decomposition Works

Cholesky decomposition builds the matrix \(L\) one entry at a time. Each new entry depends only on entries of \(L\) that have already been computed.

For a real \(n \times n\) symmetric positive-definite matrix \(A\), the factorization is:

$$ A = LL^T $$

where:

  • \(A\) is the original square matrix.
  • \(L\) is the lower-triangular Cholesky factor.
  • \(L^T\) is the transpose of \(L\).
  • \(n\) is the number of rows and columns.

Using 1-based indexing, the diagonal entries are computed with:

$$ L_{j,j} = \sqrt{A_{j,j} - \sum_{k=1}^{j-1} L_{j,k}^2} $$

The entries below the diagonal are computed with:

$$ L_{i,j} = \frac{A_{i,j} - \sum_{k=1}^{j-1} L_{i,k}L_{j,k}}{L_{j,j}} \quad \text{for } i > j $$

The diagonal formula subtracts the contribution of earlier entries in the same row, then takes a square root. The off-diagonal formula subtracts earlier cross-products, then divides by the matching diagonal entry.

The positive-definite condition is what keeps the diagonal square-root expressions positive in exact arithmetic. If a diagonal expression becomes zero or negative, the matrix is not positive-definite for this form of Cholesky decomposition.


Examples of Cholesky Decomposition in Practice

Example 1: Simple Example

Consider the matrix:

$$ A = \begin{bmatrix} 4 & 2 \\ 2 & 3 \end{bmatrix} $$

We want:

$$ A = LL^T $$

with

$$ L = \begin{bmatrix} L_{1,1} & 0 \\ L_{2,1} & L_{2,2} \end{bmatrix} $$

First compute the top-left diagonal entry:

$$ L_{1,1} = \sqrt{4} = 2 $$

Then compute the entry below it:

$$ L_{2,1} = \frac{2}{2} = 1 $$

Now compute the second diagonal entry:

$$ L_{2,2} = \sqrt{3 - 1^2} = \sqrt{2} $$

So the Cholesky factor is:

$$ L = \begin{bmatrix} 2 & 0 \\ 1 & \sqrt{2} \end{bmatrix} $$

Multiplying \(L\) by \(L^T\) gives the original matrix:

$$ \begin{bmatrix} 2 & 0 \\ 1 & \sqrt{2} \end{bmatrix} \begin{bmatrix} 2 & 1 \\ 0 & \sqrt{2} \end{bmatrix} = \begin{bmatrix} 4 & 2 \\ 2 & 3 \end{bmatrix} $$

Example 2: Real-World Example

Suppose a covariance matrix is:

$$ A = \begin{bmatrix} 9 & 3 \\ 3 & 4 \end{bmatrix} $$

A Cholesky factor can be useful because it represents the covariance structure through a triangular matrix. Compute the first diagonal entry:

$$ L_{1,1} = \sqrt{9} = 3 $$

Compute the lower-left entry:

$$ L_{2,1} = \frac{3}{3} = 1 $$

Compute the second diagonal entry:

$$ L_{2,2} = \sqrt{4 - 1^2} = \sqrt{3} $$

So:

$$ L = \begin{bmatrix} 3 & 0 \\ 1 & \sqrt{3} \end{bmatrix} $$

This means the covariance matrix can be reconstructed as:

$$ A = LL^T $$

In simulations, this kind of factor can help turn independent standardized quantities into correlated quantities with the covariance pattern represented by \(A\).


Example 3: Common Edge Case

A common mistake is assuming that every symmetric matrix has a Cholesky decomposition. Consider:

$$ A = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix} $$

This matrix is symmetric because the off-diagonal entries match. But when Cholesky decomposition starts, the first entries are:

$$ L_{1,1} = \sqrt{1} = 1 $$
$$ L_{2,1} = \frac{2}{1} = 2 $$

The next diagonal entry would be:

$$ L_{2,2} = \sqrt{1 - 2^2} = \sqrt{-3} $$

That is not a real number. The matrix is symmetric, but it is not positive-definite, so the real lower-form Cholesky factorization \(A = LL^T\) does not exist.


How to Interpret the Result

The main result is the lower-triangular matrix \(L\). If the factorization succeeds, multiplying \(L\) by its transpose \(L^T\) should reproduce the original matrix \(A\), apart from small numerical rounding differences.

A successful result means the matrix passed the calculator’s symmetry and positive-definite checks and the factorization was completed. It does not mean every similar matrix will work; the specific input matrix must meet the required conditions.

The displayed identity

$$ A = LL^T $$

means that the original matrix has been rewritten as a product of the Cholesky factor and its transpose. The \(L\) matrix is the main factor to focus on. The \(L^T\) matrix is simply the transpose of \(L\).

The symmetry error shows how far mirrored entries are from matching. A symmetry error of \(0\) means the mirrored entries match exactly in the displayed numerical comparison. A small nonzero value means the matrix is close to symmetric, while a large value means it should not be treated as symmetric.

The reconstruction error compares \(A\) with the computed product \(LL^T\). A very small reconstruction error means the displayed factorization is numerically consistent with the input. A larger reconstruction error means the computed product is farther from the original matrix, which may indicate rounding effects, unsuitable input, or numerical difficulty.

The step-by-step derivation is useful for learning. Each step shows how one entry of \(L\) is computed from entries that were already found.


Common Mistakes and Misconceptions

  • Assuming symmetry is enough: A matrix must be symmetric and positive-definite, not just symmetric.
  • Entering a rectangular matrix: Cholesky decomposition applies to square matrices, so the number of rows and columns must match.
  • Confusing \(L\) with \(L^T\): \(L\) is lower triangular. \(L^T\) is upper triangular because it is the transpose of \(L\).
  • Expecting exact symbolic results: Decimal numerical inputs produce numerical results. Symbolic expressions and exact rational arithmetic are different tasks.
  • Treating displayed decimals as exact: Rounding affects how values are displayed. It does not turn an approximate numerical calculation into exact arithmetic.
  • Leaving new cells blank after changing size: Every matrix cell must contain a finite number before the calculation can succeed.
  • Pasting uneven rows: Each pasted row must contain the same number of entries, and the final pasted matrix must be square.
  • Using a positive-semidefinite matrix: Some positive-semidefinite matrices can have related factorizations in broader theory, but this calculator is designed for positive-definite matrices with sufficiently positive pivots.
  • Trying to factor an indefinite matrix: If the diagonal square-root expression becomes negative, the matrix is not positive-definite for this method.

When to Use Cholesky Decomposition

Use Cholesky decomposition when you are working with a real symmetric positive-definite matrix and want a triangular factorization.

Common uses include:

  • Solving linear systems \(Ax=b\) where \(A\) is symmetric positive-definite.
  • Checking hand-computed Cholesky steps in a linear algebra or numerical methods course.
  • Working with covariance matrices in statistics, probability, and simulation.
  • Understanding positive-definite matrices through a concrete factorization.
  • Preparing for optimization methods that involve positive-definite Hessian or approximation matrices.
  • Comparing Cholesky decomposition with LU decomposition, LDL\(^T\) decomposition, QR factorization, or eigenvalue methods.

Cholesky decomposition is not the right tool for every matrix. If the matrix is rectangular, nonsymmetric, indefinite, complex-valued, or symbolic, another method may be more appropriate.


Limitations and Things to Keep in Mind

Cholesky decomposition has strict input requirements. In the real lower-triangular form used here, the matrix must be square, symmetric, and positive-definite.

This calculator supports square matrices from \(2 \times 2\) through \(6 \times 6\). It does not support matrices smaller than \(2 \times 2\), matrices larger than \(6 \times 6\), rectangular matrices, symbolic entries, complex entries, or exact rational arithmetic.

The matrix entries are treated as unitless finite numbers. A decimal such as \(0.5\) is accepted, but a symbolic expression or fraction string such as 1/2 is not treated as exact rational input.

The calculator uses scale-relative floating-point tolerances. It measures the largest absolute matrix entry, then uses \(256\,\varepsilon\,\max_{i,j}|A_{ij}|\), where \(\varepsilon\) is JavaScript's Number.EPSILON, as the symmetry and diagonal-radicand tolerance. Mirrored entries that differ by more than this amount are rejected as non-symmetric; a diagonal radicand must be greater than it; and a pivot whose absolute value is at most its square root is treated as too close to zero.

Positive-semidefinite matrices are not accepted by this calculator when they produce a zero or near-zero Cholesky pivot. In exact theory, positive-semidefinite cases require extra care and may not have the same unique positive-diagonal lower factor used for positive-definite matrices.

Displayed precision is not the same as exact precision. Matrix entries and step values are displayed using the selected decimal setting, from \(2\) to \(10\) decimal places. If the precision setting is missing or invalid, the display falls back to \(6\) decimal places. Metric values such as symmetry error and reconstruction error are displayed separately using fixed metric formatting.

Exact zero values are displayed as \(0\). Nonzero values whose absolute value is below \(10^{-p}\), where \(p\) is the selected display precision, are shown in scientific notation instead (using up to \(8\) exponential decimal places), so small numerical values are not silently hidden by formatting.

For classroom, professional, engineering, scientific, or statistical work, use the result as a numerical aid and verify important inputs and conclusions independently. When a matrix factorization affects safety-critical, financial, engineering, research, or official decisions, check the computation with appropriate software, documentation, or a qualified professional.


How to Use This Calculator

  1. Choose the square matrix size, from \(2 \times 2\) through \(6 \times 6\).
  2. Enter a finite numeric value in every matrix cell, or paste a square matrix using rows of values separated by spaces, commas, semicolons, or tabs.
  3. Use the example controls when you want to load a known positive-definite example or a failing symmetric example.
  4. Set the displayed decimal precision from \(2\) to \(10\) places.
  5. Run the calculation and review the status message.
  6. Read the factorization identity, the \(L\) matrix, the \(L^T\) matrix, the reconstruction matrix, and the error metrics.
  7. Select a derivation row or highlighted lower-triangular cell to inspect the formula and substitution for that step.

Frequently Asked Questions

Why does the matrix have to be symmetric positive-definite?

The lower-form Cholesky factorization \(A = LL^T\) depends on taking real square roots of positive quantities. Symmetry gives the matrix the right mirrored structure, while positive definiteness keeps the diagonal Cholesky pivots positive in exact arithmetic.


Does every symmetric matrix have a Cholesky decomposition?

No. Symmetry is required, but it is not enough. A symmetric matrix with a negative or zero Cholesky pivot is not positive-definite for this standard positive-diagonal Cholesky factorization.


What is the difference between \(L\) and \(L^T\)?

\(L\) is the lower-triangular Cholesky factor, so entries above its diagonal are \(0\). \(L^T\) is the transpose of \(L\), which turns rows into columns and appears on the right side of the product \(LL^T\).


What does reconstruction error mean?

Reconstruction error measures how far the original matrix \(A\) is from the computed product \(LL^T\). A small value means the factorization is numerically consistent with the input matrix, allowing for normal rounding effects.


Why did my matrix fail even though it looks almost correct?

A matrix can fail if it is not symmetric within the calculator’s tolerance, if it is positive-semidefinite rather than positive-definite, or if a Cholesky pivot is too close to zero. Pasted data can also fail because of blank cells, invalid number tokens, uneven row lengths, or a non-square shape.


Sources and References

Books

  1. Gene H. Golub and Charles F. Van Loan. Matrix Computations. 4th ed., Johns Hopkins University Press, 2013. Relevant sections on positive definite systems, Cholesky factorization, and numerical matrix computations.
  2. Lloyd N. Trefethen and David Bau III. Numerical Linear Algebra. SIAM, 1997. Relevant chapters on systems of equations, conditioning, stability, and numerical matrix factorizations.

Online and Official Sources

  1. Netlib LAPACK. “DPOTRF.” LAPACK documentation. Accessed June 27, 2026.
  2. Sanjay Lall. “Cholesky Factorization.” EE263 lecture notes, Stanford University. Accessed June 27, 2026.
  3. Marco Taboga. “Cholesky Decomposition.” StatLect. Accessed June 27, 2026.
  4. W. Keith Nicholson. “8.3: Positive Definite Matrices.” Mathematics LibreTexts. Accessed June 27, 2026.
  5. Eric W. Weisstein. “Positive Definite Matrix.” Wolfram MathWorld. Accessed June 27, 2026.