Remove duplicate lines

Paste a list and instantly remove all duplicate lines. Options to sort, trim, and ignore case.

How duplicate removal works

This tool processes text line by line, removing any line that has already appeared earlier in the input. The algorithm splits the input on newline characters, iterates through each line, and uses a Set (or equivalent deduplication structure) to track lines seen so far — only outputting a line the first time it appears.

Options available: Case-sensitive comparison (default) treats "Apple" and "apple" as different lines. Disabling this normalises all lines to lowercase before comparing, so all case variants of the same word are treated as duplicates. Sort output alphabetically orders the deduplicated lines, useful for creating clean sorted lists. Trim whitespace strips leading and trailing spaces from each line before comparison, preventing near-duplicates caused by accidental spaces. The original order of first appearances is preserved when sorting is disabled. This is useful for deduplicating email lists, log entries, word lists, CSV rows, and any line-based data.

Frequently asked questions

How does duplicate line removal work?

The tool splits input text into lines and removes any line that has appeared before it in the document. The first occurrence of each line is kept; all subsequent duplicates are removed. Original line order is preserved by default.

Is the comparison case-sensitive?

By default, yes — 'Apple' and 'apple' are treated as different lines. You can disable case-sensitivity, which normalises all lines to lowercase before comparing, so all case variants of the same text count as duplicates of each other.

Does it remove blank lines?

Blank lines are treated as regular lines — if you have multiple blank lines, all but the first are removed. To remove all blank lines, enable the option, or you can filter them manually after deduplication.

What is the maximum input size?

There is no server-side limit — processing happens entirely in your browser. Very large inputs (millions of lines) may slow the browser, but typical use cases (thousands of lines) work instantly.

Related tools

Text diff → Word counter → Case converter →