🔤 A-Z · Length · Numeric · Random

Sort Text
Lines

Sort any list of lines alphabetically A-Z or Z-A, by length, numerically, or shuffle them randomly. Instant results.

🔤A → ZAlphabetical
🔤Z → AReverse alpha
📏Short→LongBy length
📏Long→ShortBy length
🔢1→100Numerical
🎲ShuffleRandom
↕️ReverseFlip order
Case insensitive Trim spaces Remove duplicates Remove empty lines
Input — one item per line
Sorted result

Free Online Line Sorter — Sort Text Alphabetically and More

ExperToolBox's line sorter lets you sort any list of text lines in multiple ways: alphabetically A-Z or Z-A using locale-aware comparison, by line length (shortest first or longest first), numerically for lists of numbers, randomly for shuffling, or simply reverse the current order.

Additional options let you perform case-insensitive sorting, trim leading and trailing spaces before comparing, remove duplicate lines from the result, and strip empty lines. All options work in combination — for example, you can sort alphabetically, case-insensitively, with duplicates removed and empty lines stripped in one step.

When do you need to sort lines?

Sorting is essential for working with keyword lists in SEO (finding duplicates, organising by theme), cleaning up database exports, alphabetising glossaries or dictionaries, organising file lists, processing log files, and preparing data for comparison or deduplication.

Frequently Asked Questions

How does alphabetical sorting handle accented characters?
Sorting uses JavaScript's localeCompare() which follows the language-sensitive ordering rules of the browser's locale. Accented characters like á, é, ñ are sorted correctly relative to their base letters according to the relevant language rules.
How does numerical sorting work?
Numerical sorting extracts the leading number from each line and sorts by that number value. Lines without leading numbers are sorted to the end. This is useful for lists like "1. Item", "10. Item", "2. Item" which would sort incorrectly with plain alphabetical sorting.
Does it preserve the original content?
Yes, unless you enable "Remove duplicates" or "Remove empty lines". The content of each line is preserved exactly — only the order changes. With "Trim spaces" enabled, leading/trailing spaces are removed before comparison but the original content is kept in the output.

Other Free Text Tools