Remove Duplicate Lines & Sort Lines

Paste a list to remove duplicate lines instantly. Ignore case or surrounding spaces, drop empty lines, and sort the result alphabetically, naturally, by length or at random.

Runs in your browser
0
Input lines
0
Output lines
0
Duplicates removed
0
Empty lines removed
Result
Duplicated lines 0
LineTimes

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Remove Duplicate Lines

  1. Paste your list into Input (one item per line) or open a .txt/.csv file.
  2. Choose how lines are compared: Ignore case treats “Apple” and “apple” as the same, Trim spaces ignores leading and trailing whitespace.
  3. Optionally pick a Sort order — alphabetical, natural numeric, by length, reversed or shuffled.
  4. Copy or download the result. The counters show how many duplicates and empty lines were removed.

What does a duplicate line remover do?

It goes through text line by line and keeps only the first (or last) occurrence of each line, deleting the repeats while preserving the original order. It's the quickest way to clean up email lists, keyword lists, URLs from a crawl, log entries, CSV columns, tag lists or any export that contains the same value more than once — without opening a spreadsheet or writing a script. Everything runs in your browser, so even lists with hundreds of thousands of lines are processed instantly and privately.

Comparison options

OptionEffectExample
Ignore caseLines that differ only in capitalisation count as duplicates; the first spelling is kept.Apple, apple, APPLE → Apple
Trim spacesLeading and trailing spaces and tabs are removed before comparing and in the output." red " and "red" → red
Remove empty linesBlank or whitespace-only lines are dropped.—
Keep only lines that never repeatRemoves every copy of a duplicated line, leaving values that occur exactly once.a b a c → b c
Keep last occurrenceEach value stays at the position of its last appearance — useful for logs where the latest entry wins.a b a → b a

Sorting lines

  • A → Z / Z → A sorts alphabetically using your browser's locale-aware collation, so accented letters sort next to their base letters (é with e).
  • Natural sorts numbers inside text by value: file2, file10, file100 instead of the plain alphabetical file10, file100, file2.
  • By length orders lines from shortest to longest (or the reverse), handy for finding outliers.
  • Shuffle randomises the order with an unbiased Fisher–Yates shuffle — for raffles, sampling or randomised test data.

Equivalent command-line recipes

On Linux or macOS, sort -u file.txt removes duplicates but also sorts; awk '!seen[$0]++' file.txt keeps the original order like this tool's default; sort file.txt | uniq -u keeps only lines that never repeat; sort -V is a natural sort. This page gives the same results without a terminal and shows exactly which lines were duplicated and how often.

Need to compare two lists instead? Use the Diff Checker. To change capitalisation of the whole list first, run it through the Case Converter.

Tools that pair well with the Remove Duplicate Lines

  • Word Counter — Paste or type your text to count words and characters live — plus reading and speaking time, keyword density and length checks for SEO titles, meta descriptions and social posts.
  • Slug Generator — Convert any title into a clean, lowercase URL slug — with proper transliteration of accents, umlauts and Cyrillic, optional stop-word removal and a bulk mode for whole lists.
  • Soft Hyphen Generator — Stop long words like “Versicherungsleistungen” from overflowing on mobile: insert invisible soft hyphens automatically or at your own break points, then copy the result.
  • Smart Quotes to Straight Quotes — Code copied from Slack, Notion, Word or a blog won’t run?

Frequently asked questions

Does it keep the original order of my lines?
Yes. By default the first occurrence of each line stays where it was and later repeats are removed. Choose a Sort option only if you want the order changed.
How do I remove duplicates but ignore upper and lower case?
Tick Ignore case. “Email@Example.com” and “email@example.com” are then treated as the same line, and the spelling of the first one is kept.
Is there a limit on the number of lines?
There is no fixed limit; processing happens in your browser and handles hundreds of thousands of lines in well under a second on a modern device. Very large files (tens of megabytes) depend on your device’s memory.
Is my list uploaded to a server?
No. The text is processed entirely in your browser and is not stored or transmitted, so it’s safe to use with customer lists or internal data.
Can I see which lines were duplicates?
Yes — open the Duplicated lines panel below the editor to see each repeated line and how many times it appeared, sorted by frequency.

Related tools