Free Text Sorter
Sort lines of text alphabetically, by length, numerically, or randomly. Remove duplicates, trim whitespace, and shuffle lists.
Common uses
- Sort and Organise Lists AlphabeticallySort grocery lists, to-do items, names, or any bulleted list into alphabetical order instantly.
- Clean and Deduplicate Data LinesRemove duplicate lines, trim whitespace, and normalise text data from CSV exports and logs.
- Sort Import Statements and Code ListsSort import statements, CSS class lists, JSON keys, or any code list into a consistent order.
- Sort a List of Names AlphabeticallyAlphabetise attendee lists, team rosters, student names, and credit lists by first or last name.
- Randomly Shuffle a ListRandomly shuffle names, items, or entries for fair ordering, random assignments, or game setup.
How It Works
Sorting runs entirely in your browser using JavaScript's built-in Intl.Collator API β no server, no library, no upload. Every sort order, from alphabetical to natural number sorting, is computed on the spot as you type or change options.
- 1Input split into linesYour pasted text is split on newline characters. Optional pre-processing runs first: leading and trailing whitespace is trimmed from each line, and empty lines are discarded β both configurable.
- 2Intl.Collator handles orderingFor alphabetical and natural sorts, the browser's built-in Intl.Collator is initialized with your current site locale so accented characters (Γ₯, Γ€, ΓΆ, etc.) sort in the correct language order. The 'natural' mode sets the numeric flag, so 'file2' ranks before 'file10' rather than treating digits as plain characters.
- 3Comparison keys strip noiseBefore comparison, each line can optionally have leading articles (the, a, an) and non-alphanumeric punctuation removed from its sort key β the original line text is kept intact in the output, only the key used for ordering is modified.
- 4Shuffle uses cryptographic randomnessThe random shuffle mode calls crypto.getRandomValues to generate an array of random 32-bit integers, then runs a Fisher-Yates shuffle over the lines using those values β avoiding the bias that comes with Math.random()-based approaches.
Related Tools
Duplicate Line Finder
Find, count, or remove duplicate lines from a list. Great for cleaning up email lists, audit logs, or finding repeat entries in data dumps.
Emoji Picker
Search and copy emoji with one click. Browse by category, build a string of several emoji, choose a skin tone and find the ones you used recently.
Wheel Spinner
Type a list of names or choices, spin the wheel and let it pick one at random, with a tick sound, confetti and an option to remove each winner.