Text Line Sorter

Sort text lines A to Z or Z to A. Ignore case, trim spaces, remove blank lines, or delete duplicates before copying the sorted list.

Text is processed in your browser and is not uploaded or saved.

Uses deterministic UTF-16 text order, not language-specific or numeric order. Equal lines keep their original order. Ignore case also applies to duplicate detection; the first occurrence is kept.

CRLF and CR line endings become LF. A final line ending counts as a blank line and is sorted with the other lines. Blank-line removal also removes whitespace-only lines.

Sort lines of text

Paste one item per line, choose Ascending for A to Z or Descending for Z to A, then copy the sorted text. Use it to organize names, filenames, tags, or one-column lists.

Clean up the list while sorting

Turn on Trim each line to remove spaces at the edges and Remove blank lines to skip empty or whitespace-only rows. With Ignore case and Remove duplicate lines on, the list pear, Apple, apple becomes Apple, pear in ascending order. The first spelling of each duplicate is kept.

How numbers and mixed case are sorted

The sorter compares text character by character using UTF-16 order. For example, 10 comes before 2. Turn on Ignore case to sort uppercase and lowercase spellings together. A final line break counts as an empty line, which you can drop with Remove blank lines.