Skip to content
Text

Remove duplicate lines from a list

Clean repeated entries out of a pasted list while keeping the first copy of each line. Choose if capitalisation matters and if you want the remaining entries sorted.

Runs in your browser — your input is not uploaded to ToolsNow.

Your list
0 chars0 words0 lines
Unique lines
0 chars0 words0 lines

How to use

  1. Paste one item per line. For example, use a column of email addresses or product codes. Entries on the same line are compared together.
  2. Choose what counts as a repeat. Leave Case sensitive on for distinct codes such as AB12 and ab12. Turn it off to merge lines that differ only in capitalisation.
  3. Review the remaining list. Blank lines are removed by default. Choose Keep blank lines or Also sort A → Z if needed, then use Copy result or Download.

Questions

Which copy is kept?

The first matching line, including its original spelling and spaces. The remaining entries keep their input order unless Also sort A → Z is on.

Are spaces ignored?

Spaces and tabs at either end are ignored for comparison, so " apple" and "apple" match. Spaces inside a line still matter: "red apple" and "red apple" are different. The kept line is not trimmed.

Does the removed count include blank lines?

Yes. It counts every input line dropped, including blank lines when Keep blank lines is off. With that option on, repeated blank lines are still duplicates, so only the first is kept.

Examples and checks

Paste a list to keep the first occurrence of each entry. Choose whether letter case matters and whether to keep a blank line, then review the cleaned list.

Keep the first occurrence

Input or situation
apple pear apple
Result
apple pear

The first apple remains in its original position; the later identical line is removed.

Check letter case

Input or situation
Apple apple
Result
Two entries when case-sensitive; one when case is ignored.

Turn off Case sensitive if these are two spellings of the same list item. The first spelling is kept.

Before you use the result

Published by ToolsNow. How tools and sources are checked · Report a problem

Read more

Related tools