Duplicate Line Remover

Remove duplicate lines from a block of text, keeping the first occurrence

Input text

Deduplicated result

Nothing you paste here is ever sent anywhere — duplicates are removed entirely in your browser.

About this tool

This tool walks your text line by line and keeps only the first time each unique line appears, discarding every later repeat while preserving the original order of what remains. It's handy for cleaning up exported lists, log files, CSV-like data, or any paste job where the same line got duplicated by accident. With the whitespace option on, lines that differ only by leading or trailing spaces are still treated as duplicates.

Does it keep the first or the last occurrence of a duplicate?

The first occurrence is kept and every later repeat of that exact line is removed, so the overall line order in your original text is preserved.

Is the comparison case-sensitive?

Yes — "Apple" and "apple" are treated as different lines, since capitalization can be meaningful in things like code or identifiers.

What does the "ignore leading/trailing whitespace" option do?

When it's on, lines are compared after trimming spaces from both ends, so " hello" and "hello" count as the same line for duplicate detection — but the version kept in the output is exactly as it appeared originally.

Keeping one copy of each line

Paste a list with one item per line and every repeat is dropped. The first time a line appears it stays; later copies go. The order of what's left is the order you started with, so the list doesn't get shuffled behind your back.

People reach for it with email lists, keyword lists, log files, URL lists and anything exported from a database where the same value turns up more than once. There's a trim option, on by default, which ignores spaces at the start and end of a line when deciding whether two lines match, so duplicates that differ only by an invisible trailing space still get caught.

Lines that differ in capitalization, like Apple and apple, are different lines. If you need those treated as the same, lowercase the list first.

A quick example

Before
apple
banana
apple
cherry
banana
After
apple
banana
cherry

Good to know

Blank lines count as lines too, so only the first empty line survives. If you were relying on blank lines to separate paragraphs, you'll need to put them back.