Duplicate Lines Remover
Remove duplicate lines from pasted or uploaded text. Choose case-sensitive or case-insensitive matching, trim whitespace before comparing, keep the first or last occurrence, drop blank lines, and preserve or sort the output order — with a lines-in/lines-out summary.
Input
When off, "Apple" and "apple" are treated as duplicates.
Ignores leading/trailing spaces when checking for duplicates (the original line is kept as-is).
Output
Stats
| Metric | Value |
|---|---|
| No data yet | |
Guides
What this tool does
Paste a list — emails, log lines, keywords, CSV rows, URLs — and this tool strips out every repeated line, leaving only unique entries. It's a common cleanup step before importing data into a spreadsheet, deduplicating a mailing list, tidying a keyword list for SEO work, or trimming a log file down to distinct messages.
How to use it
- Paste your text into the Text to Deduplicate box, or upload a
.txtfile directly. - Adjust the options below to match how you want duplicates detected and handled.
- The Deduplicated Text box updates automatically, along with a stats table showing lines in, blank lines removed, duplicate lines removed, and lines out.
- Copy or download the result.
Options explained
- Case-sensitive comparison — on by default, so
Appleandapplecount as different lines. Turn it off to treat different capitalizations as duplicates. - Trim whitespace before comparing — ignores leading/trailing spaces when checking for a match (e.g.
"cat"and"cat "are treated as the same line), without altering the actual line content that gets kept. - Remove blank lines — strips every empty or whitespace-only line from the output, independent of duplicate detection.
- Which occurrence to keep — when a line repeats, keep the first time it appeared or the last. Keeping the last occurrence is useful when a later entry in a list (e.g. an updated status) should win.
- Output order — preserve keeps lines in their original order; sort A → Z alphabetizes the deduplicated result.
Example
Input:
apple
Apple
banana
Banana
grape
apple
With case-sensitive comparison, only the second apple is removed (5 lines out). With case-insensitive comparison, Apple/Banana/the second apple are all treated as duplicates of the first occurrence of apple/banana, leaving just apple, banana, grape (3 lines out).
Why not just use a spreadsheet?
Spreadsheet "remove duplicates" features are case-insensitive-only, don't let you choose first-vs-last occurrence, and require importing/exporting a file. This tool works directly on plain text, so it fits scripts, CSV columns pasted as text, and quick one-off cleanups without opening another app.
Privacy
This tool runs entirely in your browser — your text never leaves your device or touches a server, even when using the file upload.