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.

Input Load sample

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

CSV column cleanup
A spreadsheet export needs to be deduplicated and sorted before re-import. Paste the column, dedup, sort A-Z, paste back.
Tag list normalisation
A blog CMS exports tags in random order. Sort alphabetically, dedup, and re-import for a clean tag taxonomy.
Filename sorting
"img1.jpg, img10.jpg, img2.jpg" should sort as 1, 2, 10. Use Natural mode so embedded numbers are treated as numbers.
Vocab list prep
Students often paste vocab lists from class. Sort alphabetically and dedup before flashcard generation.
Mailing list ordering
Sort email addresses by domain or by length to spot oddly-shaped entries.
Crossword wordlist prep
Sort by length to group wordlists by letter-count, useful for puzzle construction.

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

InputMode and optionsResult
banana, apple, Cherry, dateAlphabetical asc, Ignore case onapple, banana, Cherry, date
item10, item2, item1Natural ascitem1, item2, item10
5, 100, 1, 50Numeric asc1, 5, 50, 100
elephant, cat, dogBy length asccat, 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.

Browse the full catalog →