Line Sorter

Sort, deduplicate, reverse, shuffle, and clean up lines of text instantly.

Input
Operations
Output

About Line Sorter

This tool processes text line by line. Each newline-separated entry is treated as one item. All operations run entirely in your browser — no data is sent to any server.

Available operations

Sort A→Z / Z→A: Alphabetical sort using locale-aware comparison. Enable case-insensitive to ignore upper/lower case.

Reverse: Flips the order of lines without any sorting.

Shuffle: Randomises line order using the Fisher-Yates algorithm.

Remove Duplicates: Removes duplicate lines, keeping the first occurrence. Case-insensitive option makes it ignore case when detecting duplicates.

Remove Empty Lines: Strips blank lines and whitespace-only lines from the result.

Trim Each Line: Removes leading and trailing whitespace from every line.

Number Lines: Prepends a line number and a tab to each line (e.g. 1  banana).

Frequently asked questions

Does this sort numbers correctly?
Lines are compared as text strings, so "10" sorts before "2" in a standard A→Z sort. To sort numbers, prepend a leading zero so all values have the same digit count, or use Number Lines to see the original order first.
Can I chain multiple operations?
Yes. Click any operation button and the result appears in the Output box. Copy the output back into the Input to apply a second operation.
How large can the input be?
Processing happens in your browser. Files up to several hundred thousand lines work fine on modern hardware. For very large files the browser may be slow briefly while sorting.

Related tools