Alphabetize and sort lines

Put a list in alphabetical order, remove duplicates, and tidy it up. No record of your text is kept.

One item per line.

Find and replace

Paste your list

The result appears here as you type.

Result

Tell us what happened and what you expected. Please leave out personal information and private tool inputs.

These details describe your setup. They don’t include your name, email, or anything entered into the tool.

See the details included

Voting-limit status from this browser is included. Reports are stored by Netlify so I can investigate.

What it does

Paste a list with one item per line, and it comes back in alphabetical order right away:

You paste You get
banana Apple
Apple apple pie
cherry banana
apple pie cherry

Capitals don’t split the list, and numbers inside lines sort by value: “item 2” comes before “item 10”.

Options

  • Order: A to Z, Z to A, shortest first, longest first, reverse the current order, or keep the order you pasted (to use only the clean-up options).
  • Remove duplicates: keeps the first copy of each line. With Ignore capitals on, “Red” and “red” count as the same.
  • Remove empty lines and Trim extra spaces: tidy a list copied from a document or a spreadsheet.
  • Line breaks: keep each line, or join the list into one line with spaces or commas.
  • Find and replace: change a word or character on every line at once. It’s plain text, so a period means a period.

How it works

Steps run in this order: find and replace, trim spaces, remove empty lines, remove duplicates, sort, then join. Sorting uses the Unicode Collation Algorithm built into your browser, with numbers compared by value. When two lines are equal apart from capitals, the capitalized one comes first, so the order is always the same.

Limits

Sorting is by line, so a sentence that wraps onto two lines counts as two items. Use Line breaks: Join lines, keep paragraphs first if your text came from a PDF. Very large lists (hundreds of thousands of lines) can take a moment.

FAQs

How do I put a list in alphabetical order?

Paste the list with one item per line. It's sorted A to Z as you paste. Choose Z to A, shortest first, or longest first from Order if you need a different order, then copy the result.

Why does "item 10" come after "item 2"?

Numbers inside lines are sorted by their value, the way people expect, so 2 comes before 10. Plain character-by-character sorting would put "item 10" first because 1 comes before 2.

Does it sort capital letters separately?

Not by default. "apple" and "Apple" sort together. Untick Ignore capitals if you need upper and lower case treated as different, which also stops them counting as duplicates of each other.

How do I remove duplicate lines?

Tick Remove duplicates. Only the first copy of each line is kept, and the summary tells you how many were removed. With Trim extra spaces on, lines that differ only in spaces count as duplicates.

Can I turn a list into a comma-separated line?

Yes. Set Line breaks to Join with commas. You get "apple, banana, cherry", ready for an email, a spreadsheet cell, or a tag field.

How does it sort accented letters and other languages?

It uses your browser's language rules, so É sorts with E and names in other alphabets follow their own order.

Have an idea for a tool I should add? Send it in. I read every suggestion and choose which ones to build next.

For example: "Count the weekdays until a date, without holidays."

Please don't include your name, email, or anything personal. I don't need it. Voting-limit status from this browser is included.