Sort Lines
Sort lines of text alphabetically (A-Z or Z-A) with natural number order, by line length, or shuffle and reverse them.
Sort Lines tool
Example
Input: 3 lines: item10, item2, item1 - Sort Order A-Z
Result: item1 / item2 / item10
Sorting is natural (number aware), so item2 comes before item10 instead of the plain character order item1, item10, item2.
- Paste or type the lines of text you want to sort into the input area.
- Select a sort order from the menu: A to Z, Z to A, Shortest First, Longest First, Shuffle, or Reverse Order.
- For alphabetical sorts, numbers inside lines are ordered naturally, so 2 comes before 10.
- Review the sorted output that appears instantly in the result area.
- Click the copy button to copy the sorted lines to your clipboard.
Sorting Lines Alphabetically, by Length or at Random
Sort Lines puts every line of your text in order. Choose A to Z, Z to A, shortest first, longest first, a random shuffle or a plain reverse, and the sorted list appears right away.
The alphabetical sorts are number-aware, which is often called natural sort. A plain computer sort compares text one character at a time. So "Item 10" lands before "Item 2", because 1 comes before 2. This tool reads the whole number instead, which gives you Item 1, Item 2, Item 10. Sorting follows the language rules of your browser. Accented letters such as é sit next to e rather than after z, and capital and small letters are sorted together.
The length sorts count characters, spaces included. Lines of equal length keep their original order. Shuffle uses the Fisher-Yates method, which gives every possible order the same chance. That makes it fair for a running order or a quiz. Reverse simply flips the list upside down without sorting, so the last line becomes the first.
Sort Lines keeps repeated lines and blank lines, and blank lines go to the top in A to Z order. To keep each line only once, run the text through Remove Duplicate Lines first. To turn the sorted result into a comma-separated or numbered list, use the List Converter.
Frequently Asked Questions
Related Tools
Remove Duplicate Lines
Remove duplicate lines from text while keeping the original order. Supports case-sensitive and case-insensitive modes.
Text and WritingWord Counter and Character Counter
Count words, characters, sentences, and paragraphs in your text. Includes reading time and speaking time estimates.
Text and WritingFind and Replace
Find and replace text with regular expressions, capture groups, case-sensitive matching, and a live match count.
Text and WritingWhitespace Remover and Trimmer
Remove extra whitespace, trim leading and trailing spaces, collapse multiple spaces, and clean up messy text formatting.
Text and Writing