Back to Tools

Text Sorter

Sort lines alphabetically A–Z or Z–A with smart options

0
0
0
Input Lines

Put a list in alphabetical order

Sorting a list by hand is slow and error-prone once it goes past a dozen entries. Text Sorter treats each line as an item and reorders the whole list alphabetically, either ascending or descending. It suits names, keywords, file names, ingredients, product codes and anything else that lives one per line.

Sorting step by step

  1. Put one item per line in the Input Lines box. Paste from the clipboard, load a .txt file with File, or press Sample to try the tool with a set of animal names.
  2. Choose the direction with the radio buttons: A to Z or Z to A.
  3. Set the checkboxes: Case-insensitive (on by default), Trim lines (off by default) and Skip blank lines (on by default).
  4. Click Sort Lines.
  5. The summary confirms the number of lines and direction, and Before and After counts appear. Use Copy or .TXT (sorted-text.txt).

How the options affect the order

  • Case-insensitive lowercases each line before comparing, so Banana and apple sort together rather than capitals being grouped separately. Without it the comparison follows your browser's locale rules.
  • Trim lines removes leading and trailing spaces from every line, which prevents an entry with a stray space from jumping to the wrong position. The trimmed version is what appears in the output.
  • Skip blank lines drops empty lines. If unticked, blank lines are kept and sort to the top in A to Z order.

Common uses

  • Alphabetizing a bibliography, glossary or attendee list.
  • Ordering keywords or tags before importing them.
  • Sorting entries in a config or ignore file so changes are easy to review.
  • Arranging a shopping or packing list.

Limitations

The comparison is alphabetical, not numeric, so lines starting with numbers sort as text: 10 comes before 2. If you need numeric order, pad the numbers with leading zeros first. The sort works on the whole line, so it cannot order by the second word or by a column. Z to A is produced by reversing the ascending result. Accented letters are placed according to the browser's locale rules. The sorting runs in your browser page and your input box is not altered, so you can flip the direction or change an option and sort the same list again without pasting it twice.


Related Tools

Related Tools


Frequently Asked Questions

Does it sort numbers correctly?
Not numerically. Lines are compared as text, so 10 comes before 2 because the character 1 precedes 2. To get true numeric order, add leading zeros so every number has the same number of digits, then sort again.
What does the Sample button do?
It fills the input box with a short list of animal names in mixed order so you can see how sorting works. Clear it or replace it with your own lines when you are ready to use real data.
What does Case-insensitive change?
When on, each line is compared in lowercase, so upper and lower case versions of the same letter sort together. When off, the comparison uses your browser's locale rules, which can place capitalized and lowercase entries differently.
What happens to blank lines?
With Skip blank lines ticked, empty lines are removed before sorting. If you untick it, the blank lines stay in the list and end up at the top when you sort A to Z, or at the bottom for Z to A.
Can I sort by something other than the start of the line?
No. Each whole line is compared from its first character. To sort by a different part, such as a surname at the end, rearrange the lines so that part comes first, sort, then rearrange them back.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.