Text Sorter
Sort lines alphabetically or by length.
Input
0 lines
Result
Alphabetical order.
Text sorter online
Sort the lines of any list alphabetically, by number or by length. Reverse it, shuffle it, and clean up repeats and blank lines at the same time.
- Eight ways to order a list. A to Z, Z to A, shortest first, longest first, numbers low to high, numbers high to low, reverse order, and a random shuffle.
- Natural number order. Item 2 comes before Item 10, instead of after Item 1, the way people expect a list to read.
- Ignore case. Sort Apple and apple together, so capital letters do not push words to the top.
- Sort by number. Order lines by the first number in each one, such as prices, scores or dates. Lines without a number go to the end.
- Clean up as you sort. Trim spaces, remove blank lines and remove duplicates in the same step.
- Shuffle again. Pick a fresh random order with one tap, useful for drawing names or mixing up a list.
- Works with any language. Accented letters and other alphabets are sorted by the rules of your browser language.
- Private by design. Your list is sorted in your browser. It is never sent to a server or stored.
Uses of a text sorter
- Alphabetizing lists. Put names, products, countries, tags or bibliography entries in order.
- Sorting numbers and prices. Order a list of amounts, scores or measurements from low to high or high to low.
- Finding the longest and shortest. Sort by length to spot outliers, such as titles that are too long.
- Tidying code and configuration. Sort imports, dependencies, CSS properties, keywords or IDs so they are easy to scan and compare.
- Random order. Shuffle a list of names for a draw, a seating plan or a playlist.
- Spreadsheet columns. Copy a column, sort it, and paste it back without opening a spreadsheet.
Text sorter questions
How do I sort lines alphabetically?
Paste your list into the Input box with one item on each line. A to Z is the default, so the sorted list appears in the Result box straight away. Choose Z to A for the opposite order.
What does Natural numbers do?
With it on, numbers inside text are compared by value, so Item 2 comes before Item 10. With it off, lines are compared character by character and Item 10 comes before Item 2.
How do I sort numbers correctly?
Choose Numbers, low to high or Numbers, high to low. Each line is ordered by the first number in it, so 9 comes before 10. Thousands separators such as 1,250 and decimals such as 3.5 are understood. Lines without a number go to the end.
Are capital letters sorted before lowercase?
Not by default. Ignore case is on, so Apple and apple sort together. Turn it off and lowercase letters sort before their capitals.
How do I sort by line length?
Choose Shortest first or Longest first. Lines with the same length are put in alphabetical order.
Can I sort and remove duplicates at once?
Yes. Turn on Remove duplicates and only the first copy of each repeated line is kept before the list is sorted. Turn on Trim spaces too if some copies have extra spaces.
Is the random shuffle really random?
It uses your browser secure random number generator and a fair shuffle, so every order is equally likely. Press Shuffle again for a new one.
How are accented letters and other languages sorted?
Using the sorting rules of your browser language, so é sits next to e instead of after z. The order for some languages can vary slightly between browsers.
Does it work on a phone or tablet?
Yes. The layout adapts to any screen and works with touch.
Is my list saved or uploaded?
No. Everything happens in your browser on your own device. Your list is never sent to a server, and it is gone when you close or refresh the page.