About the Sort Lines
Sort lines alphabetically, by length, in natural order (so item2 comes before item10), or shuffle them randomly.
Key features
- Sort A→Z or Z→A with locale-aware ordering
- Natural sort: item2 comes before item10
- Sort by line length, shortest or longest first
- Reverse order or random shuffle
- Optional case-insensitive sort and de-duplication
- Remove empty lines while sorting
Sort lines of text instantly
Alphabetize a list of names, order file names numerically, shuffle quiz questions, or find the longest entries. Sort Text Lines handles every common ordering, with options to ignore case, remove duplicates and drop blank lines.
Sort modes
| Mode | Input | Output |
|---|---|---|
| A → Z | banana, Apple, cherry | Apple, banana, cherry |
| Z → A | cherry, banana, Apple | |
| Natural | item10, item2, item1 | item1, item2, item10 |
| Shortest first | kiwi, fig, banana | fig, kiwi, banana |
| Longest first | banana, kiwi, fig | |
| Reverse order | a, b, c | c, b, a |
| Random | a fair shuffle |
Alphabetical vs. natural sorting
| Alphabetical | Natural |
|---|---|
| img1.png | img1.png |
| img10.png | img2.png |
| img2.png | img10.png |
Natural sorting is what people expect for file names, versions, chapters and invoice numbers.
Use cases
- Lists and glossaries in alphabetical order.
- Bibliographies and references.
- Keyword lists sorted and de-duplicated in one pass.
- Random order for raffles, quiz questions, team picks or test data.
- Code: sort import statements, CSS properties or enum values.
Related tools
De-duplicate without sorting using Remove Duplicate Lines, sort words within a sentence with the Word Sorter, or reverse lines with Reverse Text.
How to use the Sort Lines
- Type or paste your text into the input box.
- Choose the options you want.
- The result updates instantly as you type.
- Copy the output or download it as a .txt file.