Remove Duplicate Lines
Deduplicate lists, keywords, or logs while keeping first or last occurrences cleanly.
Open ToolSort lines A–Z, Z–A, naturally by number, by line length, reverse order, or random shuffle.
Each output panel above updates locally in real time as your text changes. Here is what every metric or transformation produced by Sort Text Lines represents:
Sort Text Lines is a structured line-ordering utility offering seven specialized algorithms—spanning alphabetical, natural numeric, grapheme length, inversion, and unbiased shuffling—in one workspace.
Basic string sorters fail frustratingly on lists containing item numbers (`Step 10` ahead of `Step 2`) or when trying to sort keywords from shortest to longest for typography layouts. Having both natural numeric collation and visual grapheme length sorting side by side solves those edge cases directly.
After optional blank-line removal and duplicate filtering, each button applies its specific comparator. `Natural Numeric (1, 2, 10)` uses `Intl.Collator` with `numeric: true` so embedded digits compare mathematically; length modes measure exact grapheme clusters per line; Shuffle runs an in-place Fisher-Yates permutation.
When Case-sensitive is disabled (the default), A–Z and Z–A comparisons normalize strings to lowercase first so `"apple"` and `"Banana"` order sensibly rather than pushing every uppercase letter before lowercase `"a"`.
Line endings normalize (`\r\n` -> `\n`) before preprocessing and comparator sorting. Unbiased Fisher-Yates shuffling ensures every list permutation carries equal probability.
Shortest First and Longest First weigh each line using `getGraphemes(line).length` so accented words and emojis weigh identically to ASCII characters.
Explore Next: Remove Duplicate Lines for keep-last deduplication controls • Reverse Text Generator to reverse words or characters inside individual lines • Browse all 30 text tools
Input: Chapter 10
Chapter 2
Chapter 1
Output / Insight: Natural Numeric orders as Chapter 1, Chapter 2, Chapter 10 (avoiding ASCII lexicographical "1, 10, 2").
Input: Medium phrase
Hi
Longer marketing headline
Output / Insight: Shortest First outputs: Hi, Medium phrase, Longer marketing headline.
Standard text comparisons look character-by-character ("1" beats "2", so "10" appears ahead of "2"). Natural sorting extracts numeric chunks and compares them quantitatively.
Enable the Remove duplicates checkbox right below the sort mode buttons; deduplication executes before sorting.
It compares the visual grapheme cluster length of each line in ascending order.
Yes, in Case-sensitive ASCII codepoint comparison uppercase letters ("Z") sort ahead of lowercase letters ("a"). Leave it unchecked for intuitive dictionary-style ordering.
Deduplicate lists, keywords, or logs while keeping first or last occurrences cleanly.
Open ToolStrip blank or whitespace-only lines completely or collapse gaps to single line breaks.
Open ToolReverse characters (emoji-safe), word order, line order, or check palindromes.
Open ToolSanitize copied text: strip HTML, smart quotes, URLs, emails, emojis, and extra whitespace.
Open Tool