Remove Duplicate Lines

Paste any text and instantly remove duplicate lines with options for case-insensitive matching, whitespace trimming, and sorting.

Paste text on the left to remove duplicate lines

Remove Duplicate Lines

This tool removes duplicate lines from any block of text instantly in your browser. Paste a list, log output, or any multiline content and it filters out repeated lines, keeping only the first occurrence of each unique line. Options let you ignore letter case and trim surrounding whitespace before comparing, so lines that differ only by capitalization or leading/trailing spaces are treated as the same.

You can also sort the resulting unique lines alphabetically for cleaner output. The tool shows the exact count of duplicate lines removed, making it easy to audit your data. Everything runs client-side — no text is ever sent to a server, so sensitive data stays private.

How it works

Each line is compared against a Set of previously seen lines. If the normalized line (optionally lowercased and/or trimmed) is not in the Set, it is kept and added to the Set; otherwise it is discarded. The optional sort step applies localeCompare on the unique results.

Use cases

  • Deduplicating email lists or subscriber exports before a campaign
  • Cleaning up log files or stack traces that repeat the same error lines
  • Removing duplicate entries from CSV or TSV data columns pasted as text
  • Preparing unique keyword lists for SEO or pay-per-click ad campaigns
  • Filtering repeated lines from code diffs, config files, or shell command output

Related Calculators