Text Tools

Text Sorter

Put any list in order. Sort lines, words or comma-separated items alphabetically, in natural order where 2 comes before 10, or by length, with options for case, duplicates and leading articles.

  • Runs in your browser
  • No sign-up
  • Free to use

How to use Text Sorter

  1. Paste your list into the left box.
  2. Choose the order and whether to sort lines, words or comma-separated items.
  3. Tick options such as Remove duplicates or Ignore “The”, “A”, “An”.
  4. Copy or download the sorted result on the right.

Text Sorter features

Six sort orders

A to Z, Z to A, natural numeric order, shortest first, longest first, or simply reversed.

Natural sorting

Treats numbers inside text as numbers, so “file 2” comes before “file 10”.

Language-aware

Uses your browser’s collation rules, so accented letters sort where they belong.

Duplicates removed

Optionally keep only the first occurrence of each item.

Ignore articles

Sort titles such as “The Beatles” under B, as libraries and music apps do.

Lines, words or CSV

Sort a column of lines, the words of a sentence, or a comma-separated list.

When to use Text Sorter

  • Alphabetising names, glossary terms or bibliography entries.
  • Sorting file names, version numbers or product codes naturally.
  • Ordering keywords and tags before pasting them into a CMS.
  • Finding the longest and shortest lines in a list.
  • Tidying CSS classes, imports or configuration values.

Text Sorter FAQ

What is natural sorting?

Plain alphabetical sorting compares character by character, so “10” comes before “2”. Natural sorting recognises digits as numbers and orders them by value, which is what people expect for file names and numbered lists.

How are capital letters handled?

By default sorting ignores case, so “apple” and “Apple” are treated alike. Tick Case-sensitive to distinguish them; capitals then sort before lower-case letters.

Does it handle accented letters?

Yes. Sorting uses language-aware collation, so é sorts with e rather than after z.

How does duplicate removal work?

Items are compared after trimming spaces and, unless Case-sensitive is on, ignoring case. The first occurrence is kept.

Is there a limit?

Lists of many thousands of lines sort instantly in the browser.

Why sorting is less simple than it looks

Computers store characters as numbers, and the simplest sort compares those numbers. That puts all capital letters before all lower-case ones, sorts accented letters after z, and compares digits one at a time. The result, “Zebra” before “apple” and “item10” before “item2”, is technically ordered but rarely what a reader wants.

Human-friendly sorting uses collation: rules that describe how a language orders its alphabet. This tool relies on the collation built into your browser, which ignores case when asked, places accented letters next to their base letters, and can treat runs of digits as numbers for natural ordering.

Conventions matter too. Libraries, music apps and indexes ignore leading articles, filing “The Rolling Stones” under R. Sorting by length is useful for finding outliers, such as unusually long product names that break a layout.

Sorting is often combined with deduplication. Once identical entries sit next to each other they are easy to remove, so the option to drop duplicates in the same step saves a second pass.

Other useful tools