Remove Duplicate Lines

Paste a list and drop the repeats. Keep the first or last occurrence, ignore case, trim whitespace, remove blank lines and sort the result. Everything happens instantly, in your browser.

Remove Duplicate Lines
Options
Sort
0
Original Lines
0
Result Lines
0
Duplicates Removed

Your text stays in your browser. Nothing is uploaded.

How to Remove Duplicate Lines

Paste any list — one item per line — and the result updates as you type. Duplicate lines are dropped and you choose which copy survives. Everything runs in your browser, so the list never leaves your device.

Which Occurrence to Keep

  • Keep first occurrence — the earliest copy stays where it was and later repeats are dropped. This is the default, and it preserves the order you pasted.
  • Keep last occurrence — the final copy survives in its own position and earlier repeats are dropped. Useful when the last version of a line is the one you want.

The Options

  • Ignore case — treats "Apple" and "apple" as the same line. Whichever copy is kept is written exactly as you typed it.
  • Trim whitespace — strips leading and trailing spaces and tabs before comparing, so "Apple " and "Apple" match.
  • Remove blank lines — drops empty lines, including lines that contain only spaces or tabs.
  • Sort A–Z / Sort Z–A — orders the cleaned result alphabetically. "Original order" leaves your list in the order you pasted it.

Worked Example

Input: Apple, Banana, Apple, Orange, banana — one per line.

Default settings (keep first, case-sensitive): Apple, Banana, Orange, banana. The lowercase "banana" survives because it differs from "Banana" by case.

With Ignore case on: Apple, Banana, Orange — "banana" is now a duplicate of "Banana".

With Sort A–Z on: Apple, Banana, Orange — the same three lines, alphabetically ordered.

When to Use It

  • Cleaning a column of emails, usernames or SKUs pasted out of a spreadsheet
  • De-duplicating tags, keywords or hashtags before you publish
  • Tidying a merged list where the same value appears several times
  • Stripping repeated lines from log output or a subtitle file
  • Sorting a word list A–Z for a glossary or an index

Your Data Stays Local

Remove Duplicate Lines runs entirely in your browser. There is no API call, no upload, no database and no server-side text processing. Your list is never sent anywhere, and the tool keeps working offline once the page has loaded.

Frequently Asked Questions

What counts as a duplicate line?

Two lines are duplicates when they are identical once the options you have chosen are applied. By default the comparison is exact and case-sensitive, so "Apple" and "apple" are different lines. Switch on Ignore case to treat them as the same, or Trim whitespace to ignore spaces and tabs at either end of a line.

Does it keep the first copy or the last?

You choose. Keep first occurrence is the default: the earliest copy stays in its original position and later repeats are removed. Keep last occurrence does the opposite: the final copy survives in its own position, which is handy when the last edit of a line is the one you want.

Does sorting change which duplicates get removed?

No. De-duplication always happens first, in your original order, so the line that survives is the one you asked to keep. Sort A–Z and Sort Z–A only reorder the cleaned result afterwards.

How are blank lines handled?

By default a blank line is treated like any other line, so several blank lines in a row collapse to one. Switch on Remove blank lines to drop every empty line, including lines that contain only spaces or tabs.

Does it work with accented or non-Latin text?

Yes. The tool handles any Unicode text — accents, Cyrillic, Greek, Chinese, Japanese, emoji and right-to-left scripts all compare correctly. Sorting uses your browser’s locale-aware comparison with numeric awareness, so "item 2" sorts before "item 10".

Is my list sent to a server?

No. Your text stays in your browser. Nothing is uploaded: there is no API, no database and no server-side processing, and the tool keeps working offline after the page has loaded.