freesabai

Text tools

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.

Getting the tool ready…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

  1. Paste the list into the box on the left, one item to a line, or press "Open file".
  2. Choose what to sort by, and ascending or descending. The result shows at once.
  3. 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

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

Lines

Thai language

More tools for text (in the developer tools)

Questions and answers

How do I sort a list in Thai dictionary order?

Paste the list, choose sort by letters with "Thai dictionary order" and ascending or descending. The browser's Thai collation ignores leading vowels เ แ โ ไ ใ, so ก ไก่ ข แมว เอ come out in dictionary order.

How do I get 2 before 10 when sorting?

Choose "Number": the first number of each line is read (Thai digits and thousands separators such as 1,200 work) and sorted by value. To sort by letters but still put file2 before file10, tick "Numbers in text by value".

What random generator does shuffling use, and is my list sent anywhere?

The browser's own (crypto.getRandomValues) with a Fisher-Yates shuffle, so every order is equally likely. Lines without a number go last when sorting by number. Everything runs in your browser; the list is never sent.