Remove Duplicate Lines
Remove duplicate lines from any block of text. The first occurrence of each line is kept; subsequent copies are dropped. Original order preserved.
apple
banana
apple
cherry
banana → apple
banana
cherry
Remove duplicate lines from any block of text. The first occurrence of each line is kept; subsequent copies are dropped. Original order preserved.
apple
banana
apple
cherry
banana → apple
banana
cherry
Removes duplicate lines from a block of text. The first occurrence of each line is kept and every subsequent duplicate is dropped, so original ordering is preserved. Comparison is exact and case-sensitive — "Apple" and "apple" are treated as different lines.
Useful for cleaning up word lists, log files, exported CSVs, scraped output, anywhere you have a chance of repeated content. Runs entirely in your browser — your text never leaves the page.
Pasted email exports often contain duplicates from form-fill mistakes or merge artefacts. Remove duplicates before importing into a CRM or sending a campaign.
Compiling a vocabulary list, brand-name brainstorm, or keyword set? This tool gives you a clean unique list in one paste.
Identical log lines from a noisy service can drown out the real signal. Strip duplicates to see the unique events.
Paste a single CSV column and get back the unique values. Faster than opening a spreadsheet for a one-off task.
Linter or compiler output sometimes repeats the same warning across builds. Dedupe to focus on the unique problems.
The tool splits input text into lines using the newline character (\n). It normalizes line endings from CRLF (\r\n) to LF to ensure consistent splitting across platforms. Each line is then processed sequentially: an internal hash set records the exact content of each line (case‑sensitive, whitespace‑sensitive). If a line is not yet in the set, it is appended to the output and added to the set; if it is already present, it is skipped. The order of first occurrences is strictly preserved. The final output is reassembled by joining the kept lines with newline characters, and a trailing newline is added only if the original input ended with one (to match typical editor behavior).
Compared to common alternatives, this tool preserves original ordering and requires no command‑line knowledge.
| This tool | Unix sort -u | Excel Remove Duplicates | |
|---|---|---|---|
| Order preservation | Yes, first occurrence kept | No, sorts alphabetically | No, removes but may shift rows |
| Case sensitivity | Exact (case‑sensitive) | Case‑sensitive (default) | Case‑insensitive (default) |
| Ease of use | Paste and click | Requires terminal and piping | Requires data import and multiple clicks |
| Handling of trailing newline | Matches input exactly | Adds trailing newline | N/A (cell‑based) |
Removing duplicate lines is a fundamental text processing task that originated in early Unix tools. The classic uniq command (V7 Unix, 1979) could only remove consecutive duplicates, requiring a prior sort. Later, sort -u combined sorting and deduplication. The need to preserve original order led to awk scripts like awk '!seen[$0]++', a pattern that became idiomatic. This tool implements that same logic client‑side for instant, no‑install use.
Yes. "Apple" and "apple" count as different lines. To ignore case, lower-case your text first using the lowercase converter.
No — they're significant. "hello" and "hello " (trailing space) are treated as different lines. Run through Trim Whitespace first if you want lenient matching.
Yes. The first occurrence of each line keeps its position; later duplicates are removed. Order of unique lines is unchanged.
Both Unix (\n) and Windows (\r\n) line endings are recognised. Output uses Unix line endings.