Skip to content
toolsdocks

Remove repeated lines from text

Paste a list to keep one copy of each line in its original order, and see exactly which lines were removed.

Runs on your device
Loading tool…

How to use

  1. Paste lines.
  2. Choose Ignore case / Trim spaces / Remove empty lines.
  3. Copy the unique lines or the removed ones.

Worked example

apple, Apple, banana, apple with Ignore case becomes apple, banana (2 removed).

Supported formats and limits

InputText
OutputText
EngineOrder-preserving set with normalization options

Limitations

  • Lines are compared exactly after the chosen normalizations.
  • With Trim spaces on, the kept lines are also written without leading and trailing spaces.

Questions

How do I get only the unique lines from a list?

Paste the list and the result keeps one copy of every line, in the order it first appeared. Turn on ignore case or trim spaces if lines that differ only in capitals or spacing count as the same.

Which copy of a duplicate is kept?

The first occurrence, in its original position. With Ignore case on, “apple, Apple, banana, apple” keeps apple and banana and removes 2 lines.

Can I see what was removed?

Yes. The Removed lines view lists each removed line with its line number and the line it repeats, and Repeated values lists every value that occurred more than once with its count. Both can be copied or downloaded.

Are blank lines treated as duplicates?

No. Blank lines are either all removed (Remove empty lines, on by default) or all kept as layout.

Privacy

Runs on your device. Files and text are processed in this browser tab and are not uploaded.

See the privacy policy for how toolsdocks handles data.