About this tool
Sort, reverse, shuffle or number lines of text.
The Line Sorter takes any block of text and reorders its lines according to your chosen rule. Sort alphabetically A–Z or Z–A, sort by line length (shortest or longest first), randomise the order, reverse the current order, or add sequential line numbers. Works with lists, code imports, CSV rows, and any other line-based content.
Example
Input: banana / apple / cherry → Sort A–Z: apple / banana / cherry
How to use
- Paste your text — one item per line.
- Choose Sort A–Z, Z–A, by Length, Shuffle, Reverse or Number.
- Result appears immediately.
- Copy to clipboard.
Features
- Alphabetical A–Z and Z–A
- Sort by line length
- Shuffle / randomise order
- Reverse current order
- Add sequential line numbers
Frequently Asked Questions
Is sorting case-sensitive?+
By default uppercase letters sort before lowercase. Enable case-insensitive mode to interleave them.
Can it sort numbers correctly?+
Numeric sort mode treats lines starting with digits as numbers, so "9" correctly sorts before "10".
What happens to blank lines?+
Blank lines are included in the sort by default. You can choose to strip them before sorting.
How large a list can I sort?+
The tool handles thousands of lines in the browser without any performance issues.
Does numeric sort handle decimal numbers?+
Numeric sort treats lines starting with digits as numbers: 1, 2, 10 (not 1, 10, 2).
Can I sort by line length?+
Yes. "Sort by length" arranges shortest lines first — useful for building cascading CSS or compact lookup tables.