Remove Duplicates & Sort Lines
About the Remove Duplicates & Sort Lines
Paste a list and clean it up in one pass: remove duplicate lines, trim stray spaces, drop empty lines and sort what is left. It is handy for email lists, keywords, tags, log lines and any other one-item-per-line text.
How to use it
- 1 Paste your list into Input lines, one item per line.
- 2 Tick the options you need: Remove duplicate lines, Trim whitespace, Ignore case and Remove empty lines.
- 3 Pick a Sort order: No sorting, A to Z or Z to A.
- 4 Click Copy above Cleaned output to copy the result.
Frequently asked questions
The first occurrence of each line is kept and later repeats are removed, so the list keeps its original order unless you also choose a sort order.
With Ignore case on, lines that differ only in capitalization, such as "Apple" and "apple", count as duplicates, and sorting ignores capitalization too. Turn it off to treat them as different lines.
Whitespace is trimmed first, then empty lines are removed, then duplicates, and sorting runs last. Because trimming comes first, lines that differ only by leading or trailing spaces are caught as duplicates.
Sorting is natural, so numbers inside lines are compared by value: "item 2" comes before "item 10" rather than after it.
Input is capped at 100,000 characters. Anything longer is trimmed to the first 100,000 characters, and a notice tells you when that happens.