Skip to content
Butter Tools Logo
Butter Tools

Sort Lines

Sort lines of text in any order — alphabetically, by length, numerically or randomly. Results update live.

Input
Sorted A → Z
menu_book

How to Use Sort Lines

To sort lines of text, paste your content into the left input area. Each line is treated as a separate item to be sorted. Choose your sort order — alphabetically A–Z, reverse Z–A, by line length, or randomly shuffled — and the sorted output appears instantly in the right panel.

Additional options let you sort case-insensitively so that 'apple' and 'Apple' are treated as equal, trim whitespace before sorting, and remove empty lines from the output. Click Copy to copy the sorted result. This is useful for sorting lists of names, URLs, keywords, or any line-delimited data.

help

Frequently Asked Questions

Does the sort tool handle numbers correctly? expand_more

The tool supports numeric sorting so that '10' comes after '9' rather than between '1' and '2' as it would in a purely alphabetical sort.

Can I sort lines in reverse order? expand_more

Yes. Choose the Z–A or Descending option to sort lines in reverse alphabetical or reverse numeric order.

Does it remove duplicates while sorting? expand_more

You can optionally enable duplicate removal during sorting. This combines the sort and deduplication steps in a single operation.

Is sorting case-sensitive by default? expand_more

By default, sorting is case-sensitive, meaning uppercase letters come before lowercase. You can switch to case-insensitive mode so that letter case is ignored during comparison.

Can I sort by line length? expand_more

Yes. The 'by length' option sorts lines from shortest to longest, or you can reverse it for longest to shortest. This is helpful for formatting or analysing lists by word count.