Text Sorter
Sort Lines Alphabetically, by Number or by Length
Paste your list into the text sorter and get it in order right away: from A to Z, two (2) comes before ten (10), sorted by value, sorted by length, sorted by column, or randomly mixed.
- FreePrice
- SixSort modes
- NoneSign-up
- In your browserRuns
Text Sorter
Sort lines alphabetically, by number, by length or at random
- Items in
- 0
- Items out
- 0
- Duplicates removed
- 0
- Empty lines removed
- 0
Ready. Paste a list and the sorted version appears beside it.
| Result | Check | Details |
|---|
Jobs This Text Sorter Handles for You
The online text sorting tool will put any list in order when you type or paste it into the system. It can sort lists of names, keywords, files, prices, tags, and even entire CSV rows. As soon as you enter the list, the system produces a sorted version of the list next to the unsorted version.
You select which way you want to sort. Sort alphabetically; sort with "2" appearing before "10"; sort based on the numerical value contained within each line; sort based on the number of characters in each line; or randomly shuffle the list. Then, either copy the sorted list or save it as sorted.txt.
The sorting process takes place within the web browser you are using. This ensures that the sorted list remains on your local computer. It is important to remember this if the list contains sensitive data such as customer names, email addresses, etc., that you want to maintain privacy over.
How Alphabetical Order Really Works
Sorting text looks simple until accents, capitals and other alphabets show up. A plain computer sort compares character codes, so every capital letter lands before every small one, and é falls after z.
The tool employs the user’s browser’s native Intl.Collator instead. It is aware of the alphabet for every language; thus, both "apple" and "Apple" are grouped together. "Éclair" will be placed with the rest of the words beginning with "e".
Sort Lines Alphabetically
Paste each item into its own line and select Alphabetical. Your list will return in an A-Z format right away, and it can be reversed (Z-A) with another click. Since the sorting process used here is considered "stable," lines which are deemed equal will maintain the original order in which they were submitted.

The way that is considered "equal" changes depending on two different switches. "Ignore Capitals" will treat "Apple" and "apple" as being the same word. "Ignore Accents" will treat "café" and "cafe" as being the same word. Both of these switches are most helpful if you remove duplicates.
Natural Sort for Numbers Inside Text
A straight-forward alphabetical sorting method (A to Z) would read each digit individually. So, File 10 would appear on the list before File 2. While this is technically accurate for a computer, anyone viewing the list will perceive it as incorrect.

Natural sort fixes the problem with the runs of digits by converting each run into a single number. This results in the runs being sorted in the order that we would use to count them, i.e., File 1, File 2, File 10. The concept has been used for quite some time, and it has become known as "natural sort order." File managers can employ this method to allow users to view their files in the order that they are accustomed to seeing them.
Sort By Number, Length Or Random Order
By number value looks for the first number in each line and sorts on it. It understands minus signs, decimals and both 1,234.50 and 1.234,50, so prices and measurements sort correctly. Lines without any number move to the end, and the checks table tells you how many.
Length orders by putting the shortest lines at the top of the list. This is useful when you have a list of keywords and need to remove the ones that are too short. It can also be helpful if you want to find the titles of the longest books. On the other hand, in random order, will shuffle the list using your web browser’s secure random number generator. This means each possible order is equally likely. If you would like to see the lines in a different random order, simply click on the "Shuffle" button again.
Sort a CSV by a Single Column
Pick a column from those listed under Compare. Then select which column number you wish to use and how to split the data within the selected column. Possible splitting methods include commas, tabs, semicolons, pipes, or spaces. The sorting process will correctly handle quoted values in a CSV format, for example "Smith, John", will remain as a single unit.

This can be combined with "By number value" to order rows by price, score, or date. You will also want to check "Keep the first line on top," and your header row will remain at its current location, while all other data below that point will move.
Ordering People by Surname
The last word of the list under "Compare" is what you select. Ada Lovelace is listed under "L" rather than "A". This works well for lists of guests, authors and teams, which are expected to be organized by last name.
How Swedish, German, Spanish and Arabic Sort Letters
Languages disagree about the alphabet. Swedish puts å, ä and ö after z, while German files ä next to a. Spanish keeps ñ as its own letter after n, and Arabic has an order of its own.
The Alphabet menu is based on the page language (default), but you may select another language such as English, Spanish, German, French, Italian, Arabic or Swedish. In terms of mechanics, the rules used in this menu are based on the Unicode Collation Algorithm. This is the same standard used by many database systems and OS’s.
Character Codes, Like the Unix sort Command
Sometimes you need the strict computer order instead, for example to match the output of sort on a server or to compare two lists line by line. If you select Character codes, the Capital Letters will precede the Lower Case Letters in the exact same manner that LC_ALL=C sort does.
Repeats, Empty Rows and Extra Spaces
The sorter will remove all blank lines and extra space when you copy a list from another source because these items would have floated to the very top. Switch this off if you want the list to keep its exact format.
Switch on "Remove Duplicates," and only the first version of each line remains. If you are looking for a program that can remove lines that repeat themselves in a file, but will also tell you how many times each line appears in that file, then check out our Duplicate Line Remover.
Checks That Explain What You See
A brief table of checks will explain anything that is unexpected (e.g., if a "A-to-Z" sort places item 10 before item 2, then the check table would recommend using a "Natural" sort).
When in number mode, it will count all lines without a number, any row which does not contain the selected column, and any duplicates you have chosen to keep. If your order appears unusual, then the answer is just one click away.
Where People Use a Text Sorter
SEO professionals will organize their keyword lists alphabetically before grouping. Teachers will arrange their students’ rosters by last name, and software developers will organize imports, configuration settings, and word lists. random organization is used by writers to select names, topics, or speaker sequences.
Shop owners organize their product lists according to price, and research studies organize respondent feedback according to its length so that they can see the most extensive responses first. Regardless of how the list is organized when it enters a process, it will always exit in an organized manner that fits the requirements of the task.
Tips for Clean Sorting
Before sorting, put each item on its own separate line. If your list is part of a larger paragraph and uses commas for separation, change "Items to Split" from "lines" to "commas." In addition, use our case converter to make sure that the capitalization of similar words is consistent so that they appear together after sorting.
Check the results once more when the order is important to your reader. Once again use our word counter to count the number of words, or compare two versions of a list using the diff checker.
A Quick Walkthrough of the Text Sorter
This brief video shows each step from start to finish. Choose your language below, and switch on captions if they help.
Sorting Text Alphabetically on Denwix
The output refreshes with every key you press, so there is no sort button.
Paste your list
Put each item on its own line, or open a text or CSV file.
Pick the sort
Alphabetize lines, in order of occurrence, by number, by length, or randomly.
Set the details
Direction, column, alphabet, duplicates and blank lines.
Copy or download
Take the sorted list as text or as a .txt file.
Sorting Options That Go Further Than A To Z
This machine has six different types of orders and explains each of the outcomes. Most machines have only one type of order.
Six sort modes
Alphabetical, natural, number, length, random and reverse.
Real alphabets
Accents and letters sort the way each language expects.
Columns and surnames
Sort CSV rows by any column, or names by the last word.
Clean-up built in
Clean up spaces, empty rows and repeats in one go.
Fast on big lists
Hundreds of thousands of lines sort in a second or two.
Private
The list you paste stays inside your browser.
Tips for Sorting Lists
Small habits that make every sort come out right.
- One item per line. Or pick the comma or space split to match your list.
- Sort numbers the natural way. It keeps 2 before 10 in names, versions and file lists.
- Pick the right alphabet. Swedish, German and Spanish each place some letters differently.
- Hold the header row in place. Tick the switch before you sort a CSV file.
- Remove duplicates last. Decide first whether capitals and accents count.
- Read the checks. They explain any line that ends up in a surprising place.
Six Mistakes When Sorting Text
Each one leaves a list in an order nobody expected.
Sorting numbers as text
Item 10 then lands before item 2. Use natural or number mode.
Leading spaces
A line that starts with a space jumps above every letter.
Mixed capitals
In code order, Zebra is placed ahead of apple. Pick an alphabet instead.
Sorting the header row
The column names end up in the middle of the data.
Wrong alphabet
Å sorts after Z in Swedish but next to A in English.
Removing near-duplicates by accident
With Ignore capitals on, Polish and polish count as one.
Text Sorter Questions People Ask
What are the steps to alphabetise a list on Denwix?
Drop your list into the left-hand Denwix box, one entry on each line. The sorted list appears at once in the second box.
How can I sort a list from Z to A?
Set Direction to Z to A. The same switch reverses number and length sorts too.
Why does a plain A to Z sort put 10 ahead of 2?
A simple text based sort will process each digit of a number individually. When you select "Naturally" (i.e., 2 precedes 10), then numbers are sorted numerically.
Will the sorter order CSV rows by one column?
Yes. Select a column, then the column number, and finally the separation character. The columns remain intact when selected.
Is it possible to sort names by surname?
Yes. Pick The last word under Compare, and each name sorts on its final word.
Can the text sorter handle é, ñ, ä and other letters correctly?
Yes. Select a specific alphabet and your chosen characters (e.g. é, ñ, ä and å) will appear exactly as they would be expected in the language you selected.
Will the sorter drop repeats in the same pass?
Yes. Click on Remove Duplicates. This will keep the first instance of each item and report how many were removed.
Is the Denwix shuffle truly random?
Your browser’s secure random number generator is used to create each order, meaning that all orders have an equal chance.
How many lines can the Denwix sorter take?
The Denwix sorter is capable of sorting a list of 200,000 lines in about two seconds. Any file that has a size of 8 MB or less can be opened directly within the sorter.
Is my list uploaded?
No. The sorting happens in your browser, and nothing leaves the page.
More Tools for Text and Lists
Handy next steps once your list is in order.
- Duplicate Line Remover
Drop repeated lines and see how often each appeared.
- Case Converter
Move text between capitals, small letters, title style and sentence style.
- Diff Checker
Compare two lists and see every change.
Want To Sort Your List Now?
Paste the text into the box above and you will see the sorted version right away. This text sorter is free, does not need a user account, and functions directly within your web browser.