Skip to content

Text Tools

Sort Text

Paste any line-separated list and get it back in alphabetical order instantly.

  • Free
  • No sign-up
  • Runs in your browser

Guide

How alphabetical line sorting works

Sorting a list of lines puts them in an order based on their characters, so that entries beginning with "a" come before those beginning with "b", and so on. The tool splits your text at each line break, sorts the lines as units, and joins them back together. Each line moves as a whole, and the words inside a line are never rearranged.

The comparison uses your browser's locale-aware text comparison rather than a raw character code comparison. In practice that means uppercase and lowercase versions of a letter are placed together instead of all capitals coming before all lowercase letters, and accented letters sort close to their plain forms. The exact ordering of unusual characters can differ between browsers and language settings.

Why people sort text lists

A sorted list is easier to scan, compare, and check for gaps. Typical uses include alphabetizing a bibliography or glossary, ordering a set of names, tidying import statements or config keys, organizing tags, and preparing data so that equal items sit next to each other for review.

Sorting is also a quick way to spot oddities, since stray entries with leading spaces or odd characters tend to jump out at the top or bottom. If your list contains repeats, run it through Remove Duplicate Lines as well, which keeps the original order, then sort the cleaned result here.

How to sort text with this tool

  1. Paste or type your list into the Input box, one item per line. It begins with a small fruit list as a sample.
  2. The Output box shows the lines sorted from A to Z immediately. There is no sort button.
  3. Edit the input and the output updates as you go.
  4. Click Copy result to copy the sorted list.

This page sorts ascending only. The output box is read-only, and there is no download option, so paste the copied result wherever you need it. The sorting happens in your browser and nothing is sent to a server.

Things to watch for when sorting

Numbers are sorted as text, character by character, not by value. A list containing 10, 9, and 2 will come out with 10 first, then 2, then 9, because "1" comes before "2". If numeric order matters, pad the numbers with leading zeros (for example 02, 09, 10) before sorting.

Blank lines are sorted along with everything else, and they usually end up at the top, so remove empty lines first if you do not want gaps. Leading spaces also affect order, so an entry that starts with a space will move away from where you expect.

There are no options for case-sensitive sorting, reverse order, or sorting by a particular column or word. The tool treats each full line as one unit from its first character. For tasks like that, a spreadsheet or a script is a better fit.

Frequently asked questions

Can I sort Z to A?

Not on this page. The Sort Text tool sorts ascending, from A to Z. You can paste the output into a spreadsheet if you need a descending order.

Why is 10 listed before 2?

Lines are compared as text, so the first character decides. Since 1 comes before 2, the value 10 sorts ahead of 2. Pad numbers with leading zeros if you want numeric order.

Does capitalization affect the order?

Not in the usual way. The comparison is locale-aware, so Apple and apple are placed next to each other rather than all capitals sorting first.

Is the sorted text stored anywhere?

No. Sorting happens in your browser as you type, and the tool has no step that uploads your text.