Skip to content
📊

Text Sorter

Sort lines alphabetically, reverse, by length, or remove duplicates.

Runs in your browser

Updated

Seven line operations

Paste lines and choose an action: A to Z, Z to A, shortest to longest, longest to shortest, reverse, deduplicate or shuffle. Sorting uses the browser's locale-aware comparison, so accented letters group with their base letter instead of landing at the end. Length sorting counts characters, including spaces and punctuation.

A worked example

Sorting pear, apple, fig alphabetically gives apple, fig, pear. Reversing the original gives fig, apple, pear. Sorting by length puts fig first because it has three characters and pear last with four. Deduplicating a list keeps the first occurrence of each exact line and drops later copies.

Line handling

The input is split on line breaks only. Leading and trailing spaces are kept, blank lines are kept, and two lines that differ only by case or whitespace are treated as different values. That matters when cleaning a list exported from a spreadsheet, where trailing spaces are common.

Where it stops

  • No case-insensitive or numeric sorting; ten sorts before nine alphabetically.
  • No automatic trimming before comparison.
  • Deduplication is exact-match and case-sensitive.
  • Shuffle is random and cannot be seeded or reproduced.

Questions people ask

How do I remove blank lines?

Not directly. Sort or deduplicate first, then delete the empty entries manually; a blank line is a valid unique value.

Can I sort paragraphs rather than lines?

Only if each paragraph is on a single line. To compare two versions of a text, use the text diff checker, and to change capitalisation first, see the case converter.