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 Sort Lines Alphabetically

  1. Paste your source text in the input box.
  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.

Troubleshooting

Check the input format and compare your case with the built-in sample. Blank lines are kept, and duplicated entries remain in the result.

Frequently asked questions

How do I use the text I get back?

Copy the output into the document, list, or compatible tool where you need it.

How does the transformation work?

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

Can I try a sample first?

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

What should I check before using the result?

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.