How it works
Choose what to do with your list, one item per line. Remove duplicate lines keeps the first time each line appears and drops later copies, so the original order is kept. Two lines are duplicates only when they match exactly, unless you turn on ignoring case or trimming spaces. With trimming on, the kept lines are trimmed too. Empty lines count as one line like any other, so repeated blank lines are reduced to one.
Sort lines A to Z and Z to A use the English alphabetical order of your browser, which sorts upper and lower case together and puts accented letters next to their base letters. Sort by length puts the shortest lines first, counting visible characters, and sorts equal lengths alphabetically. Natural number order reads digits as numbers, so "item 2" comes before "item 10", which plain alphabetical order gets the other way round. Lines that compare equal keep their original order.
Reverse line order turns the list upside down. Remove empty lines deletes lines that are empty or contain only spaces. Add line numbers puts "1. ", "2. " and so on in front of each line. After every action the page shows how many lines went in, came out and were removed.
Check it by hand: the sample has 9 lines (including 1 empty line): banana, apple, Cherry, apple, banana, Apple, empty, date, cherry. With case counted, the second apple and the second banana repeat an earlier line, so 2 lines are removed and 9 − 2 = 7 remain. Apple, Cherry and cherry stay because the capital letters make them different from apple and Cherry.
Worked example
The sample list has 9 lines: banana, apple, Cherry, apple, banana, Apple, an empty line, date and cherry. Removing duplicates with the case rule on exact matching drops the second "apple" and the second "banana": 2 lines removed and 7 left (banana, apple, Cherry, Apple, empty, date, cherry).
With "Ignore upper and lower case" set to yes, "Apple" and "cherry" are removed as well: 4 lines removed, 5 left.
Good to know
- Lines are compared as whole lines. Two lines that look the same but differ in a hidden space or a different kind of apostrophe are treated as different, so try the trim option first.
- Alphabetical order follows English rules. Other languages sort some letters differently, for example ä in Swedish.
- Very long text is refused above 1,000,000 characters so the page stays fast.
Questions people ask
How do I remove duplicate lines from a list?
Paste the list, leave the action on "Remove duplicate lines" and copy the result. The first occurrence of each line is kept in its original place, and the count of removed lines is shown.
Does it keep the original order?
Yes. Duplicate removal keeps the first copy of each line where it was. Use one of the sort actions if you want the list reordered.
How do I sort a list alphabetically?
Choose "Sort lines A to Z" and copy the result. Choose "Sort lines Z to A" for reverse alphabetical order. Upper and lower case are sorted together, so "apple" and "Banana" come out in the order you expect.
Why does "item 10" come before "item 2" when sorting A to Z?
Alphabetical sorting compares character by character, and "1" comes before "2". Choose natural number order to read the digits as numbers, so item 2 comes first.
Can it ignore capital letters when finding duplicates?
Yes. Set "Ignore upper and lower case" to yes and "Apple" and "apple" count as the same line. The first one found is the one kept.
Is my list uploaded?
No. Everything is done in your browser and nothing is sent to a server.
Is Apple a duplicate of apple?
Only if you turn on ignore case. By default they are different lines. With ignore case on, Apple, apple and banana become Apple and banana, with 1 line removed.
Part of the guide: Text tools: word counter, case converter, duplicate lines and more