Text Tools
Text Sorter
Sort a list of lines alphabetically, naturally, numerically, by length, or randomly in your browser. Trim, dedupe, and library sort included.
Quick presets
Sorted output
0 lines, 0 charsSort options
How to use
- Paste your list into the input box, one item per line.
- Pick a sort mode: Alphabetical, Natural (file2 before file10), Numeric, Line length, Random shuffle, or Reverse order.
- Choose ascending or descending direction (ignored for Random and Reverse).
- Toggle pre-sort cleanup as needed: trim spaces, drop blanks, dedupe identical lines, ignore leading A/An/The for library sort.
- Pick a locale (English, German, French, Spanish, Turkish, Swedish, Japanese, Chinese) so accented and non-Latin characters compare correctly.
- Click Copy sorted text, or Replace with sorted to keep editing inside the input box.
- Use Shuffle again on Random mode to reroll the order without retyping.
About this tool
Text Sorter orders any list of lines, exactly the way you need. Alphabetical mode uses a locale-aware Intl.Collator so accented characters and non-Latin scripts (German, French, Spanish, Turkish, Swedish, Japanese, Chinese) compare the way native readers expect, with optional case-insensitive compare. Natural mode treats embedded numbers as numbers, so file2.txt sorts before file10.txt and chapter-2 before chapter-10 without renaming anything. Numeric mode parses each line as a number (signed, decimal, scientific notation, comma thousands separators) and sorts mathematically; lines that are not numbers are grouped together at the opposite end and sorted alphabetically among themselves so you can spot non-numeric data quickly. Length mode orders by character count with an alphabetical tie-break for stability, useful for finding the longest tweet, the longest URL, or trimming a column to a length budget. Random mode uses crypto.getRandomValues with rejection sampling and Fisher-Yates to produce a uniform unbiased shuffle (great for raffle order, randomized quiz questions, or fair team draws), with a Shuffle again button so you can reroll without retyping. Reverse mode flips the original line order without sorting, which is the fastest way to invert a list. Each mode pairs with ascending or descending direction, optional pre-sort cleanup (trim each line, drop blank lines, deduplicate identical or case-insensitive duplicates), and an optional library-sort toggle that ignores leading A, An, The so book and movie titles sort the way librarians do ("The Hobbit" sorts as "Hobbit"). The output panel shows the sorted lines, a per-run cleanup report (lines removed, duplicates removed), warnings when non-numeric lines are bucketed separately, and a Copy button so you can paste straight into a spreadsheet, code editor, or doc. Useful for writers and researchers alphabetizing references, marketers sorting keyword lists, developers sorting filenames or imports, teachers shuffling student names for fair pairings, librarians and book-club organizers ordering titles, spreadsheet users who need a quick sort without opening a spreadsheet, and anyone who pasted a messy list and wants it ordered cleanly. Input is capped at 200,000 characters or 100,000 lines so the page stays responsive on very large pastes, and the truncation is shown so you know exactly how much was processed. Everything runs locally on your device, so the lines you paste never leave your browser.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Text Cleaner
Remove duplicate lines, blank lines, extra spaces, tabs, and invisible characters.
Open tool
TextText Diff
Side-by-side line, word, and character diff with a unified patch.
Open tool
TextCase Converter
Convert text between six common cases at once.
Open tool
TextWord Counter
Live word, character, sentence, paragraph, and reading time stats.
Open tool