About the Text Sorter
Sorting a list by hand is slow and error-prone once it grows beyond a few dozen lines. This text sorter will sort lines alphabetically from A to Z or Z to A, numerically in either direction so that 10 comes after 9, by line length, or into a random order, and it can reverse a list or remove duplicates in the same pass. Options control whether capital letters affect the order. It suits name lists, glossaries, product codes and keyword lists. Sorted lists are much easier to scan, compare and check for gaps or near-duplicates. To remove repeated entries first, see Remove Duplicate Lines, and for a fair random order try the List Randomizer.
Alphabetical order uses your browser's language-aware comparison, so letters with accents sit beside their plain forms instead of trailing behind z. Numeric order reads the first number on each line, which means Item 2 comes before Item 10 rather than after it, as a plain text sort would place it. Negative numbers and decimals such as -3 or 2.5 are understood as well.
Other modes order lines by length, shortest or longest first, shuffle them randomly or simply reverse the current order without sorting. Shuffle produces a fresh random order each time you run it. Lines that tie on length keep their original relative order, so sorting the same list twice gives the same result.
Extra switches ignore capitals while comparing, remove blank lines and drop duplicates during the same pass, so a jumbled list straight from a spreadsheet comes out clean and in order. Everything happens in your browser, so long lists are handled quickly and nothing is uploaded.
How to use the Text Sorter
- Paste the linesPut one item on each line of the input box.
- Choose the orderSelect alphabetical, numeric, by length, random or reversed.
- Add optional rulesIgnore capitals, drop empty lines or remove repeats while sorting.
- Copy the resultUse the copy button or save the sorted list as a text file.
Text Sorter features
- A to Z and Z to A with language-aware comparison
- Numeric order, ascending or descending
- Sorting by line length in either direction
- Random shuffle or a straight reversal of the current order
- Optional case-insensitive comparison
- Optional removal of blank lines and duplicates
- Copy and download buttons
Common uses
- Alphabetising a glossary, index or list of names
- Ordering keywords by length to find long-tail phrases
- Sorting IDs or prices copied from a report
- Flipping a dated list so the newest item comes first
- Cleaning and ordering a list in one go
Sorting text lines: alphabetical, numeric, natural and random order
Sorting turns a jumbled list into something you can scan, compare and use: names in alphabetical order, prices from lowest to highest, keywords by length or a random order for a fair draw. Sorting looks simple, but different methods give different results, especially with numbers, capital letters and accented characters. This guide explains the main sort orders and which one to use.
Alphabetical sorting
Alphabetical sorting compares lines letter by letter. The main decision is how to treat capital letters. A strict computer sort places all capitals before lowercase letters, so "Zebra" comes before "apple". A case-insensitive sort ignores case and gives the order most people expect. For lists meant for humans, case-insensitive sorting is almost always right.
Numeric sorting
Sorting numbers alphabetically produces odd results, because it compares character by character: "10" comes before "9" since "1" is less than "9". Numeric sorting reads each line as a number and orders by value, so 9 comes before 10. Use numeric sorting for prices, quantities, scores and IDs.
| Lines | Alphabetical | Numeric |
|---|---|---|
| 9, 10, 100, 25 | 10, 100, 25, 9 | 9, 10, 25, 100 |
Natural sorting
Many lists mix text and numbers, such as "Chapter 2", "Chapter 10" and "Chapter 1". Natural sorting treats the numbers inside text as numbers, giving Chapter 1, Chapter 2, Chapter 10, which is what people expect. Plain alphabetical sorting would give Chapter 1, Chapter 10, Chapter 2.
Sorting by length
Sorting by line length groups short and long entries. It is handy for finding unusually long product names that will not fit a label, short keywords versus long-tail phrases, or entries that were cut off by mistake.
Random order
Random sorting shuffles lines into an unpredictable order, useful for quiz questions, presentation order or fair turn-taking. For draws where fairness matters, List Randomizer uses the browser's secure random generator and is designed specifically for fair shuffles.
Reverse order
Any sort can be reversed: Z to A, highest to lowest, longest to shortest. Reverse numeric order is common for rankings and leaderboards.
Accents and other languages
Alphabetical order differs between languages. In Swedish, "å" comes after "z"; in German, "ä" is sorted with "a". Simple sorts based on character codes may put accented letters after all plain letters. If a list contains many accented names and must follow a specific language's rules, check the result or remove accents first with Remove Accents for a predictable order.
A worked example: sorting a class list
A teacher has 32 student names typed in random order, some starting with lowercase letters by mistake. Sorting case-insensitively puts "amir" and "Aisha" together near the top, where they belong. Removing duplicates in the same pass reveals that one student was entered twice. Finally, fixing capitalisation with Case Converter in Title Case gives a tidy list ready to print.
Sorting surnames
Lists of full names sort by first name, because the first name comes first on each line. To sort by surname, the names need to be written "Surname, First name". If a list is long, changing the format once is worth it, because sorting by surname is the standard for registers, directories and bibliographies.
Removing duplicates while sorting
Sorting places identical lines next to each other, which is the perfect moment to drop repeats. Enabling duplicate removal during sorting cleans and orders a list in one pass; Remove Duplicate Lines offers more control over how duplicates are matched.
Sorting numbers with units and symbols
Lines such as "$1,200", "15 kg" or "3.5%" are not pure numbers, so a numeric sort may not read them correctly. Commas used as thousands separators, currency signs and units can all confuse sorting. For reliable results, keep only the number on each line while sorting, or extract the numbers first with Extract Numbers from Text, sort them, and then match them back to their labels.
Sorting dates
Dates written as "25/12/2026" sort incorrectly as text, because the day comes first. Dates in the international format "2026-12-25" sort correctly with a plain alphabetical sort, since year, month and day appear from largest to smallest unit. If you keep lists of dated entries, writing dates this way makes every sort work automatically.
Keeping a header line in place
Lists copied from spreadsheets often start with a header such as "Name" or "Price". Sorting the whole list moves that header into the middle. Remove the header before sorting and add it back afterwards, so the first line still describes the column.
Sorting in spreadsheets versus here
Spreadsheets sort rows with several columns, keeping each row together, which is better for tables. This tool is quicker for single lists: paste, sort, copy. For a table where you only need one column in order, copy that column here; for full tables, sort in the spreadsheet so rows stay intact.
Privacy
Sorting happens in your browser. Lists of names, emails or product data never leave your device.
Frequently asked questions
How are lines that mix words and numbers sorted numerically?
The first number on each line becomes the sort key, so Item 2 is placed before Item 10. Lines with no number at all are gathered at the end and keep the order they had originally.
Do capital letters change the alphabetical order?
By default, letters are compared using language rules that usually place capitals next to their lowercase forms. Switch on the ignore-case option if you want capitalisation to play no part at all.
Can sorting and removing duplicates happen together?
Yes. Tick the duplicate option and every line appears only once in the sorted result. If you need to remove repeats while keeping the original order, use Remove Duplicate Lines instead.
What happens to lines of equal length?
They stay in the order they had before sorting. That makes the result predictable: running the same length sort twice always produces an identical list, and items you had grouped together remain together.
Will sorting edit the lines themselves?
No. Only their order changes. Characters, inner spacing and punctuation are left exactly as you pasted them, unless you switch on the options that remove blank lines or duplicates.
Can it cope with thousands of lines?
Yes. Sorting happens in your browser and large lists finish quickly. Because the work stays on your computer, the size of a list is limited only by the memory available.