Text

Text Line Sorter

Input

Sort text lines alphabetically or by length.

Sorting keeps one line per row.

Output

Frequently Asked Questions

What sorting options are available?
Sort alphabetically (A→Z or Z→A), numerically (for lines that start with numbers), by line length (shortest or longest first), or randomly. Case-sensitive and case-insensitive modes are available. Each line in the input becomes a sortable item.
How does numeric sorting work?
Lines are sorted by their leading numeric value. '10' sorts after '9' in numeric mode (correct) but before '9' in alphabetical mode (incorrect, as '1' < '9' lexicographically). Use numeric sort whenever your lines represent quantities or version numbers.
What defines a 'line' for sorting purposes?
Any text separated by a newline character (Enter key) is treated as one item. Blank lines are preserved and sorted as empty strings (which sort first or last depending on mode). Tab-separated columns within a line are treated as one unit.