UTILS.
100% in-browser

Line Sorter

Sort lines alphabetically, numerically, by length, or shuffle them.

output

About this tool

Line Sorter reorders the lines of a block of text by a rule you choose and refreshes the result as you type. Available modes are alphabetical ascending or descending (A to Z, Z to A), numeric ascending or descending, sorting by line length from shortest to longest, and a random shuffle.

Two checkboxes refine the output. Remove duplicates keeps only the first occurrence of each line and is applied after the sort. Case-insensitive folds letter case so that ordering and duplicate matching ignore capitalization, while the original casing is preserved in what you copy. Alphabetical order is a direct character-code comparison, and numeric mode reads the number from the start of each line, so it handles plain figures as well as values like 12 apples.

All of this happens in your browser. There are no uploads, no accounts, and no tracking, and the tool keeps working offline once the page has loaded.

Frequently asked questions

How does numeric sorting work?
Each line is parsed as a number starting from its first characters, and any trailing text is ignored, so 12 apples is read as 12. Lines are then ordered by that value ascending or descending, and lines that do not begin with a number fall into an unpredictable position.
Can I remove duplicate lines?
Yes. Enable remove duplicates to keep only the first occurrence of each line; it runs after the sort or shuffle. With case-insensitive also on, lines that differ only in capitalization are treated as duplicates.
Is alphabetical sorting case-sensitive?
By default yes, because lines are compared by character code, so uppercase letters sort ahead of lowercase ones. Turn on case-insensitive to ignore capitalization; the original casing is still kept in the output you copy.
Is my text uploaded or processed on a server?
No. All sorting, shuffling, and deduplication run locally in your browser with JavaScript. Nothing is sent anywhere, there are no accounts or tracking, and the tool works offline once loaded.

More tools