Line Sorter
Sort each line of text in ascending/descending order, or shuffle randomly.
Category: Text Tools
When to use?
Use it to sort lists like country or product names alphabetically, or to shuffle quiz items or a draw list randomly.
How to use
- Paste the text into the input.
- Choose the sort method (ascending, descending, random).
- Copy the sorted result.
Input Explanation
Paste the multiple lines of text you want to sort.
Calculation Basis
It splits text into lines and applies the default sort or localeCompare for ascending/descending, or the Fisher-Yates algorithm for a random shuffle.
Usage Examples
- Sort a list alphabetically - Sort lists like country or product names alphabetically.
- Shuffle randomly - Use it to shuffle quiz items or a draw list randomly.
- Prep for dedup checks - Sorting puts identical values adjacent, making duplicates easy to spot.
Examples
- apple, zebra, banana → ascending → apple, banana, zebra
- item2, item10, item1 → natural sort → item1, item2, item10
Cautions
- Results can vary by how line-break characters (LF/CRLF) are handled.
- Results may differ from other tools depending on locale and Unicode handling.
Guides
Sort basis
It splits text into lines and sorts ascending (A-Z) or descending. With numbers mixed in, lexical and numeric sorting can differ.
Use for list management
Handy for quickly sorting lists of countries, items, or names alphabetically. Pair with the duplicate remover for a clean list.
FAQ
Is Korean sorting supported?
Yes, it supports Korean alphabetical (ganada) sorting.
How are lines with numbers sorted?
Natural sort is used so item2 comes before item10.
Is sorting case-sensitive?
It sorts by locale, grouping cases adjacently.
How are empty lines sorted?
Empty lines are treated as lines and usually gather at the top of the result.
Related Tools
- Character Counter - Count characters with and without spaces, and line count, in real time.
- Byte Counter - Calculate the byte length of text when stored as UTF-8.
- Case Converter - Convert text, variable names, and filenames to UPPER, camelCase, snake_case, kebab-case, and more.
- Whitespace Remover - Remove whitespace in various ways — leading/trailing, duplicate, or per-line.
- Duplicate Line Remover - Remove duplicate lines from text, keeping only unique lines.
- Markdown Preview - Render Markdown in real time and provide an HTML preview.