Line Sorter
Sort text lines alphabetically, by length, or randomly. Remove duplicates, trim whitespace, reverse order. Free online line sorting tool for lists, CSV data, and code lines.
Frequently Asked Questions
How does the line sorter work?
Paste your text into the input area, choose a sorting method, and click "Sort Lines". The tool splits your text by line breaks, applies the selected sorting algorithm, and displays the result. Each line is treated as a separate item, making this perfect for sorting lists, names, URLs, or any line-based data.
What sorting methods are available?
Eight methods: Alphabetical (AโZ), Reverse Alphabetical (ZโA), Length (shortest or longest first), Random Shuffle, Reverse Original Order, and Numeric Sort (ascending or descending). Numeric sort extracts the first number from each line and sorts by that value โ useful for sorting lines like "Item 42", "Item 7", "Item 100".
What does "Case insensitive" do?
When enabled, uppercase and lowercase letters are treated equally during alphabetical sorting. For example, "apple", "Banana", and "cherry" sort as "apple โ Banana โ cherry". When disabled, uppercase letters sort before lowercase (ASCII order): "Banana โ apple โ cherry". Most users want case-insensitive sorting.
Can I remove duplicate lines?
Yes. Check "Remove duplicates" to eliminate duplicate lines from the output. Combined with case-insensitive mode, "Apple" and "apple" are treated as duplicates. This is useful for cleaning up lists that have been merged from multiple sources.
Is the random shuffle truly random?
The shuffle uses the Fisher-Yates algorithm with Math.random(), which provides a uniform distribution. However, Math.random() is not cryptographically secure โ if you need cryptographic randomness, use a dedicated tool. For shuffling lists, playlists, or randomizing assignments, it's more than sufficient.
Is this tool free?
Yes, completely free with no sign-up required. All sorting happens in your browser โ your data is never uploaded to any server.