Sort lines

Alphabetical or reverse sorting for any list, with natural number order.

Paste a list with one item per line and sort it. Numbers inside the text are compared by value, so item 2 comes before item 10 — not after it, the way a plain sort would put them.

Alphabetize a list, the easy way

"Alphabetize my list" is the same operation as sort A→Z, and this is the tool for it: paste the names, words or lines in any order, press Sort A→Z, and they come back in alphabetical order. It works on a shopping list, a class register, a glossary, a bibliography, a list of book or film titles — anything with one item per line.

Two things it gets right that catch people out elsewhere. Case is ignored, so "apple" and "Apple" sort together instead of all the capitals coming first in a separate block — which is what a raw computer sort does and why an alphabetized list sometimes looks half-sorted. And numbers sort by value, so "Chapter 2" comes before "Chapter 10". If you need the reverse, Sort Z→A alphabetizes backwards.

Beyond alphabetical

The same list can be reordered other ways from here: by length shortest or longest first, shuffled into random order, reversed to flip the current order without re-sorting, and deduplicated to drop repeats. Sorting alphabetically first and then by length gives you length groups that are alphabetical inside each — a predictable, repeatable order.

Doing it without this tool

Excel: select the column and use Data → Sort A to Z. It sorts by value and case-insensitively by default, and it splits multi-line text into cells first, which you then have to manage.

Word: select the list and Home → Sort (the A-Z button). It handles paragraphs and has options for text versus number sorting.

Command line: sort file.txt alphabetizes but is case-sensitive and puts capitals first; sort -f ignores case and sort -V handles numbers naturally.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.

How to use it

  1. Paste your list, one item per line.
  2. Press Sort A→Z to alphabetize, or Sort Z→A for reverse order.
  3. Case is ignored and numbers sort by value automatically.
  4. Copy the sorted list.

What this tool does

Each line of the box is treated as one item, and the list is reordered. Four buttons:

Sorting is case insensitive, so apple and Apple land next to each other instead of being separated into two blocks. That is what you want for a list a person will read. Empty lines are dropped so the result is a clean list. Comparison is locale-aware, so accented and non-Latin letters sort in their alphabet's own order rather than by raw code point — éclair sorts near eclair, not after z.

Natural sorting: why item2 comes before item10

A plain sort compares strings character by character. Since the character 1 comes before 2, a naive sort produces the order on the left:

Plain string sortNatural sort (used here)
item1
item10
item11
item2
item20
item3
item1
item2
item3
item10
item11
item20

Natural sorting reads digit runs as numbers, so 2 is compared with 10 as values rather than as text. It is the order file managers use, and the order people expect from anything that has been numbered.

Where it matters:

Examples

InputActionResult
banana
Apple
cherry
Sort A→ZApple
banana
cherry
banana
Apple
cherry
Sort Z→Acherry
banana
Apple
c
a
b
Reverse orderb
a
c
file10
file2
file1
Sort A→Zfile1
file2
file10
red
blue
red
Remove duplicates then Sort A→Zblue
red

Note the third row: reversing an unsorted list only flips it end to end. If you want descending alphabetical order, use Z→A rather than sorting and then reversing — the result is the same only when the list was already sorted.

When you need it

Doing it without this tool

Excel

  1. Select the column.
  2. Data → Sort & Filter → A to Z, or Data → Sort for multiple keys.
  3. Choose Expand the selection when prompted, otherwise only that column moves and every row is scrambled — the single most common way to destroy a spreadsheet.

Excel sorts numbers stored as text as text, so item10 lands before item2. The workaround is a helper column that extracts the number with =VALUE(MID(...)) and sorting on that. In Microsoft 365 and Google Sheets, =SORT(A2:A100) gives a live sorted copy that leaves the original alone.

Google Sheets

Notepad++

Command line

One trap on the command line: sort obeys the locale, so results differ between LC_ALL=C sort (raw byte order, capitals first) and a normal UTF-8 locale. Set the locale explicitly in scripts if the order has to be reproducible.

Privacy: your text never leaves your browser

Sorting happens in JavaScript on your device. The list is never uploaded, never logged and never stored, and reloading the page clears it.

That is worth having when the list is names, email addresses, internal URLs or customer identifiers — which, for a sorting tool, it usually is.

Related tools

Remove duplicatesKeeps the first occurrence of every line and preserves the original order.Remove stop wordsStrips common English filler words and leaves the words that carry meaning.Remove line breaksTurns text broken across many lines back into a clean paragraph.Text cleanerCollapses double spaces, trims line ends and removes repeated blank lines.Bubble textLetters inside circles, or letters inside squares. Copy and paste.Instagram caption lengthThe hard limit is 2,200 characters. The one that matters is the 125 you see…Coin flipHeads or tails in one tap, with a running tally.

See all text tools →

Frequently asked questions

Is sorting case sensitive?

No. Apple and apple sort next to each other, which is what you normally want for a list a person will read.

How are numbers handled?

Naturally: item2 comes before item10, because runs of digits are compared as values rather than character by character.

Are empty lines kept?

No, empty lines are dropped during sorting so the result is a clean list with no gaps.

What is the difference between Sort Z to A and Reverse order?

Sort Z to A puts the list in descending alphabetical order. Reverse order just flips the current order end to end, which only matches on an already sorted list.

How do I sort a list in Excel?

Select the column and choose Data, then Sort A to Z. Always pick "Expand the selection" when prompted, or the other columns stay put and the rows are scrambled.

How do I sort in the terminal?

Use sort file.txt for ascending, sort -r for descending, sort -f to ignore case, sort -V for natural number order and sort -u to deduplicate at the same time.

Does it sort accented and non-Latin text correctly?

Yes. Comparison is locale-aware, so accented Latin, Cyrillic and Greek letters sort in their own alphabetical order rather than by code point.