Remove Duplicate Lines
Paste a list and remove duplicate lines. Match case-insensitively, trim whitespace, keep the first or last copy, and optionally sort the result.
Deduplicated live as you type. Everything runs in your browser. Nothing is uploaded.
Options
How to remove duplicate lines online
Paste your list
Drop your text into the input box with one item per line. The result updates as you type.
Choose how lines are matched
Turn on Ignore case and Trim whitespace so near-identical lines are treated as duplicates, then pick whether to keep the first or last copy.
Sort the result if you want
Leave the lines in their original order, or sort them A to Z or Z to A once the duplicates are gone.
Copy the clean list
Check the counter to see how many duplicates were removed, then click Copy to clipboard.
Why use this tool
Keep the first or last copy
Choose which occurrence of each repeated line survives. Keep first preserves the earliest copy, keep last preserves the most recent one.
Match the way you mean
Ignore case treats Apple and apple as the same line. Trim whitespace removes leading and trailing spaces so padded copies still count as duplicates.
Counts every duplicate removed
A live readout shows how many lines went in, how many unique lines remain, and exactly how many duplicates were dropped.
Optional alphabetical sort
Leave lines in their original order, or sort the deduplicated result A to Z or Z to A. Sorting runs after duplicates are removed.
Runs entirely in your browser
Everything happens on your device. Your list is never uploaded, and the tool keeps working offline once loaded.
About this tool
This tool takes a block of text, treats each line as one item in a list, and removes any line that repeats. It splits your input on line breaks, compares the lines, and keeps only one copy of each. That makes it a quick fix for lists that picked up duplicates along the way: email addresses, keywords, usernames, redirect rules, or any newline-separated data you need to be unique before you use it.
You control how strict the matching is. Trim whitespace strips leading and trailing spaces before comparing, so a line with a stray space still counts as a duplicate. Ignore case makes uppercase and lowercase letters equal, so Apple and apple collapse into one. Keep first or keep last decides which copy of a repeated line stays, and an optional A to Z or Z to A sort tidies the final list. The operations run in a fixed order: trim, then deduplicate, then sort.
A counter above the output reports how many lines went in, how many unique lines came out, and how many duplicates were removed, so you can see the effect at a glance. Everything runs in your browser and nothing is uploaded. To reorder lines instead of deduping them, use the line sorter. To clean up spacing inside each line, try the whitespace remover, and to swap text across the whole list, use find and replace.
Frequently asked questions
- How do I remove duplicate lines?
- Paste your text into the input box, one item per line. Duplicate lines are removed instantly and the clean list appears below. Adjust the matching options if you need to, then click the copy button to copy the result to your clipboard.
- What is the difference between keep first and keep last?
- When a line appears more than once, keep first leaves the earliest copy in place and drops the later ones. Keep last does the opposite: it removes the earlier copies and keeps the most recent occurrence.
- How does case-insensitive matching work?
- With Ignore case turned on, lines that differ only in letter casing are treated as the same line, so Apple, APPLE, and apple collapse into a single entry. The copy that survives keeps its original casing.
- Are my lines uploaded anywhere?
- No. Everything runs in your browser. Your text never leaves your device, never touches a server, and is not stored or logged.
- Is there a limit on how many lines I can paste?
- There is no hard limit. The tool comfortably handles tens of thousands of lines. For very large inputs you may notice a brief pause while your browser processes the change.
Related tools
Line Sorter
Sort lines alphabetically or in natural order, shuffle them, remove duplicate lines, trim whitespace, and reverse line order.
Whitespace Remover
Clean up messy text by trimming lines, collapsing extra spaces, removing blank lines, and stripping line breaks.
Word Frequency Counter
See how often each word appears in your text, ranked by count with percentages.
Add Line Numbers
Prefix every line of your text with a number. Set where the count starts, choose a separator, pad with leading zeros, and skip blank lines.
Alternating Case Generator
Turn text into aLtErNaTiNg caps, the mocking SpongeBob style.
Case Converter
Switch text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case, and more.