TextToolbox Instant text & writing tools

Alphabetize Lines

Paste a list — it sorts live as you type or change an option. Nothing leaves your device.

Sort mode
Lines sorted 0

Sorting that actually understands language

A naive sort compares text character by character using raw Unicode code points — which is why a plain JavaScript .sort() puts "Zebra" before "apple" (capital letters have lower code points than lowercase ones) and shoves every accented word to the very end of the list. This tool sorts with the browser's locale-aware collator instead, so comparisons follow real alphabetical order: case is ignored by default, accented letters sit next to their unaccented counterparts, and digit runs inside a line are compared by numeric value rather than character-by-character — so "item2" correctly lands before "item10".

Alongside A→Z and Z→A, you can sort by length (shortest line first) — handy for scanning a list from simplest to most detailed entry — or shuffle it with a fresh random order every time. If your list has repeated entries rather than ones you need ordered, the duplicate line remover is the tool for that job instead.

Worked example

Paste this list: Banana, apple, Cherry, Date, elderberry (one per line, with a blank line and mixed capitalization mixed in). With the default options — case-insensitive on, empty lines removed — A→Z sorts it to apple, Banana, Cherry, Date, elderberry: 5 lines out, alphabetical regardless of capitalization. And for a numbered list like Item2, Item10, Item1, A→Z correctly returns Item1, Item2, Item10 — not the "Item1, Item10, Item2" you'd get from a plain character-by-character sort.

Frequently asked questions

How does the sort handle accented letters?

It uses the browser's locale-aware comparison (JavaScript's localeCompare with the English locale) instead of raw character codes. Raw code-point sorting puts every accented letter after 'z' because of how Unicode is numbered, which is wrong for alphabetical order. Locale-aware sorting places é next to e and ñ next to n, the way a dictionary would.

Why does '2' sort before '10' instead of after it?

Because the sort is numeric-aware: it detects runs of digits inside a line and compares them by value, not character by character. Plain string sorting would put 'item10' before 'item2' (since '1' < '2' as characters), which almost never matches what you actually want from a list of numbered items.

Is 'Shuffle' actually random, or does it repeat a pattern?

It's a fresh Fisher-Yates shuffle every time the tool recalculates — on each keystroke, each option toggle, and on page load. There's no seed and no memory of previous shuffles, so consecutive results are independent and you'll rarely see the same order twice.

What does the case-insensitive option actually change?

It's on by default and controls only the COMPARISON, not the text: 'Apple' and 'apple' are treated as equal when deciding order, but each line keeps its original capitalization in the output. Turn it off if you specifically want uppercase letters to sort before lowercase ones (the traditional, case-sensitive ASCII-ish order).