Skip to content
uencoder
TASK

Sort lines and remove duplicates

Take a list of items (one per line), sort them alphabetically or naturally, and remove duplicate lines.

  1. 1

    Sorting and deduplicating a line list is a common data prep step — cleaning log entries, deduplicating URLs, preparing import lists. Sorting makes diffs readable; deduplication removes redundant entries.

  2. 2
    Sort & Unique →

    Paste lines. The tool sorts (ascending/descending, case-sensitive/insensitive, natural or lexicographic) and optionally removes duplicates.

  3. 3
    text-trim → sort-unique

    Use the chain to deduplicate then sort in one pass, with options for trimming whitespace and ignoring blank lines.

Frequently asked questions

What is 'natural' sort vs lexicographic?
Lexicographic sorts character by character: 'file10' < 'file2' (because '1' < '2'). Natural sort treats digit sequences as numbers: 'file2' < 'file10'. Use natural sort for filenames and version-like strings.
How are duplicates identified?
By exact line equality after optional trimming. Lines that differ only in trailing whitespace are considered different unless you enable trim. For case-insensitive dedup, enable that option — but the first occurrence's case is preserved.

Workflows that solve this

Learn more

Want to understand why?

Related tools