Sort and Remove Duplicates Online — Free Text Tool
Updated: May 2026
Sorting and deduplicating a list are the two most common text cleanup operations — and you almost always need both at once. This page explains how to do both in a single step with Flowfiles, and when you might want to separate them.
Enable "Sort output" and get a sorted, deduplicated list instantly.
Open the tool →How sorting and deduplication interact
In Flowfiles, deduplication always runs first. The unique lines are collected in their original order, and then the sorting step is applied to the result. This means:
- Sorting does not affect which occurrence is kept — that is controlled by the "Keep first/last" option.
- The output is alphabetically sorted unique lines, regardless of the original input order.
- Case-insensitive deduplication and sorting can be used simultaneously.
- Reverse sort is also available for Z→A or descending order.
The Unix sort -u command does exactly the same thing: sort and unique in one pass. Flowfiles replicates this in the browser without requiring a terminal.
When sorted output is useful
Alphabetically sorted, deduplicated lists have specific advantages depending on the use case:
- Keyword research — a sorted keyword list makes it easy to spot clusters by root word (e.g., all "best X" queries together).
- Allowlists and blocklists — sorted lists are easier to maintain and diff in version control.
- Configuration files — sorted entries make it easier to find a specific item and avoid future duplicates.
- Bibliography or reference lists — alphabetical author order is standard in academic formatting.
- Debugging — when reviewing a list of IDs or URLs, sorting makes it immediately obvious if a specific value is present.
When to preserve original order instead
Sometimes the order of the list carries meaning that alphabetical sorting would destroy:
- A list of steps, instructions, or numbered items.
- A priority-ordered task list where position indicates importance.
- A feed of items ordered by recency, where the newest entry should remain first.
- A set of redirect rules where order determines which rule applies first.
For these cases, leave "Sort output" disabled and only use the deduplication feature.
Sort and deduplicate in the terminal
For those who prefer the command line, the Unix sort -u command handles both operations in a single pass and is extremely fast even on very large files:
- Linux / macOS:
sort -u input.txt > output.txt - Case-insensitive:
sort -fu input.txt > output.txt - Reverse order:
sort -ru input.txt > output.txt - Windows PowerShell:
Get-Content input.txt | Sort-Object -Unique | Set-Content output.txt
The browser tool is preferable for interactive use, quick checks, or when working on a shared computer where you cannot run shell commands.
Frequently asked questions
Does the sort use locale-aware ordering?
Yes. The tool uses JavaScript's localeCompare() method, which respects the alphabetical rules of the browser's locale. Accented characters are sorted correctly in most European languages.
Can I sort numbers in numeric order?
The default sort is lexicographic (string-based), meaning "10" comes before "2". For numeric sort, consider a spreadsheet or the sort -n command.
Can I reverse the sort?
Yes. Enable "Reverse sort" to get Z→A order. This is useful for getting the most recent entries (if they start with a date in YYYY-MM-DD format) at the top.