Sort Text
Sort any list of lines alphabetically, numerically, by length, or in reverse. Optional dedup, case-insensitive, and natural-number sorting. Runs in your browser.
How to sort text
1. Paste your list
Drop one item per line into the Input box. Common sources: a CSV column copied from a spreadsheet, a bulleted list with the bullets stripped, an exported tag list, or any text where each line is a distinct entry.
2. Pick direction and mode
Direction is ascending (A-Z, smallest first) or descending (Z-A, largest first). Mode controls how items are compared: Alphabetical does Unicode-order comparison; Natural treats embedded numbers as numbers, so "item2" sorts before "item10"; Numeric parses each line as a number and sorts numerically (non-numeric lines fall to the bottom); By length sorts by character count.
3. Tune the options
Ignore case treats "Apple" and "apple" as equal. Remove duplicates keeps each unique line once. Trim each line strips leading and trailing whitespace before comparison so " apple" and "apple" do not get treated as different.
4. Copy or download
Click Sort. The sorted list appears on the right. Use Copy or Download to save a .txt file.
When you need a sort tool
Alphabetical vs natural vs numeric
The same input can produce three different outputs depending on the sort mode. Take the list: item1, item2, item10, item11, item20. In Alphabetical mode the sort key is the raw string, so the output is item1, item10, item11, item2, item20 because the character 1 comes before 2 in ASCII order. In Natural mode the tool detects the embedded number and uses it as the sort key inside each item, producing item1, item2, item10, item11, item20 which matches the human expectation. Numeric mode parses the entire line as a number, so it works only when each line is a plain number; lines with letters are pushed to the bottom of the result.
By length sorts strictly by character count, with ties broken by original order. This is useful for grouping words of the same length together (puzzle prep) or for spotting unusually long or short entries in a list of expected uniform length.
Sort options reference
| Input | Mode and options | Result |
|---|---|---|
| banana, apple, Cherry, date | Alphabetical asc, Ignore case on | apple, banana, Cherry, date |
| item10, item2, item1 | Natural asc | item1, item2, item10 |
| 5, 100, 1, 50 | Numeric asc | 1, 5, 50, 100 |
| elephant, cat, dog | By length asc | cat, dog, elephant |
For more list-manipulation tools, see Remove Duplicates, Text Splitter, or browse all text utilities. See also: Alphabetical Order Sorter.
Related tools
Frequently asked questions
How do I sort a list of lines alphabetically?
Paste the list into the Input box, one item per line. Pick A-Z (ascending) or Z-A (descending). The sorted output appears on the right.
What is natural-number sort?
Default alphabetical sort puts "item10" before "item2" because the character 1 comes before 2 in ASCII order. Natural sort treats embedded numbers as numbers, so "item2" comes before "item10". Useful for filenames, version strings, and labels with embedded counts.
Can I sort case-insensitively?
Yes. Turn on Ignore case. "Apple" and "apple" sort to the same position, with the first occurrence in the original list winning a stable tie.
How do I deduplicate while sorting?
Turn on Remove duplicates. After sorting, identical lines are kept only once. Combine with Ignore case to dedup case-insensitively.
What does Sort by length do?
Lines are ordered by character count: shortest first if Ascending, longest first if Descending. Ties (lines of the same length) keep their original relative order.
Are blank lines kept?
By default, leading and trailing blank lines are trimmed. Internal blank lines are removed before sorting. Turn on Preserve blank lines if you want them to sort to the top (ascending) or stay in place.
Does locale matter?
In Default mode, the tool uses Unicode codepoint order: accented characters sort after unaccented ones. Turn on Locale-aware to use the browser language for comparisons.
Is my text uploaded anywhere?
No. Sorting runs in client-side JavaScript. Input and output stay in the browser tab. We have no upload endpoint and we do not log content. See also: Text Shuffler.
More wordcounter.ai tools
Other tools you might find useful.