Sort Lines
Sort lines alphabetically
Frequently Asked Questions
How do I sort lines of text alphabetically?
Paste your text (one item per line). The tool sorts lines A-Z by default. Options: reverse order (Z-A), case-sensitive or case-insensitive, numeric sort (so "10" comes after "9" not after "1"), and natural sort. Copy the sorted output with one click.
What is the difference between alphabetical and natural sort?
Alphabetical: "file1, file10, file2, file9" (character-by-character comparison). Natural sort: "file1, file2, file9, file10" (numbers treated as numeric values). Natural sort matches how humans expect items to be ordered. Use it for filenames and numbered lists.
Can I sort lines and remove duplicates at the same time?
Yes. Enable "remove duplicates" alongside sorting. The tool sorts first, then removes duplicate lines. This is equivalent to the Unix command sort -u. The result shows how many duplicates were removed and the final unique line count.
How do I sort a CSV file by a specific column?
Paste your CSV data. Select the column number to sort by (1-based). The tool parses CSV correctly, handling quoted fields with commas. Sort ascending or descending, with numeric or alphabetical comparison. The header row can be excluded from sorting.
Can I randomize the order of lines?
Yes. Select "shuffle" mode to randomize line order using a cryptographically secure random algorithm. Useful for randomizing lists, creating random playlists, shuffling quiz questions, or selecting random items. Each shuffle produces a different order.