Paste one item per line, then click Sort A-Z or Sort Z-A; the reordered list appears in the output box, ready to copy.
- Paste the lines you want alphabetized into the input box - one entry per line; blank lines are ignored.
- Click Sort A-Z to order the lines ascending, or Sort Z-A to order them descending.
- Copy the sorted list from the output box below. Your original text stays in the input box, so you can click the other button any time to flip the order.
Sort Text Lines
Sort the lines of a text block alphabetically, right in your browser. Paste your list with one item on each line, then click Sort A-Z for ascending order or Sort Z-A for descending order; the reordered list appears in the output box below, ready to copy.
How it works
Because each line is treated as one item, the tool splits your text on every line break, reorders those items, and joins them back together. Sorting uses the browser's built-in locale-aware comparison, so upper- and lower-case versions of the same word land next to each other. Your original text stays in the input box after a sort, so you can flip between Sort A-Z and Sort Z-A as often as you like; the input list is not saved between visits.
Key features
- Sort the lines of a text block alphabetically, A-Z or Z-A.
- Paste one item per line, then click Sort A-Z or Sort Z-A; the reordered list appears in the output box.
- Sort again any time with the other button; the input list is not saved between visits.
- Runs locally in this browser tab - no upload and no account.
When to use it
Treating each line as one item makes this the quickest way to alphabetize a list of names or email addresses, tidy a set of tags, keywords, or CSS classes, or order the lines of a config or word list before you run a diff so the two sides line up.
Numbers sort as text
One thing to know: lines are compared as text, not as numbers, so "10" and "100" sort before "2". For a list of plain numbers, pad them to the same width (02, 10, 100) to get the numeric order you expect.
Your text stays private
The A-Z and Z-A ordering is computed on your device in plain JavaScript, so the list you paste is never uploaded, sent to a server, or saved. Refresh or close the tab and the box is empty again - no history, no account.
For other quick text jobs, see the word counter or the JSON parser - each processes text on your device without an upload. A step-by-step walkthrough lives in the Sort Text Lines guide.
FreetoolOnline Editorial TeamFrequently Asked Questions
What does Sort Text Lines do?
It reorders a block of text one line at a time. Paste your list with one item per line and click Sort A-Z for ascending order or Sort Z-A for descending order; the sorted list appears in the output box.
When should I reach for it?
Use it to alphabetize a list of names or email addresses, tidy a set of tags, keywords, or CSS classes, or order the lines of a config or word list before you run a diff.
Why did "10" sort before "2"?
Lines are compared as text, character by character, not as numbers, so "10" comes before "2" because "1" comes before "2". To sort plain numbers in numeric order, pad them to the same number of digits first (02, 10, 100).
Is my text uploaded or saved anywhere?
No. Sorting runs entirely in your browser using plain JavaScript. Nothing you type or paste is uploaded or sent to a server, and nothing is saved - refreshing or leaving the page clears the box.