Remove Duplicate Lines

Removes repeated lines from a list and keeps the first copy of each, in the original order. Use it to tidy email lists, keyword lists, log extracts or any set of items where each entry should appear only once.

Up to 1 MiB.

Options

How to use the Remove Duplicate Lines

  1. Paste a list with one item per line.
  2. Choose whether to Ignore upper and lower case and Ignore spaces at the start and end of lines when comparing.
  3. The first occurrence of each line is kept, in the original order. The status line shows how many duplicates were removed.

Rules applied

  • Empty lines are kept unless you turn off Keep every empty line.
  • Accented letters typed in different ways (precomposed or combining) count as the same line.
  • To see how often each line repeats, use the Duplicate Line Counter (coming soon). To compare two lists use List Difference.

Limitations

  • When comparing case-insensitively, the first spelling found is the one kept.

Worked examples

Remove repeated items

Input

apple
banana
apple
cherry
banana

Result

apple
banana
cherry
Ignore case and spaces

Input

Apple
apple 
APPLE
Banana

Result

Apple
Banana

Practical uses

  • Cleaning a mailing list

    A club secretary collects email addresses from several sign-up sheets, and some people appear more than once. They paste the combined list into the tool and the repeats are removed, keeping the first of each in its original order. The status line shows how many duplicates were taken out.

  • Tidying a keyword list

    A marketer merges keyword ideas from two spreadsheets and finds the same terms written with different capital letters. They turn on Ignore upper and lower case so entries that differ only by capitals count as the same. The result is a single clean list of keywords.

  • Reducing a long to-do list

    A project manager combines notes from three meetings, and several tasks were written down more than once. They paste all the notes into the tool and remove the repeated lines. The shorter list is easier to share and to work through.

Privacy: this tool runs entirely in your browser. Your text is not uploaded, logged or saved, and it is never sent to analytics. Maximum input: 1 MiB.