Sort Lines Alphabetically, Naturally or by Length
Paste a list, choose an order and this tool will sort lines in one step. It handles plain alphabetical order as well as the “natural” order people expect for file names and version numbers.
Example: alphabetical vs natural order
Input A → Z Natural
file10.txt apple apple
file2.txt Banana Banana
Banana cherry cherry
apple file1.txt file1.txt
file1.txt file10.txt file2.txt
cherry file2.txt file10.txt
Plain alphabetical sorting compares character by character, and “1” comes before “2”, so file10 lands before file2. Natural sorting reads runs of digits as whole numbers, which puts 2 before 10 and v1.9 before v1.10.
Sort orders explained
- A → Z / Z → A: standard alphabetical order using your browser's language rules.
- Natural / natural descending: like A → Z, but numbers inside the text are compared by value.
- By length / longest first: counts characters per line; lines of equal length are ordered alphabetically.
- Reverse current order: flips the list without sorting it, so the last line becomes the first.
- Random: an unbiased shuffle (Fisher–Yates), giving a new order each time. Shuffle Lines does only this.
Case sensitivity
With case sensitivity off (the default), sorting is language-aware: “apple”, “Apple” and “Äpfel” are grouped by their base letters, and accents do not push a word to the end. In A → Z order, lines that differ only in case are placed with the capitalized one first.
With case sensitivity on, the A → Z and Z → A orders compare lines by raw Unicode code points. All capital letters come before all lowercase letters, and accented letters come after “z”:
Case-insensitive: Äpfel, Apple, apple, zebra
Case-sensitive: Apple, apple, zebra, Äpfel
Code-point order matches what many programming languages do by default, which helps when you need the same order as a script. The natural and by-length orders ignore this setting and always use the language-aware comparison.
Duplicates and empty lines
Empty lines are removed by default so they do not collect at the top of the list. The duplicate filter keeps one copy of each identical line; it always compares exactly, so “Apple” and “apple” both remain. For case-insensitive de-duplication without sorting, use Remove Duplicate Lines.
Sorting numbers
Alphabetical order puts “100” before “25”. Natural order fixes whole numbers, but it does not understand minus signs or decimal fractions. For lists of numeric values, the Number Sorter compares actual values. To sort titles while ignoring “The” or “A”, try Alphabetical Order.
Privacy
Sorting runs in your browser; the list is not uploaded.