Skip to content

PLU decomposition calculator

Factor a 2×2 or 3×3 matrix using partial pivoting and check P·A = L·U.

Inputs

Processed in your browser.

Live preview · not yet confirmed

Separate columns with spaces and rows with semicolons: 0 2; 3 4

Calculation steps · Live preview · not yet confirmed

Result

Calculate to confirm the current inputs.

How to use

Enter a square 2×2 or 3×3 numeric matrix, then calculate. The original matrix preview updates during editing. Confirmed results show P, L, U, both matrix products and elimination steps. This factorization is useful for learning how elimination is organized; it does not solve a right-hand-side vector.

Read the result

At each column, partial pivoting selects the remaining entry with largest absolute value. P records row swaps, L contains elimination multipliers with ones on its diagonal, and U is upper triangular. Only rows changed by the current operation are highlighted. The convention here is P·A = L·U, equivalently A = Pᵀ·L·U. Never compare P directly with a source using A = P·L·U.

Example

For A = 0 2; 3 4, P = 0 1; 1 0, L = 1 0; 0 1 and U = 3 4; 0 2. Thus both P·A and L·U equal 3 4; 0 2. For A = 2 1; 1 3, no swap is needed and L₂₁ = 0.5, U₂₂ = 2.5.

Limits and errors

Maximum 3×3 and 300 characters. Use decimal points or e notation, with nonzero input magnitudes 10⁻⁹–10⁹. A pivot of magnitude ≤ 10⁻¹² times the largest absolute input is rejected as singular or numerically unsafe. The max-entry residual is divided by that input scale. A small residual is not a condition-number estimate. Rounded matrix displays may not multiply exactly; verification uses unrounded values.

Frequently asked questions

Why is a singular matrix rejected?

Some singular matrices still admit factorizations, but this bounded teaching tool stops on a zero or unsafe pivot instead of presenting a reliable nonsingular decomposition. Check the input and its scale. It does not fabricate missing pivots or a unique solution.

Can I edit or copy the result?

Editing invalidates the confirmed result and disables Copy. Calculate again before copying. Clear leaves the fields empty. The pale example runs immediately; the first focus in a value field clears all example values once.

Sources: NIST · Jampack