Alphabetize a list

Sort complete lines with an English alphabetic comparison while leaving the text of every line untouched.

Runs in your browser. Your text is not uploaded.

Worked example

Before

pear
Apple
banana

After

Apple
banana
pear

The three complete lines are placed in ascending English alphabetic order.

Exactly what this changes

  • Alphabetical order is calculated with an explicit English collator. The default is ascending, from earlier alphabetic values to later ones. Descending reverses that comparison without reversing characters or changing the contents of a line.
  • The sort is stable. When two entries compare as equal, their original relative order is retained. Duplicate lines are not removed, and the tool never chooses a preferred capitalization, spelling, or amount of surrounding whitespace.
  • Numeric comparison is deliberately disabled here. A line such as “item10” follows ordinary alphabetic comparison rather than being treated as item number ten. Use Natural sort when digit groups should be compared by numeric value.

Options and edge cases

  • Choose ascending or descending before running the pipeline. The direction applies to the entire line, including punctuation and spaces considered by the collator, and does not add headings or separators.
  • Accented Latin letters, CJK text, emoji, right-to-left text, and combining characters remain exactly encoded as supplied. The collator decides order only; it does not normalize or translate the strings.

Edge case: Empty and whitespace-only lines are sortable values and are not discarded. Remove empty lines first in a multi-step pipeline if they should not appear in the sorted result.