A list rarely arrives already sorted. Names collected from a form, tags pulled from a database, log lines pasted from a terminal, all tend to be in whatever order they happened to be created or exported in, not the order that is actually useful to read or process. Sorting by hand is manageable for ten lines and completely impractical for a hundred, which is exactly the gap this text sorter fills.
Sorting happens entirely inside your browser using the same comparison logic a spreadsheet or a programming language would apply. Nothing you paste is uploaded, so a customer list or an internal document can be sorted here just as safely as a public dataset.
The five sorting methods this text sorter supports
Each method answers a different question about how a list should be ordered, and picking the right one depends on what the list actually contains and what you plan to do with it next.
- Alphabetical: A to Z order, comparing each line as text.
- Reverse alphabetical: Z to A order, the exact opposite of the alphabetical result.
- By length: shortest lines first, useful for spotting the shortest and longest entries in a list at a glance.
- Numeric: treats the leading number in each line as its sort key, correctly placing 9 before 10 unlike a plain alphabetical sort.
- Random: shuffles the list into a new, unpredictable order each time it runs.
Why numeric sort exists separately from alphabetical sort
A plain alphabetical sort compares text character by character, which means the string 10 sorts before 9, because the character 1 comes before the character 9 regardless of what follows it. That is exactly backwards for a list of numbers, quantities or IDs, where 9 should obviously come before 10. Choosing to sort lines numerically reads the leading number from each line and compares those numbers directly, giving the ordering people actually expect from a list of scores, prices or item counts.
Lines that do not start with a recognisable number are sorted to the end of the list in numeric mode, keeping the numerically sortable entries grouped together at the front rather than interleaved unpredictably with lines that have no number to compare.
Case sensitivity and its effect on alphabetical order
With case sensitive matching turned on, capital letters sort before lowercase letters under the standard character ordering most programming languages use, which means Zebra would sort before apple even though a human reader would expect apple first alphabetically. Turning case sensitivity off compares a lowercased version of each line instead, producing the alphabetical order most people expect regardless of how each entry happens to be capitalised, while the original capitalisation is preserved in the output.
Removing duplicates while you sort text by length or alphabetically
Sorting and deduplicating are separate operations, but they are commonly needed together, since a sorted list makes it far easier to spot that duplicates exist in the first place. Turning on the dedupe option removes repeated lines from the result using the same case sensitivity setting applied to the sort itself, so you get a clean, ordered, unique list in a single pass instead of running two separate tools.
Using random order to shuffle a list
Random mode is not a sort in the traditional sense, it deliberately discards any existing order and replaces it with a new one chosen unpredictably, using a well known shuffling method that gives every possible ordering an equal chance of appearing. This is useful for randomising the order of quiz questions, assigning items to a randomly ordered rotation, or simply breaking up a list that has become too predictable in its existing order. People often search for a way to randomize list order for exactly these situations, rather than a strict alphabetical or numeric sort.
How to use this text sorter
- 1
Paste your list
Drop a text file or paste any list, one item per line, into the input box.
- 2
Choose a sort method
Pick alphabetical, reverse, by length, numeric or random depending on what order you need.
- 3
Set case sensitivity and dedupe
Decide whether capital and lowercase letters should be treated as different, and whether duplicate lines should be removed.
- 4
Sort and copy
Press sort text to produce the ordered list, then copy it or download it as a text file.
Related tools worth bookmarking
Sources and further reading
- MDN: String.prototype.localeCompareThe comparison method behind this tool's alphabetical sort, including how locale affects character ordering.developer.mozilla.org
- Unicode UAX #10: Unicode Collation AlgorithmThe specification defining consistent, locale aware text ordering across languages and scripts.unicode.org
Frequently asked questions
Common questions about the text sorter.
Alphabetical sorting compares text character by character rather than treating digits as numbers, so 10 sorts before 2 because the character 1 comes before the character 2. To get the ordering you probably expect for a list of numbers, switch to numeric mode, which reads the leading number from each line and compares those numbers directly instead of comparing them as text.
Yes. In numeric mode, lines that begin with a recognisable number are sorted by that number, while lines with no leading number are grouped at the end of the result. In every other mode, alphabetical, reverse, by length or random, all lines are treated consistently regardless of whether they contain numbers.
Yes. Turn off case sensitive matching and the sort compares a lowercased version of each line, so Apple and banana sort in the order a human reader expects regardless of capitalisation, while the original capitalisation of each line is preserved exactly in the output.
Only if you turn on the dedupe option. By default, sorting only reorders the lines and leaves every duplicate in place. With dedupe enabled, repeated lines are removed using the same case sensitivity setting as the sort, so you get a unique, ordered list in one step instead of needing a separate deduplication pass.
Yes. Random mode uses a well established shuffling method that gives every possible arrangement of the list an equal chance of occurring, and it generates a genuinely new order each time you run it rather than cycling through a fixed set of arrangements.
No. Sorting and randomising only change the order the lines appear in. The text of every individual line stays exactly as you pasted it, including its original capitalisation, spacing and punctuation, regardless of which sort method or case sensitivity setting you choose.