Sort Lines
The Sort Lines tool sorts lines of text alphabetically, numerically, by length, or in reverse order. It is essential for organizing lists, data files, and any line-based content. This tool supports multiple sorting modes: alphabetical (A-Z), reverse alphabetical (Z-A), numerical, by line length, and random shuffle. Perfect for sorting CSV data, todo lists, log files, or any text that needs organization.
Formula
Sort modes: - Alphabetical: A to Z - Reverse alphabetical: Z to A - Numerical: by leading number - By length: shortest to longest - Reverse length: longest to shortest - Random: shuffle lines - Case sensitive or insensitive
Example
Input: banana apple cherry Alphabetical: apple banana cherry Reverse: cherry banana apple By length: apple banana cherry
How to Use
- Paste your text into the input field
- Select the sort mode (alphabetical, numerical, by length, random)
- Choose case sensitivity
- Click sort to organize the lines
- Copy the sorted output
Frequently Asked Questions
How does numerical sorting work?
Numerical sorting extracts the leading number from each line and sorts by that number. For example, '10 apple' comes after '2 banana' in numerical sort, but before it in alphabetical sort. This is useful for numbered lists.
Can I sort case-insensitively?
Yes. By default, the tool is case sensitive: 'Apple' comes before 'banana' (uppercase before lowercase in ASCII). Enable case-insensitive mode to sort 'apple' and 'Apple' together, treating them as equal.
What is random shuffle?
Random shuffle randomly reorders the lines. This is useful for randomizing lists, creating randomized quizzes, or shuffling playlist items. Each shuffle produces a different random order.
Does the tool handle Unicode characters?
Yes. The tool sorts Unicode characters by their code points. For accented characters, the sort order follows Unicode code points, which may not match dictionary order in all languages. For language-specific sorting, use a locale-aware sort.
Can I sort by a specific column?
The tool sorts entire lines. For column-based sorting (e.g., sorting CSV by the second column), use a spreadsheet or a dedicated CSV tool. The tool is designed for simple line-based sorting.