About Sort Text Lines: Guide & Practical Notes
Standard alphabetical sorting puts "Item 10" ahead of "Item 2", creating annoying ordering glitches in numbered lists, versions, or inventory rows.
Sorts lines across seven modes: Natural Numeric (Item 1, Item 2, Item 10), standard A–Z, Z–A, Natural Descending, Line Length (shortest or longest first), and cryptographically unbiased Random Shuffle.
How to Use Sort Text Lines Step by Step
- Paste multi-line text into Unsorted Lines.
- Select your preferred Sort Order (default is Natural Numeric & A–Z).
- Toggle Case Sensitive or Ignore Blank Lines, then click Sort Lines.
Worked Example
Sort numbered tasks cleanly.
Inputs: Item 10\nItem 2\nItem 1\nBanana\napple
Result: Natural Numeric: apple, Banana, Item 1, Item 2, Item 10
Intl.Collator with `numeric: true` compares embedded numbers numerically (1 < 2 < 10) instead of character-by-character ("1" < "2").
Intl.Collator Numeric & Web Crypto Shuffle
Alphabetical and natural modes leverage browser Intl.Collator for clean Unicode collation. Random Shuffle uses Fisher-Yates powered by `crypto.getRandomValues()` rather than weak `Math.random()`.
Common Real-World Uses
- Ordering CSS properties, bibliographies, or invoice line references
- Randomizing giveaway entrants or flashcard decks fairly via Web Crypto
- Finding longest or shortest URLs/lines in an export
Common Mistakes to Avoid
- Sorting comma-separated CSV rows line-by-line without realizing the header row will move alphabetically into the middle.
- Expecting ASCII sort to handle "2" before "10" without natural numeric mode.
Supported Formats, Scope & Limitations
Each line is treated as an independent record. For multi-column CSV files, use our CSV Viewer to sort while keeping row columns aligned.
Privacy & Local Processing
Sorting runs locally inside browser memory.
Frequently Asked Questions
How do I randomize a list fairly for a drawing?
Choose "Random Shuffle (Web Crypto)"—it uses Fisher-Yates shuffling backed by the browser cryptographic RNG.
Does Natural sort handle case sensitivity?
Yes—check "Case sensitive" if uppercase letters must sort strictly separately from lowercase.
Need to drop duplicates from your sorted list? Use Remove Duplicate Lines.