How to use
Paste one item per line
Type or paste your list into the Your list box. Press Try sample to load a short list with mixed capitals, a blank line and numbered items like item2 and item10.
Pick a sort order
Choose from the Sort order menu, for example Natural A to Z or Numeric, smallest first. For Random shuffle, press Shuffle again to get a new order.
Set options and copy
Set the separators, tick Sort by column for CSV lines, and tick any clean-up options. Check the in and out counter, then press Copy or Download .txt.
Why Sort Lines Alphabetically
- Ten orders, including natural sort that puts item2 before item10.
- Sort CSV or tab-separated lines by any column.
- Reads and writes lines, commas, semicolons, tabs or a custom separator.
- Removes duplicates, empty lines, spaces, HTML tags and punctuation in the same step.
Examples of each sort order
The table uses the sample list: item10, Banana, item2, apple, a blank line, cherry, item1, banana, Apple. Case-sensitive is off and no other option is ticked.
| Sort order | Result (blank line shown as ___) |
|---|---|
| Alphabetical A to Z | ___, apple, Apple, Banana, banana, cherry, item1, item10, item2 |
| Alphabetical Z to A | item2, item10, item1, cherry, Banana, banana, apple, Apple, ___ |
| Natural A to Z | ___, apple, Apple, Banana, banana, cherry, item1, item2, item10 |
| Length, shortest first | ___, item2, apple, item1, Apple, item10, Banana, cherry, banana |
| Reverse current order | Apple, banana, item1, cherry, ___, apple, item2, Banana, item10 |
| A to Z with Case-sensitive on | Apple, Banana, apple, banana, cherry, item1, item10, item2 (with Remove duplicates and Remove empty lines also on) |
Common sorting mistakes
Most surprising results come from one of a few causes. Check these before assuming the sort is wrong. The line counter helps here too: if fewer lines come out than went in, an option such as Remove duplicates or Remove empty lines is switched on.
- Numbers inside text sorted alphabetically: use Natural A to Z so file2 comes before file10.
- Leading spaces: a line that starts with a space sorts before letters. Tick Trim spaces on each line.
- Blank lines at the top: empty lines sort first in A to Z. Tick Remove empty lines.
- Numeric sort with units first: a line like USD 25 has no leading number, so it goes to the end. Remove the prefix before sorting.
- Decimal commas: 2,5 is read as 25 because commas are treated as thousands separators. Replace decimal commas with dots first.