consolelog.tools

Remove Duplicate Lines

Remove duplicate lines — keep first/last/only-unique, find only the duplicates, trim-compare, sort, and add occurrence counts. Live as you type.

About this ToolHow it works, benefits & use cases

This Remove Duplicate Lines tool is a full uniq-style deduper that works live as you type. Paste a list and it strips repeated lines, with control over which copy to keep: the first occurrence, the last occurrence, or only lines that appear exactly once. You can also flip it around to output just the duplicated lines. Comparison can be case-sensitive or not, can trim leading and trailing whitespace before matching, and can ignore blank lines entirely. The output can be left in its original order or sorted A→Z or Z→A, optionally trimmed, and optionally prefixed with each line's occurrence count (like uniq -c). Live stat cards show total lines, lines kept, and lines removed, and a "Most duplicated" panel ranks the values that repeat most. The result downloads as a .txt file, and the input is captured in a shareable URL. It all runs in your browser with nothing uploaded.

How to Use

  1. 1In "Options", set "Keep" to first occurrence, last occurrence, or only-unique lines, and pick a sort order.
  2. 2Toggle comparison settings: case sensitive, trim before compare, ignore blank lines, only duplicates, trim output, and show counts.
  3. 3Paste your list into the input box, or click "Load example" — the deduplicated result appears live below.
  4. 4Read the stat cards (total, kept, removed) and the "Most duplicated" panel to see what repeated most.
  5. 5Click "Remove duplicates" to confirm, then copy or download the result as a .txt file.

Key Benefits

  • Keep the first, the last, or only lines that occur exactly once
  • "Only duplicates" mode to extract just the repeated lines
  • Case-sensitive or case-insensitive matching with optional trim-before-compare
  • Ignore blank lines so empty rows do not skew the result
  • Sort output A→Z or Z→A and optionally trim each emitted line
  • Occurrence counts prefixed per line, like uniq -c
  • Live total / kept / removed stats and a most-duplicated ranking; shareable URL

Common Use Cases

  • Cleaning a copied list of emails, IDs, or URLs down to unique entries
  • Finding which values repeat in a log or export with "Only duplicates"
  • Deduplicating keywords or tags before importing them somewhere
  • Counting how many times each line appears with the show-counts option
  • Merging two pasted lists and removing the overlap in one pass

Options

Ignore leading/trailing spaces

Output just the repeated lines

Prefix each line with its count

0 characters · live

Enter text above to see the deduplicated result.

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools