Create & Write
Sort & Remove Duplicate Lines
Got a messy list? Paste it to remove repeated lines, clean up spaces and sort it A to Z, by length or in natural order.
Your list stays on your device. It is processed in your browser and is not uploaded, saved or logged.
How to use it
- Paste your list into the first box, one item per line.
- Turn the options on or off. The result updates right away.
- Pick a sort order if you want one, then copy the result.
What the options do
- Remove duplicate lines keeps the first copy of each line and drops the rest.
- Ignore upper and lower case treats “Apple” and “apple” as the same line.
- Trim spaces removes spaces at the start and end of each line, so “apple ” matches “apple”.
- Remove empty lines deletes blank lines. Lines that only contain spaces count as empty.
Sort orders
- A to Z and Z to A follow your browser’s language rules, so accented letters sit with their base letter.
- Natural reads numbers as numbers, so “item 2” comes before “item 10”.
- Shortest first orders by the number of characters. Lines of the same length keep their original order.
- Reverse flips the order of the lines.
Order of the steps
The tool first trims spaces, then removes empty lines, then removes duplicates, and sorts last.
Tested, not guessed
Every number below comes from running this tool, not from a guess.
Example
This list:
banana
Apple
cherry
apple
(empty line)
banana
item 10
item 2
With duplicates removed (ignoring case), empty lines removed and natural sorting, you get:
Apple
banana
cherry
item 2
item 10
(2 duplicates and 1 empty line removed. Note that item 2 comes before item 10.)
How fast it is
We timed the real code in Chrome 153.0.8010.12. Working on 100,000 lines (dedupe + sort A to Z), it took about 188 milliseconds (median of 5 runs, on a 2-core cloud server). Your phone may be slower, but nothing here waits for a server.
Frequently asked questions
Which copy of a duplicate is kept?
The first one. Later copies are removed. If you also sort, the kept lines are then sorted.
Does sorting treat uppercase and lowercase the same?
By default “apple” and “Apple” are different lines but sit next to each other. Turn on “Ignore upper and lower case” to treat them as equal.
How large a list can I paste?
Thousands of lines work fine. Very large lists depend on your device, because everything is processed in your browser.
Is my list sent to a server?
No. Everything happens in your browser.