Skip to content

Line Tools

Remove duplicate or empty lines, sort, trim and tidy text line by line

Loading the tool…

Tidies a list with one item per line: removes duplicate and empty lines, sorts alphabetically, trims spaces and more. Use it to clean up a list of names or keywords copied from a spreadsheet.

How to use

  1. Paste your list into "Input".
  2. Press step buttons such as "Remove duplicates", "Remove empty lines" or "Sort". Each step is applied to the "Result" in the order you press them.
  3. If you pressed the wrong one, "Undo" removes the last step and "Undo all steps" returns to the original text.
  4. Press "Copy" or "Download" to take the result.

How it works

Questions and answers

Can I remove duplicate lines without changing the order?
Yes. "Remove duplicates" does not sort; it keeps the first occurrence. "apple, banana, apple" becomes "apple, banana".
Why does item10 come before item2 when I sort?
A normal sort compares character by character, and 1 comes before 2. Choose "Natural (2 before 10)" under "Sort order" to get item2 before item10.
How do I join lines into one line separated by commas?
Enter ", " as the "Separator" and press "Join into one line"; all non-empty lines are joined with commas. "Split at separator" does the opposite.
Can I keep only the lines that contain a word?
Enter the word under "Find" and press "Keep matching lines". To delete those lines instead, press "Remove matching lines".