What does a text sorter do?
A text sorter takes a list where each item sits on its own line and reorders those lines by a comparison rule. The simplest rule is dictionary order on the characters, which is what a computer does by default and is not quite what a person expects; the others are natural order, which reads embedded numbers as numbers, and numeric or length ordering for lists where the value or the size of each line is the thing being compared.
The difference between the default and natural order is the reason this tool exists. A plain character comparison puts chapter10 before chapter2, because it compares the fourth character of each — a 1 and a 2 — and never reaches the digits that follow. Natural sorting finds runs of digits, converts them to numbers and compares those numerically, so files, headings, version numbers and image names land in the order every human expects.
Two further decisions change the output as much as the sort key. Case sensitivity determines whether every capital letter sorts before every lowercase one, which is the default behaviour in most programming languages and produces the familiar odd-looking run of Zebra followed by apple. And duplicate removal is a separate operation that discards all but the first occurrence of each line — right for a list of URLs, wrong for a list where repetition is the data.
How to sort a list of lines
- Paste the list, one item per line. Line and character counts appear underneath so you can see what arrived.
- Choose the sort key. Natural order is the right default for anything with numbers in it; alphabetical is right for plain words.
- Pick a direction: A to Z, or Z to A for the reverse of whichever comparison you chose.
- Turn off case-insensitivity only if you actually want capitals grouped before lowercase letters — a rare need, and the usual cause of a sort that looks wrong.
- Switch on duplicate removal if the list is a set of URLs or identifiers rather than data that legitimately repeats.
- Copy the result or download it as a text file. The counts above the output tell you exactly how many lines were dropped.
Text Sorter limits and rules
| Item | Limit |
|---|---|
| Sort keys | Natural, alphabetical, numeric value of the line, or line length |
| Directions | Ascending and descending, applied to whichever key is chosen |
| Case handling | Case-insensitive by default; case-sensitive groups capitals first |
| Duplicate removal | Optional, keeps the first occurrence and reports how many were dropped |
| Whitespace | Optionally trimmed from the ends of each line before comparing |
| Line endings | Windows, Mac and Unix endings all accepted |
| Numeric sort | Reads the first number in each line; lines with none are grouped last |
| Size | Practically limited by what the textarea can render, not by the sort |
When to use it
- Putting a folder of chapter files or slide exports into the order a person would read them.
- Sorting a list of URLs or domains before deduplicating it, so the duplicate scan is easy to verify.
- Ordering a word list by length for a crossword or a game.
- Alphabetising a guest list, a stock list or a set of names pasted from a spreadsheet.
- Turning a scattered set of version strings like v1.9, v1.10 and v2.0 into a sensible sequence.
Is it private?
The list is sorted in your browser with the standard comparison functions, and nothing is transmitted — no upload, no account, no record of what you sorted. The whole tool works with the network disconnected once the page has loaded.
Frequently asked questions
It is a comparison that treats a run of digits as a number rather than as a sequence of characters. Because a plain comparison looks character by character, it finds “1” and “10” before “2” — the first character decides it. Natural sorting instead compares 2 against 10 as numbers, so the order matches what people mean by ascending. File managers use it, and so should any list of filenames, chapter headings or version numbers.
Because the comparison is case-sensitive and in the underlying character encoding every capital letter comes before every lowercase one. A is 65 and a is 97, so “Zebra” sorts before “apple”. Turning off case sensitivity fixes it by comparing the folded forms. The default here is case-insensitive for exactly that reason, and the odd ordering is worth recognising because it appears in anything that sorts strings without normalising case first.
It keeps the first occurrence of each line and discards later ones, and that decision is made before the sort, so the surviving copy is the one that appeared earliest in your input. If two lines differ only in case and case-insensitivity is on, they count as the same line for this purpose. The count above the output always reports how many lines were removed, so nothing disappears silently.
Indirectly. This tool sorts whole lines, so pasting CSV sorts the rows by their first characters, which is not usually what you want. A workable trick is to rearrange the columns so the field you want to sort by comes first, sort, then rearrange back — or use the CSV to JSON tool on this site and sort there. Sorting proper tabular data is a job for a spreadsheet.
By the browser's locale-aware comparison, which is genuinely good at this. Accented letters sort next to their unaccented forms rather than after all of them, and scripts with their own alphabetic orders are handled according to the runtime's collation data. That is why the output here can differ from a byte-order sort in a command-line tool: this one is trying to reproduce human alphabetical order, which is a considerably harder problem than comparing numbers.
No enforced limit, and the sort itself is fast enough for very large lists. The practical ceiling is the textarea, which becomes sluggish in the browser somewhere in the hundreds of thousands of characters. For anything above that, a command-line sort is the better tool — this one exists for lists at the size people actually paste into a form.
Related tools
Written and maintained by Md. Nur Hossain Repon.