Sort Lines Alphabetically

Sort text rows alphabetically for a list, set of labels, or filenames.

Text inputPreview and copyRuns in your browser

Enter your text

Result

How to use

  1. Put one sortable entry per line. Review the ordering before pasting it back into a document or data file.
  2. Select Convert to generate the output.
  3. Review the output before copying it.

How it works

Sort text rows alphabetically for a list, set of labels, or filenames. Split the input at line breaks, compare lines in English alphabetical order with numeric comparison, and rejoin them.

Formula or processing rules

Split the input at line breaks, compare lines in English alphabetical order with numeric comparison, and rejoin them.

Worked example

Pear, apple, and banana sort into apple, banana, and pear.

Example text lengths in UTF-16 code units
Input · 17
Output · 17
Worked example
MeasureValue
Source textpear apple banana
Resultapple banana pear

Pros and cons

Pros

Sort text rows alphabetically for a list, set of labels, or filenames. The sample provides an immediate check of the expected output.

Cons

Blank lines are kept, and duplicated entries remain in the result.

Limitations and troubleshooting

Protect any header row by leaving it out of the list you sort.

Remove repeated entries from the list

Frequently asked questions

Is alphabetic sorting always the same as numeric sorting?

No. Text ordering can place 10 before 2. For numeric identifiers, check the sample or sort as numbers in the destination.

What rule does the Sort Lines Alphabetically apply?

Split the input at line breaks, compare lines in English alphabetical order with numeric comparison, and rejoin them.

What should I see in the Sort Lines Alphabetically example?

Pear, apple, and banana sort into apple, banana, and pear.

What should I verify after using Sort Lines Alphabetically?

Blank lines are kept, and duplicated entries remain in the result.

Is my input stored by the tool?

The transformation is computed in the open page. The tool does not save the submitted text.