Text Sorter / Alphabetizer
Sort and alphabetize lines A–Z, Z–A, natural numeric (1–10), by character length, reverse order, or cryptographic shuffle with duplicate and whitespace cleanup.
How to Use
- Paste your multi-line list into the Input lines pane (or click Sample to load an example).
- Pick a sort order from the dropdown (A → Z, Z → A, Natural Numeric, Length, Reverse, or Random Shuffle).
- Toggle Remove duplicates, Trim lines, Ignore empty lines, or Case-sensitive matching to refine the output.
- Click Copy to copy the sorted lines, Reshuffle when shuffling, or Reset to clear the workbench.
What is Text Sorter / Alphabetizer?
A text sorter and alphabetizer organizes multi-line lists into alphabetical, natural numeric, character-length, reversed, or randomized order while optionally removing duplicates, whitespace, and blank rows. Writers, developers, teachers, and analysts use it to tidy bibliographies, numbered steps, CSV columns, imports, and raffle lists in seconds.
How It Works
The `sortTextLines` engine splits input on line breaks, optionally trims whitespace and drops blank lines, optionally removes duplicates via a case-aware Set, and applies your selected comparator (`localeCompare` for A–Z/Z–A, `numeric: true` for natural numbering, `.length` for shortest/longest, `.reverse()` for reverse order, or `cryptoRandomInt` Fisher-Yates for uniform shuffling).
Common Use Cases
- Ordering numbered sections or filenames — sort "item 2" before "item 10" accurately using Natural Numeric mode
- Alphabetizing bibliographies, glossaries, and tags — arrange messy lists A–Z or Z–A while stripping blanks and duplicates
- Sorting strings by length — inspect shortest-to-longest or longest-to-shortest lines for UI truncation or SEO testing
- Fairly randomizing participant or task lists — shuffle lines uniformly with Web Crypto random integers and Reshuffle
Technical Details
Runs 100% locally via `sortTextLines` and `cryptoRandomInt` (`crypto.getRandomValues` rejection sampling). Supports 8 `TextSortMode` strategies (`az`, `za`, `natural-asc`, `natural-desc`, `length-asc`, `length-desc`, `reverse`, `shuffle`) plus live duplicate/blank removal counters, Sample, CopyButton, and ResetButton.
FAQ
What is the difference between A → Z and Natural Numeric sorting?
Standard alphabetical sorting orders "item 10" before "item 2" lexicographically, whereas Natural Numeric sorting uses localeCompare({ numeric: true }) so "item 2" properly precedes "item 10".
How does Random Shuffle ensure an unbiased order?
Random Shuffle applies Fisher-Yates shuffling powered by Web Crypto (`crypto.getRandomValues`) with rejection sampling to avoid modulo bias.
Can I clean blanks, extra spaces, and duplicates while sorting?
Yes. Independent toggles let you trim line whitespace, skip empty lines, remove duplicates, and choose case-sensitive or case-insensitive comparison.
Is my list data uploaded anywhere?
No. All sorting, filtering, deduplication, and shuffling run locally in your browser.