Sort Lines

Order lists alphabetically, naturally, numerically, or by length.

Tool options

Enter text to get started.

How to use Sort Lines

  1. Paste or type your input. You can also load the example below.
  2. Adjust the available options. Results update after you finish typing; for very large inputs, select Run.
  3. Review the result, then copy it or download it to your device.

Input and output examples

Sort a list alphabetically from A to Z

Input

pear
apple
banana

Output

apple
banana
pear

Use natural sorting for numbered filenames

Input

file10.txt
file2.txt
file1.txt

Output

file1.txt
file2.txt
file10.txt

How this tool works

Comparison normalization never rewrites retained lines. Equal keys retain input order even when descending. Numeric mode reads the first signed decimal (dot or comma) and leaves lines without numbers at the end. Length counts grapheme clusters. Deduplication compares complete normalized line text.

Input and output stay in the current page. Refreshing or closing the page clears them. For very large inputs, use Run to start processing; a task that takes too long is stopped so you can change the input.

Frequently asked questions

What is natural sorting?

It compares digit runs as numbers, so file2 sorts before file10.

Are accents removed when ignoring case?

No. Case is ignored while accented letters remain distinct under English locale collation.