Sort Lines

Paste any list and sort it alphabetically, by length, or randomly — instantly. Combine with options to trim whitespace or remove blank lines.

Input
0 lines
Result
0 lines

How to use the Line Sorter

Paste your list into the left panel — one item per line. Select a sort order from the buttons above and the result appears instantly on the right. Use the options to trim whitespace from each line, remove blank lines, or deduplicate before sorting.

Sort modes explained

A → Z — standard alphabetical order using locale-aware comparison. Numbers come before letters.

Z → A — reverse alphabetical order.

Shortest first — sorts lines by character length, ascending. Lines of equal length are sorted alphabetically.

Longest first — sorts lines by character length, descending.

Random — shuffles the list randomly using the Fisher-Yates algorithm. Re-click to get a different shuffle.

Frequently asked questions

By default, sorting is case-insensitive so "apple" and "Apple" are treated the same. Enable "Case sensitive" to sort uppercase letters before lowercase (standard ASCII order).
The Random mode uses the Fisher-Yates (Knuth) shuffle algorithm, which produces an unbiased random permutation of the list. Each click of the Random button produces a different result. All randomness is generated locally in your browser.
No limit. You can sort thousands of lines. All processing happens locally in your browser.
No. Everything runs in your browser. Your text never leaves your device.

Other tools you might like