Remove Duplicate Lines Online
Paste a list and remove duplicate lines instantly in your browser, with live counts and optional sorting.
Your list is deduplicated locally in your browser and is never uploaded, so even large or sensitive lists stay on your device.
Comparing two lists instead? Try the Text Diff.
About Remove Duplicate Lines
This remove duplicate lines tool takes any list you paste — a column of emails, log entries, URLs, keywords, or CSV rows — and returns only the unique lines, updating live as you type. Turn on case-insensitive matching to treat Apple and apple as the same, trim each line so trailing spaces do not hide a match, and choose whether to keep the first or the last occurrence of every duplicate. You can also drop blank lines and then sort the result alphabetically, in reverse, by natural numeric order, or by length. Running counts show how many lines went in, how many are unique, and how many duplicates were removed, so you can dedupe and sort a list in one pass. Everything runs entirely in your browser, so the text you paste is processed locally and never leaves your device.
Features
- Removes duplicate lines from a pasted list and updates the result live as you type
- Case-insensitive option treats Apple and apple as the same line
- Trim option ignores leading and trailing whitespace when comparing lines
- Choose whether to keep the first or the last copy of each duplicate
- Optionally strip blank and whitespace-only lines from the output
- Sort the unique lines A→Z, Z→A, in natural numeric order, by length, or reversed
- Live stats show input lines, unique lines, and duplicates removed
- Copy the deduplicated result or download it as unique-lines.txt
How to use the Remove Duplicate Lines
- Paste your list, one item per line, into the input box.
- Toggle case-insensitive, trim, keep-first-or-last, and remove-blank-lines to taste.
- Pick a sort order, or leave it on the original order.
- Read the unique result on the right and check the stats for how many duplicates were removed.
- Click Copy to grab the result, or Download to save it as unique-lines.txt.
Example
Input
apple
Banana
apple
cherry
banana
date
Apple
date
Output
apple
banana
cherry
date
With case-insensitive on and sort A→Z, eight lines collapse to four unique entries.
Common errors & troubleshooting
- Lines that look identical are not being merged. — They probably differ in letter case or trailing spaces. Turn on Case-insensitive and Trim each line so near-matches are treated as duplicates.
- The wrong copy of a duplicate is kept. — By default the first occurrence is kept. Enable Keep last occurrence to preserve the final copy of each duplicate instead.
- Empty lines are cluttering the result. — Turn on Remove blank lines to drop empty and whitespace-only lines before deduping.
- Numbers like item10 and item2 sort in the wrong order. — Choose the Numeric (natural) sort, which orders item2 before item10 instead of comparing them character by character.
Frequently asked questions
- How do I remove duplicate lines from a list?
- Paste your list into the input box, one item per line, and the tool instantly shows only the unique lines on the right. Adjust the case-insensitive, trim, and keep options if some near-matches should count as duplicates.
- Does it keep the first or the last copy of a duplicate?
- By default it keeps the first occurrence and drops later copies. Turn on Keep last occurrence to preserve the final copy of each duplicate instead, while still removing the earlier ones.
- Can it sort the lines too?
- Yes. After deduping you can sort the unique lines A→Z, Z→A, by natural numeric order, by line length, or simply reverse them. Leave the sort on original order to keep the input sequence.
- Will it treat different letter cases as duplicates?
- Only if you want it to. By default matching is case-sensitive, so Apple and apple are kept separately. Turn on Case-insensitive to collapse them into one line.
- How does it count duplicates removed?
- The stats show input lines, unique lines, and duplicates removed. Duplicates removed is simply the input line count minus the number of unique lines kept, measured after any blank-line removal.
- Is my text uploaded when I dedupe it?
- No. The whole operation runs in your browser, so the list you paste is processed locally on your device and is never sent to a server.
Related tools
- Case Converter — Convert text between camelCase, snake_case, kebab-case, PascalCase and more.
- Word & Character Counter — Count words, characters, sentences, lines, bytes and approximate tokens, live.
- Slug Generator — Turn a title into a clean, URL-safe slug, with batch mode.
- Text Diff — Compare two texts line-by-line and see additions and removals.
- Lorem Ipsum Generator — Generate placeholder lorem ipsum paragraphs, sentences or words.
- JSON to CSV — Convert an array of flat JSON objects to CSV.
All ArrayKit tools