How do I sort a list of text lines?
Paste a list, get it back sorted alphabetically, by length, randomly, or in reverse order.
With options: ignore case, remove empty lines, trim trailing spaces. Perfect for organizing shopping lists, contacts, todos, files.
How to use it
- Paste text, each line is one list item.
- Pick a sort mode: alphabetical A-Z or Z-A, by length, random, reverse order.
- Toggle options as needed, remove empty lines, ignore case, trim trailing spaces.
- The result appears immediately, click "Copy" to grab it.
When this is useful
Everyday lists worth tidying up:
- Contact or name list: sorted alphabetically makes it easier to find a specific entry.
- Shopping list or product list: sorting helps spot duplicates (though for that, our duplicate remover is purpose-built).
- File listings: "ls" in a terminal gives a list, sort by name or length.
- Random pick: "who do I invite to lunch today?", type names, "Random order", take the first.
- Shuffle a playlist: list of songs into a random listening order.
- Education, learning algorithms: see how alphabetical sorting handles diacritics (é, ñ, etc.).
If you want to remove duplicate lines instead of sorting, use our duplicate remover. To clean up extra spaces, try the whitespace cleaner.