Skip to main content
ToolsBay

Remove Duplicate Lines

Strip repeated lines from a list, optionally ignoring case.

Runs entirely in your browser — nothing is uploaded

Your list

1 line

Result

1 line

Frequently asked questions

Which duplicate is kept?

The first one. Everything keeps its original order, so the list is deduplicated without being reshuffled. If you want it ordered as well, run the result through the sort tool.

Does it treat "Apple" and "apple" as the same line?

Only if you turn on "ignore case". By default the comparison is exact, because for things like case-sensitive IDs or passwords a case-insensitive match would silently discard real data.

What about lines that differ only in trailing spaces?

Turn on "trim whitespace". It strips leading and trailing spaces before comparing, and the trimmed version is what appears in the output.

Deduplicating a list

Removing repeated lines is the sort of thing a spreadsheet can do but rarely without a fight. Paste the list here and it happens as you type, with the original ordering preserved — the first occurrence of each line stays where it was.

The three options exist because “duplicate” is not one definition. Two lines that differ only in capitalisation are duplicates in a list of email addresses but not in a list of API keys. Two lines that differ only in trailing whitespace are almost always duplicates, but the whitespace is invisible so the problem is hard to spot. Turn on whichever rules match your data.

Next steps

To put the deduplicated list in order, use sort lines alphabetically. To see what changed between two versions of a list, the text compare tool shows a line-by-line diff.

All text utilities