Skip to content
SoftwareSolutions.net
Other Utilities

Sort lines alphabetically

Sort a list of lines into alphabetical order.

Try it

Ready

Output

The result appears here.

About Sort lines alphabetically

A sort lines tool puts a list of lines into alphabetical order. Paste a set of names, words or items, one per line, and the tool returns the same lines sorted from A to Z. Blank lines are removed, so the output is a clean list. It is useful for tidying bibliographies, contact lists, word lists and any text that needs to be checked in order.

Alphabetical order is less obvious than it looks. Upper and lower case letters, accented characters and punctuation can all change where a line lands. The tool compares letters without regard to case, so Cherry sorts between Banana and Date rather than before all lowercase words.

How to use Sort lines alphabetically

  1. Paste your list with one item on each line.
  2. Run the sort to put the lines into alphabetical order.
  3. Check the result, especially items that start with numbers or punctuation.
  4. Copy the sorted list into your document or spreadsheet.

How the ordering works

The tool uses locale-aware comparison, which treats accented letters as their base letters. An entry starting with é sorts with the e words rather than after z, which is the order most readers expect.

Numbers sort as text, so 10 comes before 2. If you need numerical order, pad the numbers with leading zeros first, such as 02 and 10, so the text order matches the number order.

Cleaning a list before sorting

Remove duplicates and extra spaces before publishing a list. Repeated entries and trailing spaces make a list look careless and can break lookups. Check each line for typos, because sorting makes errors easy to spot.

For very long lists, sort in sections, such as by first letter, and check each section. Long lists are easy to get wrong by eye, and a second pass catches misplaced entries.

Alphabetical lists are used in indexes, glossaries and directories, and the order matters for finding entries quickly. Sorting by the first meaningful word can be better than sorting by the first word alone, especially when entries begin with an article. Decide on the rule before you sort a long list, so the whole set follows it.

Lists that mix names with titles, such as Dr or Sir, may need manual adjustment. The sort follows the first letter, so Dr Smith appears under D unless you move the title. Check how the list will be read and adjust the entries before you publish.

Sorting helps spot duplicates, because repeated lines end up next to each other. After sorting, scan the list for matching neighbours and remove the extra copies. This is a quick way to clean up a long list of addresses, product codes or keywords.

When lists contain mixed case or accents, decide whether the sort should respect them. For most public lists, a case-insensitive order reads more naturally, while codes and identifiers may need an exact order. Choose the rule that suits the list's use.

Frequently asked questions

Does the tool remove duplicate lines?

No. It removes blank lines only. Delete repeated entries yourself, or use a duplicate remover, if you need a unique list.

Are upper and lower case treated the same?

Yes. The comparison ignores case, so the order follows the letters rather than the capitals.

Will my text be sent anywhere?

The sort runs in your browser on the text you paste. Check the site's privacy policy for anything else it may store.

Related tools

Tools that pair well with this one.