🔤Alphabetical Line Sorter

Sort lines alphabetically

How to sort lines alphabetically

Paste a multi line list and it comes back in dictionary order straight away. It suits attendee lists, tag lists, filename dumps and vocabulary lists that arrived in no particular order.

Sorting uses a locale aware comparison, not raw character codes. Comparing strings with the less than operator sorts by code point, which pushes every uppercase letter ahead of every lowercase one and scatters accented letters to the end. This tool uses the browser collator instead, so the order matches what a dictionary would do.

Five options let you match the shape of your list. Numeric comparison puts item2 before item10; switch it off and item10 comes first, which is sometimes right for zero padded names. Case sensitivity separates Apple from apple and places the uppercase form first. Trimming removes invisible leading and trailing spaces that would otherwise throw the order off. Blank line removal keeps the output tight, and duplicate removal keeps one copy of each line and reports how many were dropped.

Frequently Asked Questions

Is this a plain character code comparison?

No. The tool uses the browser locale aware collator, so accented letters land next to their base letter instead of being pushed to the end the way a raw code point comparison would.

Which comes first, item2 or item10?

With the numeric option on, item2 comes first because the digits are compared by value. Turn it off and item10 sorts first, which is sometimes what you want for zero padded filenames.

How are uppercase and lowercase handled?

By default case is ignored, so Apple and apple sort next to each other. Turning on case sensitivity compares them separately and places the uppercase form first.