Sort lines
Sort a list of lines alphabetically, in number order, by length, in reverse, or shuffle it randomly.
Your files stay on your device. Nothing is uploaded.
Step 1: Type or paste your text
Step 2: Options
Step 3: Copy or download
How to sort lines
-
Paste your list
Paste the lines into the first box.
-
Choose the order
Pick A to Z, Z to A, numbers in order, shortest first, reverse or shuffle. Choose whether capital letters matter and whether to remove duplicates.
-
Copy the sorted list
The sorted list appears as you type. Copy it or download a .txt file.
About this tool
Numbers in order
Normal A to Z sorting puts "item 10" before "item 2", because it compares one character at a time. Numbers in order reads numbers as numbers, so item 2 comes before item 10.
Shuffle is truly random
Shuffle uses your browser's secure random number generator and a fair shuffle, so every order is equally likely. Useful for random groups, draws and quiz questions.
Letters of every language
Sorting follows the rules of your device's language, so accented letters and other alphabets sort where people expect them.
Privacy
This tool runs in your browser, on your own device. Your files and text are not uploaded to our server and we cannot see them. When you close or reload this tab, they are cleared, along with the results.
Frequently asked questions
Where do blank lines go?
Blank lines are left out when sorting, so they do not all gather at the top. Reverse keeps the list exactly as it is, upside down.
Can I sort by a column?
Not here. For tables, open the file in a spreadsheet, or convert it with CSV to Excel first.
Is my list uploaded?
No. The text stays in your browser and is never sent anywhere.
Can I remove duplicates at the same time?
Yes. Tick Remove duplicate lines.
Related tools
- Dedupe Remove duplicate lines Delete repeated lines from a list, keeping the first copy.
- Replace Find and replace Replace words or patterns in text, with a count of changes.
- Diff Text compare Compare two texts and see what was added or removed.
- Aa › AA Case converter Change text to upper, lower, title or sentence case.
- Words Word counter Count words, characters and sentences as you type.
- 1 › 100 Random number generator Pick random numbers in any range, with no repeats if you like.
- Picker Spin the wheel Spin a wheel to pick a random name or choice.
- CSV › XLSX CSV to Excel Convert a CSV file to an Excel workbook and keep leading zeros.