Sort Lines Alphabetically: Organize a Text List
Sorting lines is useful for alphabetizing a short list, reference names or labels. Keep the source list and check how capitalization, blank lines and numeric values are ordered.
Sort a list in four steps
- Paste one item per line into the text box.
- Choose the order: A to Z or Z to A.
- Choose how lines are compared: natural order or case-sensitive.
- Press the sort button and copy the result from the output box.
Natural order and plain character order
Natural order ignores letter case and reads numbers as numbers, so item2 comes before item10. A plain character-by-character sort puts item10 before item2, because it compares 1 with 2 first. Choose natural order for file names, version numbers, chapter titles and lists with numbers. Choose case-sensitive when capital letters must be kept apart from small ones, for example in code identifiers or some reference lists.
Worked example
Take the lines banana, Apple, cherry, apple2 and apple10. In natural order A to Z the result is Apple, apple2, apple10, banana, cherry. Z to A gives the same list in reverse. In a plain character sort apple10 would land before apple2, which is rarely what a person expects.
Prepare the list first
Blank lines and spaces at the start of a line change the order, because an empty line or a line that begins with a space sorts before letters. Clear them first with Text Cleaner. If the same entry appears more than once, run Remove Duplicate Lines on the sorted list so the copies sit together and are easy to check. Keep a copy of your original, because sorting changes the order of your lines.
Limits to remember
The tool sorts whole lines. It cannot sort a table by one column, so use spreadsheet software for rows with several fields. Accents, punctuation and symbols follow the sorting rules of your browser and language, which may not match an official filing order, for example for names in a directory. Check the first and last lines of the result before you paste it into an important document. The text is sorted in your browser and is not uploaded.
Frequently asked questions
Will sorting keep my original list?
The original stays in the input box, but copy it somewhere if you may need the old order.
Why does 10 come before 2 in a plain sort?
Because characters are compared one at a time and 1 comes before 2. Natural order fixes this.
Does capitalisation matter?
In natural order it is ignored. In the case-sensitive option capital and small letters are separated.
Can I sort in reverse?
Yes. Choose Z to A.
Can it sort a table by a column?
No. It sorts whole lines. Use a spreadsheet for columns.
Is my text uploaded?
No. Sorting happens in your browser.
Read the Privacy Policy and Terms of Service before using the service.