Remove Duplicate Lines

Paste a list of lines โ€” instantly remove duplicates. Keep first or last occurrence, case-sensitive or not, trim whitespace, sort the result.

Keep:
Input lines: 0
Unique: 0
Duplicates removed: 0

About This Tool

Got a list with duplicates? Paste it here and get clean, unique lines instantly. No signup, no file upload โ€” just paste and go. This tool works for anything: email lists, CSV columns, log files, URLs, keywords, to-do lists, inventory data, or any text with repeated lines. It processes everything in your browser โ€” nothing is sent to a server. Options let you control exactly how deduplication works: case-sensitive or not, keep the first or last occurrence, trim extra whitespace, and optionally sort the result alphabetically. The stats bar shows how many duplicates were found so you know exactly what changed.

How to Use

1. Paste your text into the input box (one item per line) 2. Duplicate lines are removed automatically โ€” the result appears instantly 3. Toggle options: case sensitivity, keep first/last occurrence, trim whitespace, sort output 4. See the stats: total lines, unique lines, duplicates removed 5. Click "Copy" to copy the cleaned text to your clipboard 6. Use "Copy Link" to share a specific configuration

Frequently Asked Questions

How do I remove duplicate lines from a text file?
Paste the contents of your text file into this tool. Duplicates are removed automatically and you get a clean list of unique lines. Click 'Copy' to get the result, then paste it back into your file. For very large files, this tool handles thousands of lines instantly in your browser.
Does this tool preserve the original order?
Yes, by default. When 'Keep first occurrence' is selected, lines appear in the same order as the original text, with duplicates removed. When 'Keep last occurrence' is selected, the last appearance of each line determines its position. You can also sort the output alphabetically.
Is the comparison case-sensitive?
By default, yes โ€” 'Apple' and 'apple' are treated as different lines. Toggle 'Ignore case' to treat them as duplicates. When case-insensitive mode is on, the kept occurrence preserves its original capitalization.
How do I remove duplicates from a CSV column?
Copy the column from your spreadsheet (which gives you one value per line), paste it into this tool, and the duplicates are removed. Copy the result back to your spreadsheet. For multi-column CSV deduplication, use a spreadsheet's built-in 'Remove Duplicates' feature.
Is my data safe? Is it sent to a server?
Your data never leaves your browser. All processing happens locally in JavaScript. Nothing is uploaded, stored, or transmitted. This is a 100% client-side tool โ€” you can even use it offline after the page loads.
Can I remove duplicate lines from a large file?
Yes. This tool processes text instantly in your browser and handles thousands of lines without issues. For extremely large files (100,000+ lines), performance depends on your device, but modern browsers handle it well.
What counts as a duplicate line?
Two lines are duplicates if they have exactly the same text content. Leading/trailing whitespace can be trimmed with the 'Trim whitespace' option so that ' hello ' matches 'hello'. Empty lines can also be removed with the 'Remove empty lines' option.