Sort Lines of Text Online
Put any list in order: names, keywords, file names or numbers. Natural sorting understands numbers inside text, and sorting follows your language's alphabet, so accented letters land where you expect.
How to sort lines
- Paste your list into the left box, one item per line.
- Choose a sort order such as alphabetical, natural, by length, numeric, reverse or random shuffle.
- Set options: ignore case, remove duplicates, remove empty lines and trim spaces.
- Copy or download the sorted list.
Alphabetical versus natural sorting
Plain alphabetical sorting compares character by character, so "file10" comes before "file2" because 1 sorts before 2. Natural sorting reads digit runs as numbers and gives the order people expect: file1, file2, file10. Both use the browser's locale-aware collator, so "Ångström" sorts with the A words rather than after Z. Numeric sorting uses the first number on each line, which helps with lists like "12 apples". The random shuffle uses the browser's cryptographic random generator for an unbiased order. To remove repeats without changing the order, use Remove Duplicate Lines instead.
Benefits
- Natural sort handles numbered items the way people read them.
- Locale-aware ordering for accented and non-English letters.
- Unbiased random shuffle for draws and randomised lists.
Limitations
- Each line is treated as one item; multi-column data such as CSV is sorted by the whole line, not by a chosen column.
- Numeric sort reads only the first number on each line; lines without a number are placed last.
Privacy and security
Sorting runs locally in your browser. The lists you paste are not transmitted or stored.
Read our privacy policy for details about the site as a whole.
Frequently asked questions
How do I sort a list alphabetically?
Paste the list with one item per line and choose "Alphabetical (A → Z)". Keep "Ignore case" on so that uppercase and lowercase words are mixed together.
Why does file10 come before file2?
That is plain alphabetical order. Choose "Natural" sorting to treat the numbers as numbers.
Is the shuffle truly random?
It uses a Fisher–Yates shuffle driven by crypto.getRandomValues, so every order is equally likely. Click "Shuffle again" for a new order.