Sort and Dedupe Lines
Sort lines alphabetically or numerically, remove duplicates and empty lines, trim whitespace, reverse or shuffle the order. Runs in your browser.
Sort lines alphabetically or numerically, remove duplicates and empty lines, trim whitespace, reverse or shuffle the order. Runs in your browser.
Clean up lists quickly. Paste one item per line, pick an operation and get the result straight away.
Use it for tidying keyword lists, deduplicating emails or IDs, and sorting config entries.
Sorting text sounds trivial, but the comparison rule changes the outcome. A plain alphabetical sort compares character by character, so the line 10 comes before 9 because the character 1 is smaller than 9. Numeric sorting compares the values instead, which is why it is the right choice for IDs, prices and version-like counters. Mixed lists, where some lines have numbers and others do not, need extra care because lines without a leading number are treated as zero and gather at the top.
Deduplication works on exact line content, so a trailing space or a different letter case makes two otherwise identical lines count as different. That is why trimming whitespace and the Ignore case option matter before you remove duplicates. Keeping the first occurrence preserves the original order of unique items, which is useful when the order of discovery carries meaning, such as the sequence of entries in a crawl log or a ranked keyword export.
The first occurrence. Later copies are removed.
Apple and apple are treated as the same line when sorting and deduplicating.
Lines are compared by the number at the start. Lines without a number count as 0.
No. It is processed in your browser.
Blank lines are ordinary empty strings, so they sort to the top in ascending order. Use the remove empty lines option first if you want them gone before the list is sorted.
Lines that compare as equal, for example Apple and apple with Ignore case on, stay in their original relative order in modern browsers, because JavaScript array sorting is specified as stable.