Writing Tool

Text Sorter

Paste a list and put it in order — A–Z, by length, natural order that understands numbers, or a proper shuffle. Clean blanks and duplicates, then copy or download. Everything stays in this browser.

  • A–Z & Natural
  • De-duplicate
  • TXT / CSV
  • Local only
  • Free

Input

Items: 0 Chars: 0
Drop a .txt / .csv here, or

Sorted result

Sort options

Split input by Lines for lists · Words for paragraphs
Sorting mode The result updates live

How it works

  1. Paste a list, drop a text file, or load a sample. One item per line is the default.
  2. Pick A–Z, length, natural order, or shuffle. Natural order is the mode that puts item2 before item10.
  3. Turn on clean-up if you need it: trim, drop blanks, remove duplicates, ignore case, or sort by last word.
  4. Copy the result, or download it as .txt or a one-column .csv.

The output updates as you type. There is no Sort queue and nothing leaves this page.

Sort modes

A → Z / Z → A

Standard alphabetical order. Case Insensitive keeps Apple and apple together without rewriting either line.

Short / long first

Orders by character length. Equal lengths fall back to A–Z so the list stays stable.

Natural

Compares number runs as numbers. Filenames, versions and numbered headings come out the way a person would read them.

Shuffle

A Fisher–Yates shuffle — every item is equally likely to land in any position. Reverse then just flips that permutation.

Why natural sort exists

A plain alphabetical sort compares one character at a time. That is why item10 jumps in front of item2: the 1 is smaller than 2, and the extra 0 never gets a chance. Spreadsheets do this unless you convert the column to numbers, which you cannot do when the number sits inside a filename.

Natural sort splits each line into number runs and text runs, then compares numbers as integers. item2 becomes “item” + 2, item10 becomes “item” + 10, and 2 comes first. Load the Files sample to see it.

What each option does

OptionEffect
Case insensitiveCompare in lowercase. The original spelling is kept.
Remove blank linesDrop empty items after trim.
Remove duplicatesKeep the first time a line appears. Case fold applies if Case insensitive is on.
Trim whitespaceStrip leading and trailing spaces before compare and before output. On by default.
Reverse resultFlip the finished list. Works after any mode, including shuffle.
Ignore numbersStrip digit runs before compare, so a2 and a10 tie.
Ignore punctuationStrip marks such as . ! ? before compare.
Sort by last wordCompare the last whitespace-separated token. Use this for “First Last” name lists.

Who this is for

Writers and editors

Clean a pasted outline, a list of headings, or a dump of tags before it goes into a post.

Developers

Order filenames, env keys, or CSV columns without opening a spreadsheet.

Teachers and ops

Sort a roll of names by last name, or shuffle a list for a random draw.

Anyone with a messy list

De-duplicate, drop blanks, and get a file back. No account.

Frequently asked questions

What is a text sorter?

It is a tool that reorders lines or words. This one sorts alphabetically, by length, in natural order, or at random, and can also clean blanks and duplicates.

How do I sort text alphabetically?

Paste one item per line, choose A → Z or Z → A, and the result updates immediately. Turn on Case insensitive if Apple and apple should sit together.

What is natural sort?

Natural sort compares the number parts of a string as numbers. item2 comes before item10, which a plain alphabetical sort gets wrong.

Can I sort by line length?

Yes. Short first puts the shortest lines at the top. Long first does the opposite. Equal lengths then fall back to A–Z.

Can I remove duplicate lines?

Enable Remove duplicates. The first spelling is kept. With Case insensitive on, Apple and apple count as the same line.

Can I sort a paragraph of words?

Switch Split input to Words. The paragraph is split on whitespace, sorted, and joined back with single spaces.

How do I sort names by last name?

Turn on Sort by last word. Ada Lovelace is then compared as Lovelace.

Is my text uploaded?

No. Sorting runs in your browser. A draft can be saved to this browser’s local storage only.

Can I download the sorted list?

Yes. Download a plain .txt file or a one-column .csv. Commas and quotes inside a line are escaped.

Is this text sorter free?

Yes. It is free, needs no account, and has no daily limit.