Sort Lines Alphabetically
Sort a pasted list live with natural number order, locale-aware letters, reverse order, or shuffle.
- Fewer clicks, keyboard friendly
- Features others lock behind paywalls
- More accurate results
Options
⌘ Enter Copy result
How to use
- Paste or type one list item on each line in “Lines to sort.”
- Choose A → Z, Z → A, Reverse lines, or Shuffle; the result changes immediately.
- Leave Natural number order on for names such as “item 2” and “item 10.”
- Turn on cleanup options when you want to trim spaces or remove blank and duplicate lines.
- Copy the result, or use it as input to sort it again with a different option.
Alphabetical order and natural number order answer different questions
Plain alphabetical comparison reads one character at a time, so it places “item 10” before “item 2”: both start with “item ”, then character 1 comes before character 2. Natural number order treats a run of digits as a number instead, producing item 2, item 10, item 100. Leave natural order on for version names, file names, numbered headings, and product lists. Turn it off only when you need a strict character-by-character order.
A → Z and Z → A compare every complete line. Reverse lines does not compare the text at all: it simply flips the current top-to-bottom order. Shuffle uses the Fisher–Yates method, so it is suited to randomizing a list of names, prompts, or speaking order rather than alphabetizing it.
Korean 가나다순 and other locale-aware letters
The sorter uses the browser’s Intl.Collator with the language of this page. On the Korean page, complete Hangul syllables are compared in Korean collation order, so 가나 comes before 다람쥐 and 하늘. On the English page, accented letters and case are compared with English collation rules. A browser’s language data can place unusual punctuation differently across browser versions, so check a result that must follow a publisher’s house style.
When case-sensitive sorting is off, strings that differ only by case compare as equal and keep their input order. When duplicate removal is on, the first matching line is retained. The comparison also normalizes equivalent Unicode spellings, which prevents a composed character and its decomposed form from becoming accidental separate entries.
Cleanup changes the output only when you ask for it
By default, sorting rearranges complete lines without changing their spelling, whitespace, or blank rows. Turn on Trim whitespace to remove spaces and tabs at the beginning and end of each line before sorting. Turn on Remove empty lines to discard lines that are empty after trimming, and Remove duplicate lines to retain the first line in each matching group. These controls work together: trimming first can turn a spaces-only line into an empty line and can make two differently spaced lines duplicates.
Sorting runs in this tab. The latest text and selected options are stored only in this browser so a refresh does not discard a working list. Select Clear to remove the saved input from this browser.
Frequently asked questions
Why does item 10 sometimes appear before item 2?
Strict alphabetical sorting compares individual characters, so the 1 in item 10 comes before the 2 in item 2. Enable Natural number order to compare digit sequences as numbers and place item 2 before item 10.
Can I sort Korean names in 가나다순?
Yes. On the Korean page, the sorter uses the browser’s Korean collation rules, so complete Hangul syllables sort in 가나다순. A typical name list therefore places 강 before 김, then 박, 이, and 하.
What is the difference between Z → A and Reverse lines?
Z → A sorts every line in descending alphabetical order, while Reverse lines simply makes the last input line first and the first input line last. Reverse lines does not compare letters, numbers, or lengths.
Does removing duplicates ignore uppercase letters?
With Case-sensitive off, duplicate removal treats Apple and apple as the same entry and keeps the first one. With Case-sensitive on, Apple and apple remain two distinct lines.
Is my list uploaded when I sort lines?
No. Sorting and cleanup happen in the current browser tab; the list is not sent to a server. The latest input is stored only in this browser until you select Clear.
Related tools
Updated 2026-10-28