LU Decomposition Calculator

Quick answer

The LU decomposition calculator factors a square matrix into a lower triangular L (with ones on the diagonal) and an upper triangular U, using row swaps (PA = LU) when needed.

Result
A = L·U
L (lower triangular)
⎡ 1 0 0 ⎤ ⎢ 1/4 1 0 ⎥ ⎣ 1/2 −2/11 1 ⎦
U (upper triangular)
⎡ 4 1 2 ⎤ ⎢ 0 11/4 −1/2 ⎥ ⎣ 0 0 43/11 ⎦

LU decomposition is the matrix form of Gaussian elimination. Once A = LU is known, any system Ax = b is solved quickly by forward and back substitution – ideal when solving with many right-hand sides.

How to use the LU Decomposition Calculator

  1. Choose the matrix size – the matching grid of fields appears.
  2. Enter the entries row by row (a₁ b₁ c₁ is the first row, a₂ b₂ c₂ the second, and so on).
  3. Read the result; integer matrices give exact fractions.

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Doolittle’s algorithm computes the rows of U and the columns of L in turn. If a zero pivot appears, rows are swapped and the permutation is reported.

Formula

A = L·U (or P·A = L·U with a permutation matrix P)

Worked example

Inputs — Matrix size: 3 × 3; a₁: 4; b₁: 1; c₁: 2; a₂: 1; b₂: 3; c₂: 0; a₃: 2; b₃: 0; c₃: 5.
Results — Result = A = L·U; L (lower triangular) = ⎡ 1 0 0 ⎤
⎢ 1/4 1 0 ⎥
⎣ 1/2 −2/11 1 ⎦; U (upper triangular) = ⎡ 4 1 2 ⎤
⎢ 0 11/4 −1/2 ⎥
⎣ 0 0 43/11 ⎦.

Key terms

Triangular matrix
A matrix with zeros above (lower) or below (upper) the diagonal.

Frequently asked questions

Does every matrix have an LU decomposition?

Every invertible matrix has a PA = LU decomposition; without row swaps it may not exist.

What is the determinant from LU?

The product of U's diagonal (times ±1 for swaps).

How do I solve Ax = b with LU?

Solve Ly = Pb, then Ux = y.

What is Doolittle vs Crout?

Doolittle puts ones on L's diagonal, Crout on U's.

Sources

  1. Wolfram MathWorld – LU decomposition
  2. MIT OpenCourseWare – 18.06 Linear Algebra (Gilbert Strang)
  3. Jim Hefferon – Linear Algebra (free textbook)

Cite this calculator

Speedy Calculator. (2026). LU Decomposition Calculator. Speedy Calculator. https://speedycalculator.com/calculators/math/lu-decomposition/