LU Decomposition

Factor a matrix as L U with partial pivoting

About this calculator

The LU Decomposition Calculator factors a square matrix as P·A = L·U using Doolittle elimination with partial pivoting: P is a permutation matrix, L is unit lower-triangular, and U is upper-triangular. All arithmetic runs in 30-digit decimal precision so rational inputs stay exact. It reports the row swaps, the sign (−1)^swaps, the determinant from the diagonal of U, and the verification product L·U. Unlike inversion, singular matrices still factor — a zero pivot simply leaves 0 on U's diagonal and det = 0.

How to use the LU Decomposition calculator

  1. Enter the values for your problem into the input fields.
  2. Read the result — it updates instantly as you type.
  3. Check the formula and the visual explanation to follow how the answer was found.
  4. Copy the page URL to share the exact calculation.

Common examples

  • [[4,3],[6,3]] → one pivot swap, U = [[6,3],[0,1]], L₂₁ = 0.666…, det = −6
  • 3×3 [[2,1,1],[4,−6,0],[−2,7,2]] → U = [[4,−6,0],[0,4,1],[0,0,1]], det = −16
  • Singular [[1,2],[2,4]] → U = [[2,4],[0,0]], zero pivot on the diagonal, det = 0
  • [[0,1],[1,0]] → pure permutation: one swap, sign −1, det = −1

Frequently asked questions

How does the LU Decomposition calculator work?

Enter your values and the calculator applies the exact mathematical method for this problem, showing the result together with the formula it used. Everything is computed with high-precision arithmetic, so the answer you see is not limited by ordinary floating-point rounding.

When would I use the LU Decomposition calculator?

It is useful for homework and exam preparation, for checking work done by hand, and whenever a step in a larger problem needs this calculation done quickly and reliably.

How accurate are the results?

Calculations run at 30 significant digits of precision internally. Displayed values are rounded for readability, but the underlying result is far more precise than a typical hand or pocket-calculator computation.

Can I share a specific calculation with someone else?

Yes. Every value you enter updates the URL, so copying the address bar and sharing the link reopens the exact same calculation for whoever clicks it.