About the Sort Lines Alphabetically Tool
What does this tool do?
It takes a list — one item per line — and puts it in order. Paste a jumble of names, tags, CSS properties, or to-do items on the left and the sorted version appears on the right as you type. The default is a plain A-to-Z sort, but you can flip to Z-to-A, order by line length, reverse what you already have, or shuffle the lines into a random order.
The sorting is number-aware, so "item 2" lands before "item 10" instead of after it, the way a naive sort would get it wrong. You can choose whether capital letters matter, and clean the list as you go by trimming spaces, dropping blank lines, and removing duplicates. It's all done locally in your browser, which keeps even a long or sensitive list private and the results instant.
How to Use This Tool
- Paste your list. Drop your lines into the left box, drag in a
.txtor.csvfile, or hit Sample to try it. - Choose an order. A-Z is the default; switch to Z-A, sort by length, reverse, or shuffle.
- Set the rules. Turn on Case sensitive if capitals should sort separately, and use Remove duplicates, Trim, and Remove empty lines to tidy the result.
- Take the result. The sorted list updates live on the right — copy it or download it as a text file.
Common Use Cases
Alphabetizing a list is a small task that shows up everywhere:
- Organizing names or words: Put a class roster, a glossary, or a word list into ABC order in seconds.
- Tidying code: Alphabetize CSS properties, import statements, enum values, or config keys.
- Sorting data: Order a column of tags, SKUs, or categories pasted out of a spreadsheet.
- Cleaning then sorting: Remove duplicates and blank lines and sort, all in a single pass.
- Random order: Shuffle a list to draw names or randomize question order.
Just need to clear out repeats? Use our Remove Duplicate Lines tool, or browse all our free text tools.
Frequently Asked Questions
Does it sort numbers correctly?
Yes. The sort is number-aware, so "item 2" comes before "item 10" rather than after it. A simple character-by-character sort would put "10" first because it compares the "1", but this tool reads the full number and orders it the way you'd expect.
What's the difference between Z-A and Reverse?
Z-A sorts the list into reverse-alphabetical order. Reverse current order doesn't sort at all — it just flips the list you pasted so the last line becomes the first. Use Reverse when your list is already in a meaningful order and you only want to turn it upside down.
How does case-sensitive sorting work?
By default the tool ignores capitalization, so "apple", "Apple", and "APPLE" sit together. Switch on Case sensitive and capitals are treated as distinct, which generally groups uppercase letters apart from lowercase ones.
Can I remove duplicates while sorting?
Yes. Turn on Remove duplicates and the tool keeps only the first occurrence of each line before sorting, respecting your case-sensitivity setting. You can also trim spaces and drop empty lines in the same step.
Is my data private?
Completely. All sorting happens locally in your browser with JavaScript — nothing you paste is uploaded, stored, or logged, and the tool keeps working offline once the page has loaded.