About this tool
Sorting and cleaning a list by hand is slow, and a spreadsheet is overkill for a plain text list. Paste one item per line and this tool sorts alphabetically, by length or by number, reverses or shuffles the order, and removes duplicate or empty lines. Results update as you type, in a single pass over the text.
Natural ordering puts file2 before file10, and the case-insensitive option treats Apple and apple as the same line when sorting and removing duplicates. Whitespace trimming runs first, so stray spaces do not hide matches. The tool is built to handle lists of 100,000 lines, and all processing stays in your browser.
How to use the Sort Lines
- 1Paste your list into the input box with one item on each line.
- 2Choose a sort order, or pick None to keep the original order.
- 3Switch on the options you need, such as natural order, duplicate removal or trimming.
- 4Read the line counts and the duplicate total underneath the two boxes.
- 5Copy the output or download it as lines.txt.
Features
Eight sort orders
Choose none, A to Z, Z to A, shortest or longest first, numeric, reversed or shuffled order.
Natural number order
Place file2 before file10 instead of comparing digits one character at a time.
Duplicate removal
Keep the first copy of each repeated line, with an optional case-insensitive comparison.
Cleanup switches
Trim leading and trailing spaces and drop blank lines before the list is sorted.
Large list support
Work through lists of 100,000 lines in one pass, with a short pause after you stop typing.
Frequently asked questions
How does natural order differ from alphabetical order?
Alphabetical order compares character by character, so file10 sorts before file2. Natural order reads the digits as a whole number and places file2 first.
Which duplicate is kept?
The first occurrence is kept and later copies are removed. The number of removed lines is shown below the two boxes.
How are lines without numbers handled in numeric sort?
Each line is read from its start as a number, ignoring thousands commas. Lines that do not begin with a number are placed after the numbered ones, in their original order.
Can I shuffle the lines more than once?
Yes. Choose Shuffle, then click Shuffle again to get a different random order each time.
Is my list uploaded when I sort it?
No. Sorting and duplicate removal run in your browser, and the list is not stored after you close the tab.