Text Sorter
Put any list of lines into order in a single click
What the Text Sorter Does
The Text Sorter takes a list, with one item per line, and puts the lines into order. Paste in a column of names, keywords, URLs, product codes or notes, choose a direction, and you get a tidy, organised list back immediately. It saves the effort of dragging rows around in a spreadsheet or writing a script for a task that should take seconds.
People use it for everything from alphabetising a bibliography to tidying a configuration file, and it works with any plain text where each line is a separate item.
When Sorting Text Is Genuinely Useful
- Keyword and topic lists. Alphabetise a research list so duplicates and near-duplicates sit next to each other and are easy to spot.
- Names and contacts. Order attendees, students or members before printing a register.
- Code and configuration. Many teams keep import statements, dependency lists, CSS properties and environment variables in alphabetical order to make changes easier to review.
- URLs and redirect lists. Sort a long list of addresses before checking or mapping them, so related pages are grouped.
- Glossaries and references. Build an A-to-Z list from notes gathered in random order.
- Product and inventory codes. Put SKUs into sequence for comparison with another list.
How to Use the Text Sorter
- Paste your text into the input box, making sure each item is on its own line.
- Pick the sort direction, ascending (A to Z) or descending (Z to A).
- Apply any extra options offered, such as treating uppercase and lowercase the same.
- Run the sorter and review the output.
- Copy the sorted list and paste it back into your document, spreadsheet or code editor.
If your items are separated by commas rather than line breaks, first convert them into separate lines so each one is sorted individually. Otherwise the whole line is treated as a single item.
Understanding How Sorting Really Works
Sorting looks simple until the result surprises you. A few behaviours are worth knowing so you can interpret the output correctly:
- Letters versus numbers. A plain alphabetical sort compares text character by character, so "item10" appears before "item2" because the character "1" comes before "2". If your list contains numbers inside the text, check the order carefully, or pad numbers with leading zeros.
- Capital letters. Depending on the method, uppercase letters can be placed before all lowercase ones. A case-insensitive sort avoids this and produces the order most people expect.
- Accents and special characters. Languages order accented letters differently. The Unicode standard describes a full collation algorithm for this, and in JavaScript the Intl.Collator object applies language-specific sorting rules.
- Leading spaces and blank lines. Invisible spaces at the start of a line can push items to the top. Tidy your list first if the order looks strange.
Tips for Cleaner Lists
- Remove empty lines before sorting so they do not collect at the top or bottom.
- Trim stray spaces from the start and end of items.
- Use consistent capitalisation if the list will be used for display, since sorting does not change how an item looks.
- Keep a copy of your original list in case the original order carried meaning, such as ranking or priority.
How It Compares With Other Ways of Sorting
You can sort lines in a spreadsheet, in a code editor or with a command-line utility, and for large or repeated jobs those are excellent options. The advantage of an online tool is speed and convenience for the one-off task: nothing to install, no formulas to write and no file to import. The Text Sorter on WebTOOLkt is free to use and designed to fit into a chain of small text operations. For example, you can clean up a messy list with a line-break remover, sort it, compare it with an earlier version and count the words, all without leaving the site.
Related WebTOOLkt Tools
- Text Repeater to duplicate lines or patterns before sorting.
- Remove Line Breaks to merge lines or fix messy pasted text.
- Comma Separator to turn a column of items into a comma-separated list, or the other way around.
- Text Compare to check what changed between two versions of a list.
- Case Converter to standardise capitalisation before you sort.
- Word Counter to count words and characters in the final result.
Useful External Resources
Frequently Asked Questions
Does the sorter change the wording of my lines?
No. It only changes the order of the lines. The text inside each line stays exactly as you entered it.
Why does "item10" come before "item2"?
Standard sorting compares characters one by one, not numeric values. Adding leading zeros, such as "item02", gives the order you expect.
Can I sort a list that has duplicates?
Yes. Identical items will appear together, which makes duplicates easy to spot and remove.

