Sort text lines A–Z, by number, shuffle
- Free
- No sign-up
- No upload
- Works offline
Tool facts
- Opens
TXTMDCSV- Saves as
TXT- Price
- Free, no sign-up, no watermark
- Are files uploaded?
- No. Everything is processed in this browser, on your device.
- Batch processing
- One file at a time
- Offline use
- Works without a connection once this page has loaded
- Built with
- Web Crypto
- Browser
- A recent Chrome, Edge, Firefox or Safari, on computer or phone.
Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.
About Sort Lines
Sort Lines puts every line of a text in order: alphabetically from A to Z or Z to A, by the number in each line, by line length, in reverse order or in random order. Paste a list of names, keywords, file names or values, and the sorted list appears immediately. Alphabetical sorting follows the collation rules of your language, so accented letters such as é and ö sort next to their base letters instead of after Z.
Natural sort, which is on by default, compares numbers by value, so "file2" comes before "file10" and "Item 9" before "Item 12". Ignore case puts "apple" and "Apple" together. Numeric sort reads the first number in each line, including negatives, decimals and thousands separators like 1,250, and moves lines without a number to the end. Shuffle uses the browser's cryptographic random generator for a fair random order. You can also trim spaces, drop empty lines and remove duplicates in the same step.
Sort Lines runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.
How to use Sort Lines
- Paste your list into the Input box, one item per line, or click Open file.
- Pick an Order: A → Z, Z → A, numbers ascending or descending, shortest or longest first, reverse or shuffle.
- Adjust Ignore case, Natural sort, Trim spaces, Remove empty lines and Remove duplicates as needed.
- Copy or download the sorted list from the Output box. In shuffle mode, click Shuffle again for a new order.
Frequently asked questions
What is natural sort?
Natural sort compares runs of digits as numbers rather than character by character. A plain alphabetical sort puts "img10" before "img2" because the character 1 comes before 2; natural sort gives img2, img10, which is what people expect for numbered files and versions.
How does sorting by number work?
Each line is sorted by the first number it contains, so "Chapter 3: Intro" sorts as 3 and "-4.5 °C" as -4.5. Commas are treated as thousands separators. Lines that contain no number are placed after the numbered lines, in alphabetical order.
How are accented letters and other alphabets sorted?
The tool uses Intl.Collator with the language of this page, which follows the Unicode Collation Algorithm. Accented letters sort with their base letter, and Cyrillic, Greek and other scripts sort in their own alphabetical order.
Is the shuffle truly random?
It uses the Fisher–Yates algorithm with crypto.getRandomValues, so every order is equally likely. It is suitable for picking a random order for a list or a draw; nothing about it is predictable from the previous result.
Is my list uploaded?
No. Sorting runs entirely in your browser, so your lists never leave your device.