Sort lines
Paste a list and sort it A-Z, in Thai alphabetical order, by number, by line length, in reverse, or shuffle it. Thai is sorted with the browser's own Thai collation, so words come out in dictionary order, not by character code. It runs in your browser and the text is not sent anywhere.
This tool needs JavaScript. If you still see this after a few seconds, JavaScript is switched off in your browser or the page did not load completely: turn JavaScript on or reload the page.
How to use it
- Paste the list into the box on the left, one item to a line, or press "Open file".
- Choose what to sort by, and ascending or descending. The result shows at once.
- Press "Copy" or "Download" to take the result.
Frequently asked questions
Is the Thai sorting right?
Yes. It uses the browser's Thai collation (Intl.Collator), which sorts by consonant first and ignores the leading vowels เ แ โ ไ ใ, so you get ก ไก่ ข แมว เอ as a dictionary would. A plain sort by character code gives a different order (the "By character code" choice lets you compare).
How do I get 2 before 10?
Choose "Number": the tool reads the first number of each line (Thai digits and thousands separators such as 1,200 work too) and sorts by value. To sort by letters but still put file2 before file10, tick "Numbers in text by value".
What random generator does shuffling use?
The browser's own (crypto.getRandomValues) with a Fisher-Yates shuffle, so every order is equally likely. The list is not sent anywhere.
Good to know
- Lines without a number (when sorting by number) go last, in their own order, and the tool tells you how many.
- Line length counts characters as people see them (an emoji, or a Thai letter with its marks, counts as one).
- Sorting of capital and small letters in other languages can differ slightly between browsers.
Your data stays on your device
Everything runs in your browser. What you type, paste or open is not sent to freesabai's servers or anyone else's, and is not kept in the browser: close the page and it is gone. The site only counts how many times this page was opened and how many times someone copied or saved a result (never what was pasted or the result, and you can switch the counting off in the footer; see the privacy policy).
Report a problem or suggest an idea
Found a bug, or want this tool to do more? Tell us on the feedback page. No sign-up.
Other text tools
Convert and edit text
- Case converterUPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case and more
- Find and replace textReplace several pairs at once, plain text or regex
- Slug generatorTurn a title into a clean URL slug, Thai kept or removed
- Reverse textReverse characters, words or lines without breaking Thai marks and emoji
Lines
- Remove duplicate linesKeep one of each repeated line, in the original order
- Sort linesSort A-Z, in Thai alphabetical order, by number or length, or shuffle
- Remove empty lines and extra spacesRemove blank lines, trim every line, collapse repeated spaces
- Add line numbers, prefix and suffixNumber lines, or add text at the start and end of every line
Thai language
- Thai keyboard layout fixerTurn "l;ylfu" into "สวัสดี" and back (Kedmanee layout)
- Number to Thai words (baht text)1,234.50 becomes the amount in Thai words, with baht and satang
- Buddhist and Gregorian year and date converter10/10/2569 becomes 10/10/2026, many dates at once
- Thai digits converter1234 ⇄ ๑๒๓๔ in a whole text, phone numbers can stay as they are
More tools for text (in the developer tools)
- Character, word and line counterCount characters, words (Thai too), lines, sentences, paragraphs and reading time
- Lorem ipsum generatorPlaceholder text in Thai and English, by paragraphs, sentences or words
- Password generatorMake strong random passwords, choose length and characters, made on your device
- URL encode and decodePercent-encode or decode a link, Thai in URLs included, and take a URL apart
- HTML entities encode and decodeTurn special characters into & < > " and back
- Base64 encode and decodeBase64 for text (Thai and UTF-8), URL-safe, and files to and from Base64