Sort Lines Alphabetically

Paste a list and sort every line from A to Z or Z to A in one click. Numbers sort by value instead of by character, so "item2" comes before "item10" the way you'd actually expect.

Order

0 words0 characters0 lines

Why This Tool Matters

You've got a list of names, product SKUs, or file names in whatever order they happened to be entered, and you need them alphabetized before importing into a spreadsheet. You're putting together a bibliography or reference list and every entry needs to be in order. You've exported a column from a CSV and the rows came out in random order instead of the sequence you need. Sorting a short list by hand is manageable; sorting hundreds of lines while also handling mixed case and numbers correctly is not. This tool sorts the whole list in one pass, using a natural sort so numbered items land in the right numeric order instead of a naive character sort.

The difference shows up fast with numbered items: a plain character-by-character sort compares "Item 10" and "Item 2" one digit at a time, and since the character "1" comes before "2", it puts "Item 10" ahead of "Item 2" — technically correct by the letter, wrong by any human reading of the list. A natural sort recognizes the embedded number as a number and compares 10 to 2 as actual values, so "Item 2" correctly lands before "Item 10." It's a small distinction that only matters once a list crosses into double digits, which is exactly when a manual sort starts getting unreliable too.

How to Use

  1. 01

    Paste your list

    Paste your list into the box above, one item per line.

  2. 02

    Choose sort order

    Pick A → Z or Z → A, and adjust the case and blank-line options.

  3. 03

    Sort lines

    Click Sort Lines and copy the result.

More Text Tools

Frequently Asked Questions

Does this sort numbers correctly (1, 2, 10) or alphabetically (1, 10, 2)?

Correctly. This tool uses a "natural sort" that reads multi-digit numbers as whole values, so a list containing "item1," "item2," and "item10" sorts in that numeric order instead of the lexicographic "item1, item10, item2" you’d get from a naive character-by-character comparison.

Will blank lines mess up the sort order?

Not unless you want them to. By default, blank lines are sorted along with everything else and typically land at the start of an A → Z sort. Turn on "Remove empty lines while sorting" if you’d rather they be dropped entirely instead of sorted into the result.

Can I sort in reverse (Z to A) order?

Yes — switch the order toggle from "A → Z" to "Z → A" and the result reverses, whether you’re sorting a fresh list or re-sorting one you’ve already run through the tool.

Does capitalization affect how lines are sorted?

Only if you turn "Case-insensitive sort" off. With it on (the default), "banana" and "Apple" sort purely by letter, so mixed-case lists read the way you’d expect alphabetically. Turn it off and capital letters sort before lowercase letters, so a list of all-uppercase lines clusters ahead of lowercase ones.

Does it sort by the whole line, or just the first word?

The whole line. Two lines that start the same way sort by whatever comes after that shared beginning — "John Smith" and "John Adams" both start with "John," but "John Adams" sorts first because the comparison keeps going past the first word to "Adams" versus "Smith." Nothing is truncated or compared word-by-word in isolation.