About Sort Lines
A line sorter is a tool that puts the lines of a text in order. It can sort alphabetically in either direction, in natural order (so "item 2" comes before "item 10"), by the number at the start of each line, or by line length. Alphabetical modes use English locale collation through Intl.Collator. Numeric modes read only a leading number, and lines that do not start with one count as zero.
Also known as: Sort List, Alphabetical Order Tool, Sort Text Lines.
How to use Sort Lines
- Type or paste into the "Input text" box, or press "Use example" to try it with sample data.
- Set "Sort order", "Ignore letter case" and "Drop blank lines" if the defaults do not fit.
- The result appears below and updates as you type.
- Copy the result with the copy button, or download it as a file where that is offered.
Questions about Sort Lines
Why does 10 come before 2 when I sort alphabetically?
Alphabetical sorting compares text character by character, and "1" comes before "2". Choose the Natural mode to compare whole numbers inside the text, or a Numeric mode when each line starts with a number.
Are uppercase and lowercase letters sorted separately?
Not by default. With "Ignore letter case" ticked, "apple" and "Apple" are treated as equal. Untick it and the collator places the lowercase form before the uppercase form of the same word.
Runs in your browser. Page last updated .