Remove Duplicate Lines

Remove duplicate lines from text with options to ignore case, trim whitespace, or sort lines.

1
1
Lines: 0Duplicates removed: 0

Removes repeated lines from a list — emails, keywords, URLs, names — keeping the first occurrence of each line in its original order. The count under the result shows how many duplicates were removed.

Options

  • Ignore case — on by default: “Apple” and “apple” count as the same line.
  • Ignore whitespace — on by default: spaces at the start or end of a line don't make it different.
  • Sort lines alphabetically — sorts the unique lines instead of keeping their original order.
  • Remove empty lines — on by default: drops every blank line, including lines of only spaces. These are not counted as duplicates.

The options affect only how lines are compared; the line that is kept appears exactly as you typed it. With empty lines kept, blank lines dedupe like any other line, so only the first stays.

Examples

An email list, with the default options

Text
anna@example.com
Ben@example.com
anna@example.com 
ben@example.com
Revealed
anna@example.com↵
Ben@example.com↵
anna@example.com·↵
ben@example.com
Result
anna@example.com
Ben@example.com

Shown with · for a space, → for a tab and ↵ for a line break.

2 duplicates removed: the second “anna” differs only by a trailing space, and “ben” only by case.

The same list, matching case

Ignore case
Off
Result
anna@example.com
Ben@example.com
ben@example.com

With ignore case off, both spellings of Ben stay: 1 duplicate removed.

See also

  • Sort Text Lines — for more sorting options, including reverse and random.