✎

Line Sorter

Sort the entered lines or words alphabetically.

0Words
0Characters
0Sentences
0mReading time
Choose a file or fill the fields, then click Run tool.

About Line Sorter

Alphabetized lists are easier to scan and compare: glossary terms, guest names, inventory items, or a bibliography before formatting. Spreadsheet software can sort, but opening one for a quick list is overkill. Pasting the lines here and choosing a direction returns a clean, ordered list ready to paste back.

How it works

Each line is one item. Empty lines are removed first. The rest are sorted with the browser's localeCompare using base sensitivity and numeric ordering. Base sensitivity ignores case and accents, so 'apple', 'Apple' and 'Éclair' sort as if all lowercase and unaccented. Numeric ordering puts 'Item 2' before 'Item 10'. Choosing Z to A sorts the same way and then reverses the list. Duplicate lines are kept. Results download as sorted.txt and nothing is uploaded.

How to use Line Sorter

  1. Type or paste the text you want to process in the text box above.
  2. Complete the available fields: Order. Use the field labels and examples shown in the workspace.
  3. Select “Run tool” and check the result before copying or downloading it.

Worked example

Paste 'item 10', 'Item 2', 'banana', 'Éclair', 'apple' and choose A to Z. The output is 'apple', 'banana', 'Éclair', 'Item 2', 'item 10'. The accented É sorts with plain e, and 'Item 2' comes before 'item 10' because numbers inside the text are compared by value, not digit by digit.

Tips for a better result

  • Remove leading spaces or bullet characters before sorting, since a line starting with a space or dash sorts ahead of lines starting with letters.
  • Run Remove Duplicate Lines after sorting if the list should contain each entry once; the sorter itself keeps repeats.
  • For names stored as 'First Last', the sort uses the first name. Rewrite them as 'Last, First' first if you need surname order.

Frequently asked questions

Is sorting case-sensitive?

No. Uppercase and lowercase letters are treated as the same, and so are accented and unaccented versions of a letter. Lines that differ only by case keep a stable but unspecified order relative to each other.

How are numbers sorted?

Digit runs are compared as numbers, so '2' comes before '10' and 'Chapter 9' before 'Chapter 12'. Decimal points are not treated specially, so values like 1.5 and 1.25 may not order the way a number column would.

What happens to blank lines?

They are removed before sorting so they do not collect at the top of the list. Lines containing only spaces are not empty, though, and will sort to the top.

What to check

Review punctuation, formatting and meaning before using transformed text elsewhere.

Read the Privacy Policy for information about local processing, connected services and advertising.