How to use the text cleanup (remove duplicates, sort lines)
- Paste your list into Your lines, one item per line. A sample list is there to try.
- Tick what you want: remove duplicate lines, remove empty lines, trim spaces or keep only repeated lines. Choose whether upper and lower case count as different.
- Pick a Sort order such as A to Z, shortest first, numbers in order or reverse order, and tick Add line numbers if you want them.
- Read the counts, then press Copy result. Use result as input lets you run another round on what you got.
The order the steps run in
The steps always run in the same order: trim the spaces at the ends of each line, remove empty lines, remove duplicates, sort, and finally add numbers. Doing them in this order means a line with stray spaces is trimmed first, so it can be recognized as a duplicate of the same line without them.
When duplicates are removed, the first copy stays and later copies go, so a list you do not sort keeps its original order. With the box for repeated lines ticked, the tool does the reverse: it lists each line that appears more than once, one time each, which is a quick way to find what was entered twice.
How sorting works
A to Z compares letters without regard to case and treats an accented letter as its base letter, so apple, Apple and Äpfel stay together. When two lines are equal apart from case, the capital comes first so the result is the same every time. Numbers in order reads digits as numbers, so item 2 comes before item 10, which plain alphabetical order would reverse.
The length sorts compare the number of characters in each line. Reverse simply flips the order you have. Lines are compared as text, so a list of dates in the form 10/02/2026 is sorted as text, not by date. For comparing two lists, find what they share or where they differ with the compare two lists tool, or see line by line changes in the diff checker.
Good uses and limits
Typical jobs are cleaning an email or keyword list, finding repeated entries in a list of names, alphabetizing a bibliography or putting items in order before pasting into a spreadsheet. To change capitals use the case converter, and to put a list in random order use the list randomizer.
The text is limited to 2,000,000 characters. Everything runs in your browser and nothing is uploaded.
Assumptions and limits
- A line is any text between line breaks. Windows, Unix and old Mac line endings are all understood.
- Duplicates are compared as whole lines. Two lines that differ by one space are different unless you trim first.
- Case matching is on by default for duplicates being the same regardless of case. Turn on the case box to treat them as different.
- Sorting uses English rules for letters. Other languages may expect a different order.
Frequently asked questions
How do I remove duplicate lines from a list?
Paste the list, keep Remove duplicate lines ticked, and copy the result. The first copy of each line stays and later copies are dropped, and the page shows how many were removed.
Does it treat Apple and apple as the same line?
By default yes, so only the first one stays. Tick the box that treats upper and lower case as different if you want to keep both.
Why does 10 come before 2 when I sort A to Z?
Alphabetical order compares one character at a time, and 1 comes before 2. Choose Numbers in order and the digits are read as whole numbers, so 2 comes before 10.
How can I see only the lines that appear more than once?
Tick Keep only lines that appear more than once. Each repeated line is shown one time, in the order it first appears.