Sort Lines

Paste a list and sort its lines alphabetically, with natural number order, numerically, by length, in reverse order or shuffled. Case sensitivity and empty line removal are optional.

Use the tool

Why this tool exists

Sorting a list sounds trivial until the details matter. Alphabetical order puts file10 before file2, numbers stored as text sort wrongly, and capitals can jump ahead of lowercase letters. Spreadsheets can sort, but opening one to tidy a short list is overkill.

This tool sorts the lines you paste. Alphabetical mode follows locale rules and ignores case unless you ask for it. Natural mode understands numbers inside text, so file2 comes before file10. Numeric mode sorts by the first number in each line, with lines that have none placed last. You can also sort by length, reverse the order or shuffle randomly. Empty lines can be dropped, and sorting can be descending. It all happens in your browser.

How to use it

  1. Paste your list into the input box, one item per line.
  2. Choose a mode: alpha, natural, numeric, length, reverse or shuffle.
  3. Set descending, case sensitivity and whether to drop empty lines.
  4. Run the tool and copy the sorted list.

Frequently asked questions

What is natural sort?

It compares the numeric parts of lines as numbers, so file2 sorts before file10. Plain alphabetical order compares character by character and would put file10 first.

How does numeric mode treat lines without numbers?

It sorts by the first number found in each line, ignoring thousands commas. Lines with no number go to the end and are ordered alphabetically among themselves.

Is the shuffle truly random?

It uses a standard Fisher-Yates shuffle with the browser's Math.random, which is fine for ordering a list but not for security-sensitive draws.

Is my list uploaded?

No. The text is processed in your browser and is not uploaded, stored or sent to a server, so it is fine to use with drafts, lists and private notes.