Text Sorter: Sort Lines Alphabetically, Numerically or Randomly

Sort any list online in alphabetical order, by number, by length or at random. Natural sort puts “item 2” ahead of “item 10”, and you can order CSV rows by any column, strip duplicates and keep a header line in place.

  • A–Z, numeric, length, shuffle
  • Natural and column sort
  • Accents sorted properly

How to use the Text Sorter tool

  1. Paste the listEnter one item per line on the left: names, words, numbers, URLs or CSV rows.
  2. Pick an orderAlphabetical, reverse, natural, numeric, by length, reversed or shuffled; the output updates immediately.
  3. Refine itIgnore case, drop duplicates and blank lines, treat the first line as a header, or sort by a column.
  4. Copy or saveCopy the sorted lines or download them as a text file.

Sorting features

  • Natural sort orderNumbers within text are compared by value, so file2 lands before file10.
  • Language-awareAccented letters like É and ñ appear where readers expect, not dumped at the end.
  • Column sortingOrder comma, tab, semicolon or pipe separated rows by column 1 to 4.
  • Random shuffleFair, cryptographically random ordering for draws, quizzes and picking teams.
  • Tidy-up optionsTrim spaces, remove blank lines and delete duplicates while sorting.

The sort options at a glance

  • A → Z (alphabetical): gives apple, Banana, cherry; ideal for names, glossaries and word lists.
  • Natural: gives chapter 1, chapter 2, chapter 10; ideal for file names, chapters and version numbers.
  • Numbers: gives 2, 15, 100, 1,250; ideal for prices, scores and IDs.
  • Length: gives fig, kiwi, banana; ideal for spotting the shortest or longest entries.
  • Random: a new order every time; ideal for raffles, quiz questions and speaking order.

Why natural sort order matters

Software usually compares text one character at a time, which puts “item 10” before “item 2” because the digit 1 precedes 2. To people that looks wrong. Natural sorting detects the numbers inside text and compares their values, matching how file explorers and most readers expect a list to be ordered.

Sorting numbers correctly

Numeric mode reads the first number on each line, including decimals, negative values and figures with thousands separators like 1,250. Lines with no number go to the bottom, which lets you order entries such as “Product A – 19.99” by price.

Sorting CSV and spreadsheet rows

Rows copied from a spreadsheet are normally tab-separated, while exported CSV files use commas. Pick “Sort by Column 2” plus the matching separator to order rows by, say, a surname or date column, and tick “First line is a header” so the titles stay on top.

Handy tips

  • Pair “Remove duplicates” with A → Z to turn a messy list into a clean, unique, alphabetical one.
  • Press “Use result as input” to chain steps, for example sort by length and then reverse.
  • Comparing two sorted lists? Use the Text Diff Checker. To fix capitalisation first, open the Case Converter.

Frequently asked questions

How can I sort a list alphabetically online?
Paste the list with one item per line and pick “A → Z”. The sorted lines appear instantly and copy with one click.
Why do other tools put 10 before 2?
They compare text character by character. Choose “Natural” or “Numbers” here to order numbers by value.
Can CSV data be sorted by a column?
Yes. Select the column and separator (comma, tab, semicolon, space or pipe), and tick “First line is a header” if there is one.
Is the shuffle truly random?
Yes. It combines your browser’s cryptographically secure random generator with the Fisher–Yates algorithm.
Does my text get uploaded?
No. Sorting runs in your browser and nothing goes to a server.