Sort Text Alphabetically
Paste a list and it is put in A to Z order instantly. Natural, numeric, reverse and random order, last-name and column sorting, and dedupe are one click away.
More options: last name, columns, commas, “The”
Why sort text online?
Sorting a list by hand is slow and error-prone, and a spreadsheet is overkill for a few dozen lines pasted from an email or a document. The catch with plain alphabetical sorting is that it puts “file10” before “file2”, because it compares character by character. Natural sort reads the digits as numbers, the way a person would, and numeric sort understands minus signs and decimals, so −10 comes before −5 and 1.25 before 1.5. You can also sort names by surname, a CSV by any column, or a comma-separated list in place, and your capitalization is never changed.
How to sort a list alphabetically
- Paste your list, one item per line (or pick commas under More options).
- It is sorted A to Z immediately. Choose Z → A, natural, numeric, length, reverse or shuffle as needed.
- Tick Remove duplicates or Remove blank lines to clean up in the same pass.
- Copy or download the sorted list.
Alphabetical, natural or numeric: which sort do you need?
The same six lines (file10.txt, file2.txt, File1.txt, -5 °C, 12 °C, 3.5 °C) in each mode, ascending and ignoring case:
| Mode | Result | Best for |
|---|---|---|
| Alphabetical | -5 °C · 12 °C · 3.5 °C · File1.txt · file10.txt · file2.txt | Names, words, titles |
| Natural | -5 °C · 3.5 °C · 12 °C · File1.txt · file2.txt · file10.txt | File names, versions, chapters, anything with embedded numbers |
| Numeric | -5 °C · 3.5 °C · 12 °C · File1.txt · file2.txt · file10.txt | Measurements, prices, scores, negative numbers and decimals |
| By length | -5 °C · 12 °C · 3.5 °C · File1.txt · file2.txt · file10.txt | Finding the shortest or longest entries |
Alphabetical order compares one character at a time, so "file10" beats "file2" at the fifth character ("1" before "2"), and the minus sign is just a symbol. Natural order treats each run of digits as a whole number. Numeric order reads the number at the start of each line, including its sign and decimal point; lines that don't start with a number go to the end, and the summary under the result says how many.
How alphabetical order treats capitals, accents and symbols
- Capitals: with Ignore case on (the default), "apple" and "Apple" sort together. Turn it off and lowercase comes just before uppercase of the same word (apple, Apple), the convention of dictionaries, rather than the computer habit of putting every capital letter before every lowercase one.
- Accents and other alphabets: the sort uses your browser's Unicode collation, so "é" sorts with "e" rather than after "z", and Greek, Cyrillic or Japanese lists come out in their own alphabetical order.
- Numbers and symbols: punctuation and symbols sort first, then digits, then letters.
- Your text is never changed. Only the order changes; capitalization, accents and spacing inside lines stay as you typed them.
Sort by last name, by column or ignoring “The”
Open More options to change what each line is sorted by:
- Last word (surname): Ada Lovelace, Alan Turing, Grace Hopper, Charles Babbage becomes Charles Babbage, Grace Hopper, Ada Lovelace, Alan Turing.
- A column: for CSV, tab-separated text copied from a spreadsheet, or pipe-separated tables, pick the column number and delimiter. Tick Keep the first line on top so the header row stays put. Lines that don't have that column go last.
- Ignore “The”, “A”, “An”: the library and bookshop convention for titles. The Hobbit, A Tale of Two Cities, Dune, An Abundance of Katherines becomes An Abundance of Katherines, Dune, The Hobbit, A Tale of Two Cities.
- Comma-separated lists: set Items separated by to Commas to sort "pear, apple, cherry" in place; the result is joined with commas again.
Reverse, shuffle and other jobs
Reverse current order flips the list without sorting it, handy for turning a newest-first log into oldest-first. Shuffle puts the lines in random order using an unbiased Fisher–Yates shuffle; press Shuffle again for a new order. To pick a single winner from a list, the wheel spinner is more fun to watch.
Sorting in Word, Excel, Google Sheets and the command line
- Microsoft Word: select the lines, then Home > Sort (the A–Z button) and choose Text, Ascending.
- Excel: select the column and choose Data > Sort A to Z;
=SORT(A2:A100)returns a sorted copy in Microsoft 365. - Google Sheets: Data > Sort range, or
=SORT(A2:A). - Command line:
sort list.txtsorts alphabetically,sort -nnumerically andsort -Vin natural (version) order; add-rto reverse and-uto drop duplicates.
Common mistakes
- Sorting numbers alphabetically. 100 lands before 20. Use Natural or Numeric.
- Leading spaces. A line starting with a space sorts before every letter; keep Trim spaces on.
- Sorting a CSV with its header. Tick Keep the first line on top, or the header lands in the middle.
Related tools: remove repeats without changing order with remove duplicate lines, fix capitalization first with the case converter, count items and words with the word counter, or compare two lists with the text diff checker.
Frequently asked questions
How do I sort a list alphabetically?
Paste the list into the box, one item per line. It is sorted A to Z straight away; choose Z → A under Order for reverse alphabetical order. Copy or download the result. Your capitalization and spelling are never changed, only the order.
How do I put a list in reverse alphabetical order (Z to A)?
Keep Sort on Alphabetical and set Order to Z → A. To flip a list without sorting it at all, for example to turn a newest-first log into oldest-first, choose "Reverse current order" instead.
Why does file10 come before file2, and how do I fix it?
Alphabetical sorting compares one character at a time, and "1" comes before "2", so file10 lands before file2. Choose Natural (1, 2, 10): it reads each run of digits as a whole number, so file1, file2, file10 come out in the order a person expects.
How do I sort numbers with minus signs or decimals?
Choose Numeric. It reads the number at the start of each line, sign and decimal point included, so -10 comes before -5 and 1.25 before 1.5, and thousands separators such as 1,250 are understood. Lines that don't start with a number go last, and the summary says how many.
How do I sort names by last name?
Open More options and set Sort by to "Last word (surname)". "Ada Lovelace, Alan Turing, Grace Hopper" then sorts as Hopper, Lovelace, Turing while each line stays whole. Names with a suffix such as Jr. sort by that suffix, so remove it first if that matters.
Can I sort a CSV or spreadsheet data by a column?
Yes. Under More options, set Sort by to "A column", enter the column number and pick the delimiter: comma for CSV, tab for cells copied from Excel or Google Sheets. Tick "Keep the first line on top" so the header row stays in place. Combine it with Numeric to sort by a number column. Quoted fields containing commas are not split specially.
Can I alphabetize a comma-separated list?
Yes. Under More options set "Items separated by" to Commas, paste the list, and it is sorted and joined back with commas, for example "pear, apple, cherry" becomes "apple, cherry, pear". Semicolons and spaces work the same way.
How do I ignore "The" when sorting titles?
Tick "Ignore 'The', 'A', 'An' at the start" under More options. Titles are then sorted by their first real word, as libraries and bookshops do, so "The Hobbit" files under H. The titles themselves are not changed.
Can I randomize the order of a list?
Yes. Choose "Shuffle (random order)" and press Shuffle again for a new order. It uses the Fisher–Yates method, so every order is equally likely. It is handy for draws, seating plans or study cards.
Can I remove duplicates or blank lines while sorting?
Yes. Tick Remove duplicates and Remove blank lines to clean the list in the same pass. With Ignore case on, "Apple" and "apple" count as duplicates and the first one is kept. To dedupe without changing the order, use the remove duplicate lines tool instead.
How are capital letters and accents sorted?
With Ignore case on, capitals make no difference. With it off, lowercase sorts just before uppercase of the same word. Accented letters sort with their base letter, so "Éclair" sits among the E words, using your browser's Unicode collation; punctuation comes first, then digits, then letters.
Is my list uploaded?
No. Sorting happens entirely in your browser and nothing is sent anywhere. Only your option choices are remembered in this browser, not your list.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.