Sort & Dedupe Lines
Sort text lines alphabetically, numerically, by length or randomly. Remove duplicates, trim whitespace, and filter empty lines — all in the browser.
When do you need to sort lines?
Developers frequently need to sort text lists when working with configuration files, CSV exports, dependency lists, word lists, log entries, or any text where order matters for readability or diff-friendliness. Sorted and deduplicated files also produce cleaner git diffs.
Deduplication and cleaning
The deduplication option removes exact duplicate lines (after optional trimming). Combined with "remove empty lines" and "trim whitespace", this is ideal for cleaning up exported data, merging lists, or preparing content for import.
How does numeric sort work?
Numeric sort extracts the leading number from each line using parseFloat. Lines without a leading number are treated as 0. This correctly sorts "2, 10, 20" whereas alphabetical sort would give "10, 2, 20".
Is case-insensitive sort locale-aware?
Yes — case-insensitive sort uses localeCompare with sensitivity:'base', which handles accented characters and language-specific sort orders correctly.