Also available in: Español · Português · Français · العربية
Sort Text Online
Alphabetize, deduplicate, and reorder any list of lines — instantly, in your browser, in the language you choose.
What is a text sorter?
A text sorter takes a block of lines — a list of names, a to-do list, a set of keywords — and puts them in order: alphabetical, by length, or back to exactly how you typed them. This one runs entirely as you type: there is no button to click and nothing to upload, just paste text in and the sorted result appears in the second box immediately. It covers the usual list-cleanup jobs in one pass — alphabetize a list, remove duplicate lines, drop blank lines — all controlled by the toggles above the output.
How to use it
- Paste your lines into the input box. Each line is treated as one item, and the output updates as you type — there is nothing to submit.
- Choose a sort mode and language. Pick alphabetical, by length, or leave the order unchanged, and set the language dropdown to match your text so accented letters land where a native speaker expects.
- Flip the toggles you need, then copy. Turn on descending order, case sensitivity, natural number order, deduplication, trimming, or empty-line removal as needed, then copy the result with one click.
Why sorting text is more than A before B
Open a plain script editor and sort a list containing “äpple”, and it is likely to land after “zebra” — which is wrong in every language that uses the word. JavaScript’s built-in Array.prototype.sort() compares text by raw UTF-16 code unit, a numeric ordering that has nothing to do with how any dictionary files words: accented letters simply sit in a different part of the number line than the plain letters they are built from, so they fall at the end regardless of what a reader would expect. This tool never uses that comparison. It sorts through Intl.Collator, which asks your own browser for the collation rules published by the Unicode CLDR project — the same data macOS, Windows and every modern browser use for their own sorted lists — so alphabetizing a list here means what a dictionary in that language means, not what a byte value means.
Which alphabet the browser reasons in is not a minor detail — languages genuinely disagree about where a letter belongs. Swedish treats å, ä and ö as three extra letters that come after z, so a Swedish-sorted list runs “apple, zebra, ånga, äpple, örn”: zebra genuinely comes before ånga. German and English fold those same characters back onto a and o, giving a different order for identical input. Spanish treats ñ as its own letter immediately after n, so “ñu” sorts after “nunca” rather than before it the way a naive comparison would place it. Turkish goes further still, treating dotless ı and dotted i as separate letters. Pick the wrong language in the dropdown and the sort still runs without error — it just sorts by the wrong alphabet.
The same locale data decides what counts as a duplicate when case-insensitive matching is on. In most languages, case folding is a plain uppercase-lowercase pairing, but Turkish is a genuine exception: its capital “I” lowercases to dotless “ı”, not dotted “i”. Set the language to Turkish and the lines “I” and “ı” collapse into one when duplicates are removed, because they are the same letter; leave the language on English and they stay two separate lines, because in English they are not. Sorting by length has its own quiet correctness detail — it counts characters the way a person reading the screen would, not the way JavaScript stores strings internally. The family emoji 👨👩👧 looks like one character and is counted as one, even though it is built from eight UTF-16 units under the hood; ties in length are then broken alphabetically, so the result never depends on the order lines happened to arrive in.
When several toggles are on at once, the order they are applied in is fixed: whitespace is trimmed first, empty lines are removed second, duplicates are removed third (keeping whichever occurrence came first), the sort happens fourth, and reversing to descending order happens last. Windows (CRLF), classic Mac (CR) and Unix (LF) line endings are all read correctly no matter where the text came from, and the output always uses plain newlines. The engine behind all of this is covered by 37 offline assertions.
The tool has real edges worth knowing before you rely on it. It sorts whole lines, not columns, so it will not sort a CSV by its second field. Natural number order only understands runs of digits — it correctly puts “item2” before “item10”, but it has no idea what to do with dates, Roman numerals, or version numbers that mix letters and digits. Collation comes from the browser’s own Unicode data, so a genuinely old browser could order things slightly differently than a current one, and that is outside this tool’s control. Sorting by length counts characters, not the width they take up on screen, so a monospace column of CJK text will not look evenly sorted even though the character counts behind it are correct.
Why is it free?
This is a static page that ships once and then runs entirely in your browser — sorting a hundred lines or a hundred thousand costs this site nothing, so there is nothing to charge for. There is no account to create, no email to hand over, and no watermark on the result, because the “result” is just the text you pasted, reordered. Nothing you paste is ever sent anywhere: the sorting, deduplication and copying all happen on your device, the same privacy promise every tool on this site makes in writing.