EditSafely

LU Factor a Matrix

Decompose into LU factors. Runs entirely in your browser, so your data never leaves your device.

0 chars · 0 lines

Output

The result appears here as you type.

Options

How to use LU Factor a Matrix

  1. 1. Paste your matrix. Enter a square matrix as rows separated by newlines and values separated by spaces. The tool factors it into a lower triangular matrix L and an upper triangular matrix U.
  2. 2. Set the decimal places. Choose Decimal places to control rounding of the L and U entries, since Doolittle-style elimination often produces fractions with long decimal expansions.
  3. 3. Read the L and U factors. The output shows L with ones on its diagonal below a zero upper triangle, and U with the eliminated rows above, together satisfying A = L times U.
  4. 4. Copy the factored result. Copy the L and U blocks from the output pane into your solver, homework writeup, or wherever the decomposition is needed next.

When to use LU Factor a Matrix

LU Factor a Matrix decomposes a square matrix into lower and upper triangular factors using Doolittle elimination with partial pivoting. Use it whenever you need L and U directly, for example to solve linear systems repeatedly without redoing elimination each time.

  • Solving multiple systems with the same matrix. In a numerical methods course you need to solve Ax = b for several different b vectors using the same A, and computing L and U once lets you do fast forward and back substitution for each.
  • Checking a hand-worked elimination. You performed Gaussian elimination by hand on a homework matrix and want to confirm your L and U factors match before writing up the final answer.
  • Understanding determinant computation via factorization. Since the determinant of A equals the product of U's diagonal entries once factored, you want to see the LU breakdown explicitly to understand where that shortcut comes from.
  • Testing a numerical library implementation. You are implementing your own LU decomposition routine in a small numerical library and want a trusted reference output for a handful of matrices to validate your pivoting logic.

Examples

LU factors without pivoting

Input

4 3
2 1

Output

L:
1 0
0.5 1

U:
4 3
0 -0.5

LU factors with a row swap

Input

4 3
6 3

Output

P:
0 1
1 0

L:
1 0
0.666667 1

U:
6 3
0 1

About the LU Factor a Matrix tool

LU Factor a Matrix does its work locally, right in the browser. Decompose into LU factors. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the Math Tools collection on EditSafely, a set of 234 small, focused Math utilities that share the same instant, private workspace.

You can shape the output with the Decimal places setting, and the result refreshes the moment you change it. 2 worked examples further down the page show exactly what the tool produces for real inputs.

Running locally also makes the tool fast and dependable: results appear as you type or drop a file, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Does LU Factor a Matrix cost anything?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.

Related tools

All Math Tools